rockchip: add NanoPi R4S support
authorTianling Shen <cnsztl@immortalwrt.org>
Fri, 25 Dec 2020 12:03:14 +0000 (20:03 +0800)
committerDavid Bauer <mail@david-bauer.net>
Thu, 10 Jun 2021 08:34:44 +0000 (10:34 +0200)
Hardware
--------
RockChip RK3399 ARM64 (6 cores)
4GB LPDDR4 RAM
2x 1000 Base-T
3 LEDs (LAN / WAN / SYS)
1 Button (Reset)
Micro-SD slot
2x USB 3.0 Port

Installation
------------
Uncompress the OpenWrt sysupgrade and write it to a micro SD card using
dd.

=====================================
NOTICE FOR USERS WHO USE 1GB VERSION:
     BY NOW IT IS NOT SUPPORTED
====================================

[initialed target]
Co-developed-by: Marty Jones <mj8263788@gmail.com>
Signed-off-by: Marty Jones <mj8263788@gmail.com>
[fixed bootscript]
Co-developed-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
Signed-off-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
12 files changed:
target/linux/rockchip/Makefile
target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
target/linux/rockchip/armv8/base-files/etc/board.d/02_network
target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity
target/linux/rockchip/armv8/config-5.10
target/linux/rockchip/armv8/config-5.4
target/linux/rockchip/image/armv8.mk
target/linux/rockchip/image/nanopi-r4s.bootscript [new file with mode: 0644]
target/linux/rockchip/patches-5.10/004-v5.13-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch [new file with mode: 0644]
target/linux/rockchip/patches-5.10/005-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch [new file with mode: 0644]
target/linux/rockchip/patches-5.4/007-v5.13-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch [new file with mode: 0644]
target/linux/rockchip/patches-5.4/008-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch [new file with mode: 0644]

index 7aeb0a3d55f422b2cd75de8060ca155598b5343c..f7b6995911870f0d6a238a4586efe4fdb12aedbf 100644 (file)
@@ -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
index e97ea3312d387ffc1d4aec34a35ac04beb435f37..b10c43ba6052ec6a6fc2dcf095f93cd6e237c274 100644 (file)
@@ -12,6 +12,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
index 8371913f8a296ce2fbade85da3c1456f9c8b0de4..91bdb760d51d26fc09d2ca7cfa70752557a46d8e 100644 (file)
@@ -7,7 +7,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'
                ;;
        *)
@@ -35,6 +36,10 @@ rockchip_setup_macs()
                wan_mac=$(nanopi_r2s_generate_mac)
                lan_mac=$(macaddr_add "$wan_mac" 1)
                ;;
