rockchip: add nvme SMP IRQ for nanopi-r5s
Signed-off-by: sbwml <admin@cooluc.com>
This commit is contained in:
parent
86372ddaa1
commit
58a2564f33
42
armv8/base-files/etc/init.d/nvme-smp-affinity
Executable file
42
armv8/base-files/etc/init.d/nvme-smp-affinity
Executable file
@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=00
|
||||||
|
STOP=90
|
||||||
|
|
||||||
|
get_device_irq() {
|
||||||
|
local device="$1"
|
||||||
|
local line
|
||||||
|
local seconds="0"
|
||||||
|
|
||||||
|
while [ "${seconds}" -le 10 ]; do
|
||||||
|
line=$(grep -m 1 "${device}\$" /proc/interrupts) && break
|
||||||
|
seconds="$(( seconds + 2 ))"
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
echo ${line} | sed 's/:.*//'
|
||||||
|
}
|
||||||
|
|
||||||
|
set_smp_affinity() {
|
||||||
|
local core_mask="$1"
|
||||||
|
local interface="$2"
|
||||||
|
|
||||||
|
[ -z "$interface" ] && return 0
|
||||||
|
|
||||||
|
local irq=$(get_device_irq "$interface")
|
||||||
|
echo "${core_mask}" > /proc/irq/${irq}/smp_affinity
|
||||||
|
}
|
||||||
|
|
||||||
|
boot() {
|
||||||
|
. /lib/functions/uci-defaults.sh
|
||||||
|
|
||||||
|
case "$(board_name)" in
|
||||||
|
friendlyarm,nanopi-r5s)
|
||||||
|
set_smp_affinity "1" "nvme0q0"
|
||||||
|
set_smp_affinity "2" "nvme0q1"
|
||||||
|
set_smp_affinity "1" "nvme0q2"
|
||||||
|
set_smp_affinity "1" "nvme0q3"
|
||||||
|
set_smp_affinity "2" "nvme0q4"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
1
armv8/base-files/etc/rc.d/K00nvme-smp-affinity
Symbolic link
1
armv8/base-files/etc/rc.d/K00nvme-smp-affinity
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../init.d/nvme-smp-affinity
|
Loading…
Reference in New Issue
Block a user