difos/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity
Tianling Shen b721579842 rockchip: add NanoPi R4S support
Hardware
--------
RockChip RK3399 ARM64 (6 cores)
4GB LPDDR4 RAM
2x 1000 Base-T
3 LEDs (LAN / WAN / SYS)
1 Button (Reset)
Micro-SD slot
2x USB 3.0 Port

Installation
------------
Uncompress the OpenWrt sysupgrade and write it to a micro SD card using
dd.

=====================================
NOTICE FOR USERS WHO USE 1GB VERSION:
     BY NOW IT IS NOT SUPPORTED
====================================

[initialed target]
Co-developed-by: Marty Jones <mj8263788@gmail.com>
Signed-off-by: Marty Jones <mj8263788@gmail.com>
[fixed bootscript]
Co-developed-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
Signed-off-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-06-10 10:34:44 +02:00

34 lines
615 B
Bash

#!/bin/sh
[ "$ACTION" = add ] || exit
get_device_irq() {
local device="$1"
local line=$(grep -m 1 "${device}\$" /proc/interrupts)
echo ${line} | sed 's/:.*//'
}
set_interface_core() {
local core_mask="$1"
local interface="$2"
local device="$3"
[ -z "${device}" ] && device="$interface"
local irq=$(get_device_irq "$device")
echo "${core_mask}" > /proc/irq/${irq}/smp_affinity
}
case "$(board_name)" in
friendlyarm,nanopi-r2s)
set_interface_core 2 "eth0"
set_interface_core 4 "eth1" "xhci-hcd:usb3"
;;
friendlyarm,nanopi-r4s)
set_interface_core 10 "eth0"
set_interface_core 20 "eth1"
;;
esac