rockchip add NanoPi R4S support
This commit is contained in:
parent
a11af7df9c
commit
4a0432bfce
@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
BOARD:=rockchip
|
||||
BOARDNAME:=Rockchip
|
||||
FEATURES:=ext4 audio usb usbgadget display gpio fpu rootfs-part boot-part squashfs
|
||||
FEATURES:=ext4 audio usb usbgadget display gpio fpu pci pcie rootfs-part boot-part squashfs
|
||||
SUBTARGETS:=armv8
|
||||
|
||||
KERNEL_PATCHVER=5.4
|
||||
|
||||
@ -13,6 +13,10 @@ friendlyarm,nanopi-r2s)
|
||||
ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
|
||||
ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1"
|
||||
;;
|
||||
friendlyarm,nanopi-r4s)
|
||||
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
|
||||
ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth1"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
@ -8,7 +8,8 @@ rockchip_setup_interfaces()
|
||||
local board="$1"
|
||||
|
||||
case "$board" in
|
||||
friendlyarm,nanopi-r2s)
|
||||
friendlyarm,nanopi-r2s|\
|
||||
friendlyarm,nanopi-r4s)
|
||||
ucidef_set_interfaces_lan_wan 'eth1' 'eth0'
|
||||
ucidef_set_interface "lan" ipaddr "192.168.100.1"
|
||||
;;
|
||||
@ -20,7 +21,7 @@ rockchip_setup_interfaces()
|
||||
|
||||
nanopi_r2s_generate_mac()
|
||||
{
|
||||
local sd_hash=$(sha256sum /sys/devices/platform/ff500000.dwmmc/mmc_host/mmc0/mmc0:*/cid)
|
||||
local sd_hash=$(sha256sum /sys/class/block/$1/device/cid)
|
||||
local mac_base=$(macaddr_canonicalize "$(echo "${sd_hash}" | dd bs=1 count=12 2>/dev/null)")
|
||||
echo "$(macaddr_unsetbit_mc "$(macaddr_setbit_la "${mac_base}")")"
|
||||
}
|
||||
@ -34,8 +35,17 @@ rockchip_setup_macs()
|
||||
|
||||
case "$board" in
|
||||
friendlyarm,nanopi-r2s)
|
||||
wan_mac=$(nanopi_r2s_generate_mac)
|
||||
lan_mac=$(macaddr_add "$wan_mac" +1)
|
||||
wan_mac=$(nanopi_r2s_generate_mac mmcblk0)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
;;
|
||||
friendlyarm,nanopi-r4s)
|
||||
if [ -f /sys/bus/i2c/devices/2-0051/eeprom ]; then
|
||||
wan_mac=$(get_mac_binary "/sys/bus/i2c/devices/2-0051/eeprom" 0xfa)
|
||||
lan_mac=$(macaddr_setbit_la "$wan_mac")
|
||||
else
|
||||
wan_mac=$(nanopi_r2s_generate_mac mmcblk0)
|
||||
lan_mac=$(macaddr_add "$wan_mac" 1)
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
@ -26,5 +26,9 @@ 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
|
||||
|
||||
|
||||
@ -140,6 +140,7 @@ CONFIG_DUMMY_CONSOLE=y
|
||||
CONFIG_DWMAC_DWC_QOS_ETH=y
|
||||
CONFIG_DWMAC_GENERIC=y
|
||||
CONFIG_DWMAC_ROCKCHIP=y
|
||||
CONFIG_EEPROM_AT24=y
|
||||
CONFIG_EMAC_ROCKCHIP=y
|
||||
CONFIG_ENABLE_MUST_CHECK=y
|
||||
CONFIG_ENERGY_MODEL=y
|
||||
|
||||
@ -12,6 +12,17 @@ define Device/friendlyarm_nanopi-r2s
|
||||
endef
|
||||
TARGET_DEVICES += friendlyarm_nanopi-r2s
|
||||
|
||||
define Device/friendlyarm_nanopi-r4s
|
||||
DEVICE_VENDOR := FriendlyARM
|
||||
DEVICE_MODEL := NanoPi R4S
|
||||
DEVICE_VARIANT := 4GB LPDDR4
|
||||
SOC := rk3399
|
||||
UBOOT_DEVICE_NAME := nanopi-r4s-rk3399
|
||||
IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r4s | pine64-img | gzip | append-metadata
|
||||
DEVICE_PACKAGES := kmod-r8169
|
||||
endef
|
||||
TARGET_DEVICES += friendlyarm_nanopi-r4s
|
||||
|
||||
define Device/pine64_rockpro64
|
||||
DEVICE_VENDOR := Pine64
|
||||
DEVICE_MODEL := RockPro64
|
||||
|
||||
Loading…
Reference in New Issue
Block a user