rockchip: add NanoPi R5C support
[openwrt/staging/hauke.git] / target / linux / rockchip / armv8 / base-files / etc / hotplug.d / net / 40-net-smp-affinity
index 9e4a4cf4fceb42abfb5f4de0426fd4c128205cd1..84064d4f8bcd2c846f90df9951461e38560db213 100644 (file)
@@ -4,8 +4,15 @@
 
 get_device_irq() {
        local device="$1"
-
-       local line=$(grep -m 1 "${device}\$" /proc/interrupts)
+       local line
+       local seconds="0"
+
+       # wait up to 10 seconds for the irq/device to appear
+       while [ "${seconds}" -le 10 ]; do
+               line=$(grep -m 1 "${device}\$" /proc/interrupts) && break
+               seconds="$(( seconds + 2 ))"
+               sleep 2
+       done
        echo ${line} | sed 's/:.*//'
 }
 
@@ -22,7 +29,10 @@ set_interface_core() {
 }
 
 case "$(board_name)" in
-friendlyarm,nanopi-r2s)
+friendlyarm,nanopi-r2c|\
+friendlyarm,nanopi-r2s|\
+xunlong,orangepi-r1-plus|\
+xunlong,orangepi-r1-plus-lts)
        set_interface_core 2 "eth0"
        set_interface_core 4 "eth1" "xhci-hcd:usb3"
        ;;
@@ -30,5 +40,14 @@ friendlyarm,nanopi-r4s)
        set_interface_core 10 "eth0"
        set_interface_core 20 "eth1"
        ;;
+friendlyarm,nanopi-r5c)
+       set_interface_core 2 "eth0"
+       set_interface_core 4 "eth1"
+       ;;
+friendlyarm,nanopi-r5s)
+       set_interface_core 2 "eth0"
+       set_interface_core 4 "eth1"
+       set_interface_core 8 "eth2"
+       ;;
 esac