Skip to contentSkip to conversation

board: rockchip: Add FriendlyElec NanoPi Zero2

PATCH Superseded Jonas Karlman 4 participants 6 messages Jan 10 – Mar 8

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: rockchip: Add FriendlyElec NanoPi Zero2

The NanoPi Zero2 is a small single board computer developed by FriendlyElec, based on the Rockchip RK3528A SoC.

Add support for the FriendlyElec NanoPi Zero2 board.

Features tested on a FriendlyElec NanoPi Zero2 2407:
- SD-card boot
- eMMC boot
- Ethernet
- USB host

---
 arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi | 11 ++++
 arch/arm/mach-rockchip/rk3528/MAINTAINERS    |  6 ++
 configs/nanopi-zero2-rk3528_defconfig        | 64 ++++++++++++++++++++
 doc/board/rockchip/rockchip.rst              |  1 +
 4 files changed, 82 insertions(+)
 create mode 100644 arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi
 create mode 100644 configs/nanopi-zero2-rk3528_defconfig
arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi new file +11 -0
new file mode 100644
index 000000000000..3e2fbd81da17
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+#include "rk3528-u-boot.dtsi"
+
+&vdd_arm {
+	regulator-init-microvolt = <953000>;
+};
+
+&vdd_logic {
+	regulator-init-microvolt = <900000>;
+};
arch/arm/mach-rockchip/rk3528/MAINTAINERS +6 -0
index ee840396e8b0..111fe0270dfd 100644
@@ -4,6 +4,12 @@ S:	Maintained
 F:	arch/arm/dts/rk3528-generic*
 F:	configs/generic-rk3528_defconfig
 
+NANOPI-ZERO2-RK3528
+M:	Jonas Karlman <[email protected]>
+S:	Maintained
+F:	arch/arm/dts/rk3528-nanopi-zero2*
+F:	configs/nanopi-zero2-rk3528_defconfig
+
 RADXA-E20C
 M:	Jonas Karlman <[email protected]>
 S:	Maintained
configs/nanopi-zero2-rk3528_defconfig new file +64 -0

64 lines not on this page · raw message

doc/board/rockchip/rockchip.rst +1 -0
index c1683bfe4212..01659ecc3cbe 100644
@@ -101,6 +101,7 @@ List of mainline supported Rockchip boards:
 
 * rk3528
      - ArmSoM Sige1 (sige1-rk3528)
+     - FriendlyElec NanoPi Zero2 (nanopi-zero2-rk3528)
      - Generic RK3528 (generic-rk3528)
      - Radxa E20C (radxa-e20c-rk3528)
      - Radxa ROCK 2A/2F (rock-2-rk3528)
Signature · 1 line
2.52.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Jonas,

Quoted 5 lines · Jonas Karlman

The NanoPi Zero2 is a small single board computer developed by FriendlyElec, based on the Rockchip RK3528A SoC.

Add support for the FriendlyElec NanoPi Zero2 board.

Quoted 7 lines

Features tested on a FriendlyElec NanoPi Zero2 2407:
- SD-card boot
- eMMC boot
- Ethernet
- USB host

Quoted 125 lines
---
 arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi | 11 ++++
 arch/arm/mach-rockchip/rk3528/MAINTAINERS    |  6 ++
 configs/nanopi-zero2-rk3528_defconfig        | 64 ++++++++++++++++++++
 doc/board/rockchip/rockchip.rst              |  1 +
 4 files changed, 82 insertions(+)
 create mode 100644 arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi
 create mode 100644 configs/nanopi-zero2-rk3528_defconfig
arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi new file +11 -0
new file mode 100644
index 000000000000..3e2fbd81da17
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+#include "rk3528-u-boot.dtsi"
+
+&vdd_arm {
+	regulator-init-microvolt = <953000>;
+};
+
+&vdd_logic {
+	regulator-init-microvolt = <900000>;
+};
arch/arm/mach-rockchip/rk3528/MAINTAINERS +6 -0
index ee840396e8b0..111fe0270dfd 100644
@@ -4,6 +4,12 @@ S:	Maintained
 F:	arch/arm/dts/rk3528-generic*
 F:	configs/generic-rk3528_defconfig
 
