AmadeusGhost ee6fb24811
rockchip: add support for OrangePi R1 Plus (#6620)
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>
2021-03-30 14:03:34 +08:00

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