+       friendlyarm,nanopi-r4s)
+               wan_mac=$(get_mac_binary "/sys/bus/i2c/devices/2-0051/eeprom" 0xfa)
+               lan_mac=$(macaddr_setbit_la "$wan_mac")
+               ;;
        esac
 
        [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
index 44716258bf2d37a8929d53300093ee3ddc4103ec..9e4a4cf4fceb42abfb5f4de0426fd4c128205cd1 100644 (file)
@@ -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
 
index c85984a982d6762f16782d460adec608d52586e4..734530a9c71c04710fc60fb3a2ea12fb911399d4 100644 (file)
@@ -197,6 +197,7 @@ CONFIG_DWMAC_DWC_QOS_ETH=y
 CONFIG_DWMAC_GENERIC=y
 CONFIG_DWMAC_ROCKCHIP=y
 CONFIG_EDAC_SUPPORT=y
+CONFIG_EEPROM_AT24=y
 CONFIG_EMAC_ROCKCHIP=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_ENERGY_MODEL=y
index 7aadb477cb670a85d3e3a8bc1784122c5d656ece..0844401c2e748d0c0be3cebcf46591154164b434 100644 (file)
@@ -182,6 +182,7 @@ CONFIG_DWMAC_DWC_QOS_ETH=y
 CONFIG_DWMAC_GENERIC=y
 CONFIG_DWMAC_ROCKCHIP=y
 CONFIG_EDAC_SUPPORT=y
+CONFIG_EEPROM_AT24=y
 CONFIG_EMAC_ROCKCHIP=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_ENERGY_MODEL=y
index 24b1c38137a4efd4afbf385c284d8276977c69b3..ee411d266b32630fcf85269387c5222ff76b9e55 100644 (file)
@@ -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
diff --git a/target/linux/rockchip/image/nanopi-r4s.bootscript b/target/linux/rockchip/image/nanopi-r4s.bootscript
new file mode 100644 (file)
index 0000000..abe9c24
--- /dev/null
@@ -0,0 +1,8 @@
+part uuid mmc ${devnum}:2 uuid
+
+setenv bootargs "console=ttyS2,1500000 earlycon=uart8250,mmio32,0xff1a0000 root=PARTUUID=${uuid} rw rootwait"
+
+load mmc ${devnum}:1 ${fdt_addr_r} rockchip.dtb
+load mmc ${devnum}:1 ${kernel_addr_r} kernel.img
+
+booti ${kernel_addr_r} - ${fdt_addr_r}
diff --git a/target/linux/rockchip/patches-5.10/004-v5.13-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch b/target/linux/rockchip/patches-5.10/004-v5.13-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch
new file mode 100644 (file)
index 0000000..461a5ae
--- /dev/null
@@ -0,0 +1,177 @@
+From db792e9adbf85ffc9d6b0b060ac3c8e3148c8992 Mon Sep 17 00:00:00 2001
+From: Tianling Shen <cnsztl@gmail.com>
+Date: Fri, 19 Mar 2021 13:16:27 +0800
+Subject: [PATCH] rockchip: rk3399: Add support for FriendlyARM NanoPi R4S
+
+This adds support for the NanoPi R4S from FriendlyArm.
+
+Rockchip RK3399 SoC
+1GB DDR3 or 4GB LPDDR4 RAM
+Gigabit Ethernet (WAN)
+Gigabit Ethernet (PCIe) (LAN)
+USB 3.0 Port x 2
+MicroSD slot
+Reset button
+WAN - LAN - SYS LED
+
+Co-developed-by: Jensen Huang <jensenhuang@friendlyarm.com>
+Signed-off-by: Jensen Huang <jensenhuang@friendlyarm.com>
+[minor adjustments]
+Co-developed-by: Marty Jones <mj8263788@gmail.com>
+Signed-off-by: Marty Jones <mj8263788@gmail.com>
+[further adjustments, fixed format issues]
+Signed-off-by: Tianling Shen <cnsztl@gmail.com>
+Link: https://lore.kernel.org/r/20210319051627.814-2-cnsztl@gmail.com
+Signed-off-by: Heiko Stuebner <heiko@sntech.de>
+---
+ arch/arm64/boot/dts/rockchip/Makefile         |   1 +
+ .../boot/dts/rockchip/rk3399-nanopi-r4s.dts   | 133 +++++++++++++++++++++
+ 2 files changed, 134 insertions(+)
+ create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
+
+--- a/arch/arm64/boot/dts/rockchip/Makefile
++++ b/arch/arm64/boot/dts/rockchip/Makefile
+@@ -30,6 +30,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-le
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopc-t4.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-m4.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-neo4.dtb
++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinebook-pro.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb
+--- /dev/null
++++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
+@@ -0,0 +1,133 @@
++// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
++/*
++ * FriendlyElec NanoPC-T4 board device tree source
++ *
++ * Copyright (c) 2020 FriendlyElec Computer Tech. Co., Ltd.
++ * (http://www.friendlyarm.com)
++ *
++ * Copyright (c) 2018 Collabora Ltd.
++ *
++ * Copyright (c) 2020 Jensen Huang <jensenhuang@friendlyarm.com>
++ * Copyright (c) 2020 Marty Jones <mj8263788@gmail.com>
++ * Copyright (c) 2021 Tianling Shen <cnsztl@gmail.com>
++ */
++
++/dts-v1/;
++#include "rk3399-nanopi4.dtsi"
++
++/ {
++      model = "FriendlyElec NanoPi R4S";
++      compatible = "friendlyarm,nanopi-r4s", "rockchip,rk3399";
++
++      /delete-node/ display-subsystem;
++
++      gpio-leds {
++              pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>;
++
++              /delete-node/ led-0;
++
++              lan_led: led-lan {
++                      gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
++                      label = "green:lan";
++              };
++
++              sys_led: led-sys {
++                      gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
++                      label = "red:sys";
++                      default-state = "on";
++              };
++
++              wan_led: led-wan {
++                      gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
++                      label = "green:wan";
++              };
++      };
++
++      gpio-keys {
++              pinctrl-0 = <&reset_button_pin>;
++
++              /delete-node/ power;
++
++              reset {
++                      debounce-interval = <50>;
++                      gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_LOW>;
++                      label = "reset";
++                      linux,code = <KEY_RESTART>;
++              };
++      };
++
++      vdd_5v: vdd-5v {
++              compatible = "regulator-fixed";
++              regulator-name = "vdd_5v";
++              regulator-always-on;
++              regulator-boot-on;
++      };
++};
++
++&emmc_phy {
++      status = "disabled";
++};
++
++&i2c4 {
++      status = "disabled";
++};
++
++&pcie0 {
++      max-link-speed = <1>;
++      num-lanes = <1>;
++      vpcie3v3-supply = <&vcc3v3_sys>;
++};
++
++&pinctrl {
++      gpio-leds {
++              /delete-node/ status-led-pin;
++
++              lan_led_pin: lan-led-pin {
++                      rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
++              };
++
++              sys_led_pin: sys-led-pin {
++                      rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
++              };
++
++              wan_led_pin: wan-led-pin {
++                      rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
++              };
++      };
++
++      rockchip-key {
++              /delete-node/ power-key;
++
++              reset_button_pin: reset-button-pin {
++                      rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
++              };
++      };
++};
++
++&sdhci {
++      status = "disabled";
++};
++
++&sdio0 {
++      status = "disabled";
++};
++
++&u2phy0_host {
++      phy-supply = <&vdd_5v>;
++};
++
++&u2phy1_host {
++      status = "disabled";
++};
++
++&uart0 {
++      status = "disabled";
++};
++
++&usbdrd_dwc3_0 {
++      dr_mode = "host";
++};
++
++&vcc3v3_sys {
++      vin-supply = <&vcc5v0_sys>;
++};
diff --git a/target/linux/rockchip/patches-5.10/005-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch b/target/linux/rockchip/patches-5.10/005-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch
new file mode 100644 (file)
index 0000000..792028b
--- /dev/null
@@ -0,0 +1,31 @@
+From af20b3384e8723077cc6484160b0cf4e9be321de Mon Sep 17 00:00:00 2001
+From: Tianling Shen <cnsztl@gmail.com>
+Date: Mon, 7 Jun 2021 15:45:37 +0800
+Subject: [PATCH] arm64: dts: rockchip: add EEPROM node for NanoPi R4S
+
+NanoPi R4S has a EEPROM attached to the 2nd I2C bus (U92), which
+stores the MAC address.
+
+Signed-off-by: Tianling Shen <cnsztl@gmail.com>
+---
+ arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
++++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
+@@ -68,6 +68,15 @@
+       status = "disabled";
+ };
++&i2c2 {
++      eeprom@51 {
++              compatible = "microchip,24c02", "atmel,24c02";
++              reg = <0x51>;
++              pagesize = <16>;
++              read-only; /* This holds our MAC */
++      };
++};
++
+ &i2c4 {
+       status = "disabled";
+ };
diff --git a/target/linux/rockchip/patches-5.4/007-v5.13-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch b/target/linux/rockchip/patches-5.4/007-v5.13-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch
new file mode 100644 (file)
index 0000000..c508d71
--- /dev/null
@@ -0,0 +1,177 @@
+From db792e9adbf85ffc9d6b0b060ac3c8e3148c8992 Mon Sep 17 00:00:00 2001
+From: Tianling Shen <cnsztl@gmail.com>
+Date: Fri, 19 Mar 2021 13:16:27 +0800
+Subject: [PATCH] rockchip: rk3399: Add support for FriendlyARM NanoPi R4S
+
+This adds support for the NanoPi R4S from FriendlyArm.
+
+Rockchip RK3399 SoC
+1GB DDR3 or 4GB LPDDR4 RAM
+Gigabit Ethernet (WAN)
+Gigabit Ethernet (PCIe) (LAN)
+USB 3.0 Port x 2
+MicroSD slot
+Reset button
+WAN - LAN - SYS LED
+
+Co-developed-by: Jensen Huang <jensenhuang@friendlyarm.com>
+Signed-off-by: Jensen Huang <jensenhuang@friendlyarm.com>
+[minor adjustments]
+Co-developed-by: Marty Jones <mj8263788@gmail.com>
+Signed-off-by: Marty Jones <mj8263788@gmail.com>
+[further adjustments, fixed format issues]
+Signed-off-by: Tianling Shen <cnsztl@gmail.com>
+Link: https://lore.kernel.org/r/20210319051627.814-2-cnsztl@gmail.com
+Signed-off-by: Heiko Stuebner <heiko@sntech.de>
+---
+ arch/arm64/boot/dts/rockchip/Makefile         |   1 +
+ .../boot/dts/rockchip/rk3399-nanopi-r4s.dts   | 133 +++++++++++++++++++++
+ 2 files changed, 134 insertions(+)
+ create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
+
+--- a/arch/arm64/boot/dts/rockchip/Makefile
++++ b/arch/arm64/boot/dts/rockchip/Makefile
+@@ -25,6 +25,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-le
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopc-t4.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-m4.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-neo4.dtb
++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc.dtb
+--- /dev/null
++++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
+@@ -0,0 +1,133 @@
++// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
++/*
++ * FriendlyElec NanoPC-T4 board device tree source
++ *
++ * Copyright (c) 2020 FriendlyElec Computer Tech. Co., Ltd.
++ * (http://www.friendlyarm.com)
++ *
++ * Copyright (c) 2018 Collabora Ltd.
++ *
++ * Copyright (c) 2020 Jensen Huang <jensenhuang@friendlyarm.com>
++ * Copyright (c) 2020 Marty Jones <mj8263788@gmail.com>
++ * Copyright (c) 2021 Tianling Shen <cnsztl@gmail.com>
++ */
++
++/dts-v1/;
++#include "rk3399-nanopi4.dtsi"
++
++/ {
++      model = "FriendlyElec NanoPi R4S";
++      compatible = "friendlyarm,nanopi-r4s", "rockchip,rk3399";
++
++      /delete-node/ display-subsystem;
++
++      gpio-leds {
++              pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>;
++
++              /delete-node/ status;
++
++              lan_led: led-lan {
++                      gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
++                      label = "green:lan";
++              };
++
++              sys_led: led-sys {
++                      gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
++                      label = "red:sys";
++                      default-state = "on";
++              };
++
++              wan_led: led-wan {
++                      gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
++                      label = "green:wan";
++              };
++      };
++
++      gpio-keys {
++              pinctrl-0 = <&reset_button_pin>;
++
++              /delete-node/ power;
++
++              reset {
++                      debounce-interval = <50>;
++                      gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_LOW>;
++                      label = "reset";
++                      linux,code = <KEY_RESTART>;
++              };
++      };
++
++      vdd_5v: vdd-5v {
++              compatible = "regulator-fixed";
++              regulator-name = "vdd_5v";
++              regulator-always-on;
++              regulator-boot-on;
++      };
++};
++
++&emmc_phy {
++      status = "disabled";
++};
++
++&i2c4 {
++      status = "disabled";
++};
++
++&pcie0 {
++      max-link-speed = <1>;
++      num-lanes = <1>;
++      vpcie3v3-supply = <&vcc3v3_sys>;
++};
++
++&pinctrl {
++      gpio-leds {
++              /delete-node/ leds-gpio;
++
++              lan_led_pin: lan-led-pin {
++                      rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
++              };
++
++              sys_led_pin: sys-led-pin {
++                      rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
++              };
++
++              wan_led_pin: wan-led-pin {
++                      rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
++              };
++      };
++
++      rockchip-key {
++              /delete-node/ power-key;
++
++              reset_button_pin: reset-button-pin {
++                      rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
++              };
++      };
++};
++
++&sdhci {
++      status = "disabled";
++};
++
++&sdio0 {
++      status = "disabled";
++};
++
++&u2phy0_host {
++      phy-supply = <&vdd_5v>;
++};
++
++&u2phy1_host {
++      status = "disabled";
++};
++
++&uart0 {
++      status = "disabled";
++};
++
++&usbdrd_dwc3_0 {
++      dr_mode = "host";
++};
++
++&vcc3v3_sys {
++      vin-supply = <&vcc5v0_sys>;
++};
diff --git a/target/linux/rockchip/patches-5.4/008-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch b/target/linux/rockchip/patches-5.4/008-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch
new file mode 100644 (file)
index 0000000..792028b
--- /dev/null
@@ -0,0 +1,31 @@
+From af20b3384e8723077cc6484160b0cf4e9be321de Mon Sep 17 00:00:00 2001
+From: Tianling Shen <cnsztl@gmail.com>
+Date: Mon, 7 Jun 2021 15:45:37 +0800
+Subject: [PATCH] arm64: dts: rockchip: add EEPROM node for NanoPi R4S
+
+NanoPi R4S has a EEPROM attached to the 2nd I2C bus (U92), which
+stores the MAC address.
+
+Signed-off-by: Tianling Shen <cnsztl@gmail.com>
+---
+ arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
++++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
+@@ -68,6 +68,15 @@
+       status = "disabled";
+ };
++&i2c2 {
++      eeprom@51 {
++              compatible = "microchip,24c02", "atmel,24c02";
++              reg = <0x51>;
++              pagesize = <16>;
++              read-only; /* This holds our MAC */
++      };
++};
++
+ &i2c4 {
+       status = "disabled";
+ };