mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-06-10 04:12:05 +08:00

Hardware Specification: CPU: RockChip RK3328 (4 cores) RAM: 1GB DDR4 Ethernet: 2x 1000 Base-T Flash: SPI-NOR 16 MB (mx25l12835f) LED: SYS, LAN, WAN MicroSD Slot x 1 Button: Reset USB:1x 2.0 Serial1: 13 Pin pin-header Serial2: 3 Pin debug port Type-C: for power input Power Supply: DC 5V/2A Installation: Write the image to SD Card with dd. Signed-off-by: AmadeusGhost <amadeus@jmu.edu.cn>
36 lines
642 B
Bash
36 lines
642 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|\
|
|
xunlong,orangepi-r1-plus)
|
|
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
|
|
|