+NANOPI-ZERO2-RK3528
+M:	Jonas Karlman <[email protected]>
+S:	Maintained
+F:	arch/arm/dts/rk3528-nanopi-zero2*
+F:	configs/nanopi-zero2-rk3528_defconfig
+
 RADXA-E20C
 M:	Jonas Karlman <[email protected]>
 S:	Maintained
configs/nanopi-zero2-rk3528_defconfig new file +64 -0
new file mode 100644
index 000000000000..2e54c0ff20a2
@@ -0,0 +1,64 @@
+CONFIG_ARM=y
+CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3528-nanopi-zero2"
+CONFIG_ROCKCHIP_RK3528=y
+CONFIG_SYS_LOAD_ADDR=0xc00800
+CONFIG_DEBUG_UART_BASE=0xFF9F0000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_DEBUG_UART=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3528-nanopi-zero2.dtb"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_BOARD_RNG_SEED=y
+CONFIG_SPL_MAX_SIZE=0x40000
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_MEMINFO_MAP=y
+CONFIG_CMD_ADC=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MISC=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_ROCKUSB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_RNG=y
+CONFIG_CMD_REGULATOR=y
+# CONFIG_SPL_DOS_PARTITION is not set
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_BUTTON=y
+CONFIG_BUTTON_ADC=y
+# CONFIG_USB_FUNCTION_FASTBOOT is not set
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+CONFIG_SUPPORT_EMMC_RPMB=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_SDMA=y
+CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_PHY_REALTEK=y
+CONFIG_DM_MDIO=y
+CONFIG_DWC_ETH_QOS=y
+CONFIG_DWC_ETH_QOS_ROCKCHIP=y
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
+CONFIG_REGULATOR_PWM=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_PWM_ROCKCHIP=y
+CONFIG_BAUDRATE=1500000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_USB_FUNCTION_ROCKUSB=y
+CONFIG_ERRNO_STR=y
doc/board/rockchip/rockchip.rst +1 -0
index c1683bfe4212..01659ecc3cbe 100644
@@ -101,6 +101,7 @@ List of mainline supported Rockchip boards:
 
 * rk3528
      - ArmSoM Sige1 (sige1-rk3528)
+     - FriendlyElec NanoPi Zero2 (nanopi-zero2-rk3528)
      - Generic RK3528 (generic-rk3528)
      - Radxa E20C (radxa-e20c-rk3528)
      - Radxa ROCK 2A/2F (rock-2-rk3528)
#2 lore raw
In reply to Jonas Karlman

Hi Jonas,

Quoted 28 lines · Jonas Karlman

The NanoPi Zero2 is a small single board computer developed by FriendlyElec, based on the Rockchip RK3528A SoC.

Add support for the FriendlyElec NanoPi Zero2 board.

Features tested on a FriendlyElec NanoPi Zero2 2407:
- SD-card boot
- eMMC boot
- Ethernet
- USB host

---
  arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi | 11 ++++
  arch/arm/mach-rockchip/rk3528/MAINTAINERS    |  6 ++
  configs/nanopi-zero2-rk3528_defconfig        | 64 ++++++++++++++++++++
  doc/board/rockchip/rockchip.rst              |  1 +
  4 files changed, 82 insertions(+)

create mode 100644 arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi create mode 100644 configs/nanopi-zero2-rk3528_defconfig

arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi new file +1 -0
new file mode 100644
index 000000000000..3e2fbd81da17
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)

arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi line 11

Quoted 10 lines
arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi new file +10 -0
+
+#include "rk3528-u-boot.dtsi"
+
+&vdd_arm {
+	regulator-init-microvolt = <953000>;
+};
+
+&vdd_logic {
+	regulator-init-microvolt = <900000>;
+};

Why? We need an explanation here to know if and when we can get rid of those additions. Why aren't those in the Linux kernel tree?

OK to me otherwise.

Cheers,
Quentin

#3 lore raw

Hi Quentin,

Quoted 36 lines · Quentin Schulz

Hi Jonas,

Quoted 33 lines · Jonas Karlman

The NanoPi Zero2 is a small single board computer developed by FriendlyElec, based on the Rockchip RK3528A SoC.

Add support for the FriendlyElec NanoPi Zero2 board.

Features tested on a FriendlyElec NanoPi Zero2 2407:
- SD-card boot
- eMMC boot
- Ethernet
- USB host

---
  arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi | 11 ++++
  arch/arm/mach-rockchip/rk3528/MAINTAINERS    |  6 ++
  configs/nanopi-zero2-rk3528_defconfig        | 64 ++++++++++++++++++++
  doc/board/rockchip/rockchip.rst              |  1 +
  4 files changed, 82 insertions(+)

create mode 100644 arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi create mode 100644 configs/nanopi-zero2-rk3528_defconfig

arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi new file +6 -0
new file mode 100644
index 000000000000..3e2fbd81da17
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+#include "rk3528-u-boot.dtsi"
+
+&vdd_arm {
+	regulator-init-microvolt = <953000>;
Quoted 8 lines

arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi line 11

Quoted 5 lines
arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi new file +5 -0
+};
+
+&vdd_logic {
+	regulator-init-microvolt = <900000>;
+};

Why? We need an explanation here to know if and when we can get rid of those additions. Why aren't those in the Linux kernel tree?

All prior regulator-init-microvolt props was purged from Linux DTs some time ago [1], instead of adding a dt-binding for this prop :/

After that change we now need to keep track of any initial microvolt that should be set by U-Boot in -u-boot.dtsi files.

If I remember correctly these regulators may have been initialized with too low or high voltage out of reset, and this ensure stable operation.

[1] https://lore.kernel.org/all/[email protected]/

Regards,
Jonas

Quoted 5 lines

OK to me otherwise.

Cheers,
Quentin

Reviewed-by
#4 lore raw

Hi Jonas,

Quoted 48 lines · Jonas Karlman

Hi Quentin,

Quoted 36 lines · Quentin Schulz

Hi Jonas,

Quoted 33 lines · Jonas Karlman

The NanoPi Zero2 is a small single board computer developed by FriendlyElec, based on the Rockchip RK3528A SoC.

Add support for the FriendlyElec NanoPi Zero2 board.

Features tested on a FriendlyElec NanoPi Zero2 2407:
- SD-card boot
- eMMC boot
- Ethernet
- USB host

---
   arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi | 11 ++++
   arch/arm/mach-rockchip/rk3528/MAINTAINERS    |  6 ++
   configs/nanopi-zero2-rk3528_defconfig        | 64 ++++++++++++++++++++
   doc/board/rockchip/rockchip.rst              |  1 +
   4 files changed, 82 insertions(+)

create mode 100644 arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi create mode 100644 configs/nanopi-zero2-rk3528_defconfig

arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi new file +6 -0
new file mode 100644
index 000000000000..3e2fbd81da17
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+#include "rk3528-u-boot.dtsi"
+
+&vdd_arm {
+	regulator-init-microvolt = <953000>;
Quoted 8 lines

arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi line 11

Quoted 5 lines
arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi new file +5 -0
+};
+
+&vdd_logic {
+	regulator-init-microvolt = <900000>;
+};

Why? We need an explanation here to know if and when we can get rid of those additions. Why aren't those in the Linux kernel tree?

Quoted 9 lines

All prior regulator-init-microvolt props was purged from Linux DTs some time ago [1], instead of adding a dt-binding for this prop :/

After that change we now need to keep track of any initial microvolt that should be set by U-Boot in -u-boot.dtsi files.

If I remember correctly these regulators may have been initialized with too low or high voltage out of reset, and this ensure stable operation.

That seems odd to me. Why could it reach U-Boot (where the regulator driver would then enable the regulator at voltage init-microvolt) if the regulator was initialized too low/high out of reset? Especially for vdd_arm, the CPU supply.

I'm not sure we'll be able to convince the DT binding people to add this property though, it all seems like a problem related to devfreq not being handled in U-Boot that could be resolved by configuring the clock-tree + regulator-tree properly appropriately I guess (which is easier said than done :) ).

We already have plenty of boards with that property (including some I maintain... news to me :) ), one more won't hurt us, so

Thanks,
Quentin

Reviewed-by on v1 1/1
#5 lore raw
In reply to Jonas Karlman
Quoted 5 lines · Jonas Karlman

The NanoPi Zero2 is a small single board computer developed by FriendlyElec, based on the Rockchip RK3528A SoC.

Add support for the FriendlyElec NanoPi Zero2 board.

Quoted 7 lines

Features tested on a FriendlyElec NanoPi Zero2 2407:
- SD-card boot
- eMMC boot
- Ethernet
- USB host

Thanks,
- Kever

Quoted 125 lines
---
  arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi | 11 ++++
  arch/arm/mach-rockchip/rk3528/MAINTAINERS    |  6 ++
  configs/nanopi-zero2-rk3528_defconfig        | 64 ++++++++++++++++++++
  doc/board/rockchip/rockchip.rst              |  1 +
  4 files changed, 82 insertions(+)

create mode 100644 arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi create mode 100644 configs/nanopi-zero2-rk3528_defconfig

arch/arm/dts/rk3528-nanopi-zero2-u-boot.dtsi new file +11 -0
new file mode 100644
index 000000000000..3e2fbd81da17
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+#include "rk3528-u-boot.dtsi"
+
+&vdd_arm {
+	regulator-init-microvolt = <953000>;
+};
+
+&vdd_logic {
+	regulator-init-microvolt = <900000>;
+};
arch/arm/mach-rockchip/rk3528/MAINTAINERS +6 -0
index ee840396e8b0..111fe0270dfd 100644
@@ -4,6 +4,12 @@ S:	Maintained
  F:	arch/arm/dts/rk3528-generic*
  F:	configs/generic-rk3528_defconfig
 
+NANOPI-ZERO2-RK3528
+M:	Jonas Karlman <[email protected]>
+S:	Maintained
+F:	arch/arm/dts/rk3528-nanopi-zero2*
+F:	configs/nanopi-zero2-rk3528_defconfig
+
  RADXA-E20C
  M:	Jonas Karlman <[email protected]>
  S:	Maintained
configs/nanopi-zero2-rk3528_defconfig new file +64 -0
new file mode 100644
index 000000000000..2e54c0ff20a2
@@ -0,0 +1,64 @@
+CONFIG_ARM=y
+CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3528-nanopi-zero2"
+CONFIG_ROCKCHIP_RK3528=y
+CONFIG_SYS_LOAD_ADDR=0xc00800
+CONFIG_DEBUG_UART_BASE=0xFF9F0000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_DEBUG_UART=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3528-nanopi-zero2.dtb"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_BOARD_RNG_SEED=y
+CONFIG_SPL_MAX_SIZE=0x40000
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_MEMINFO_MAP=y
+CONFIG_CMD_ADC=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MISC=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_ROCKUSB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_RNG=y
+CONFIG_CMD_REGULATOR=y
+# CONFIG_SPL_DOS_PARTITION is not set
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_BUTTON=y
+CONFIG_BUTTON_ADC=y
+# CONFIG_USB_FUNCTION_FASTBOOT is not set
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+CONFIG_SUPPORT_EMMC_RPMB=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_SDMA=y
+CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_PHY_REALTEK=y
+CONFIG_DM_MDIO=y
+CONFIG_DWC_ETH_QOS=y
+CONFIG_DWC_ETH_QOS_ROCKCHIP=y
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
+CONFIG_REGULATOR_PWM=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_PWM_ROCKCHIP=y
+CONFIG_BAUDRATE=1500000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_USB_FUNCTION_ROCKUSB=y
+CONFIG_ERRNO_STR=y
doc/board/rockchip/rockchip.rst +1 -0
index c1683bfe4212..01659ecc3cbe 100644
@@ -101,6 +101,7 @@ List of mainline supported Rockchip boards:
 
  * rk3528
       - ArmSoM Sige1 (sige1-rk3528)
+     - FriendlyElec NanoPi Zero2 (nanopi-zero2-rk3528)
       - Generic RK3528 (generic-rk3528)
       - Radxa E20C (radxa-e20c-rk3528)
       - Radxa ROCK 2A/2F (rock-2-rk3528)