Skip to contentSkip to conversation

sunxi: h3: Add initial ZeroPi support

PATCH Superseded Yu-Tung Chang 2 participants 3 messages Jun 15, 2021 – Jun 17, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover sunxi: h3: Add initial ZeroPi support

This commit add support to FriendlyARM ZeroPi board.

Board Schematic: http://wiki.friendlyarm.com/wiki/images/7/71/ZeroPi_20190731_Schematic.pdf

- v1
. fix trailing whitespace

Yu-Tung Chang (1):
sunxi: h3: Add initial ZeroPi support

 arch/arm/dts/Makefile            |  3 +-
 arch/arm/dts/sun8i-h3-zeropi.dts | 48 ++++++++++++++++++++++++++++++++
 board/sunxi/MAINTAINERS          |  6 ++++
 configs/zeropi_defconfig         | 13 +++++++++
 4 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/sun8i-h3-zeropi.dts
 create mode 100644 configs/zeropi_defconfig
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 sunxi: h3: Add initial ZeroPi support

ZeroPi is a new board of high performance with low cost designed by FriendlyElec., using the Allwinner H3 SOC.

ZeroPi features
- Allwinner H3, Quad-core [email protected]
- 256MB/512MB DDR3 RAM
- microsd slot
- 10/100/1000Mbps Ethernet
- Debug Serial Port
- DC 5V/2A power-supply

---
 arch/arm/dts/Makefile            |  3 +-
 arch/arm/dts/sun8i-h3-zeropi.dts | 48 ++++++++++++++++++++++++++++++++
 board/sunxi/MAINTAINERS          |  6 ++++
 configs/zeropi_defconfig         | 13 +++++++++
 4 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/sun8i-h3-zeropi.dts
 create mode 100644 configs/zeropi_defconfig
arch/arm/dts/Makefile +2 -1
index 096068261d..7c8e253350 100644
@@ -607,7 +607,8 @@ dtb-$(CONFIG_MACH_SUN8I_H3) += \
 	sun8i-h3-orangepi-plus.dtb \
 	sun8i-h3-orangepi-plus2e.dtb \
 	sun8i-h3-orangepi-zero-plus2.dtb \
-	sun8i-h3-rervision-dvk.dtb
+	sun8i-h3-rervision-dvk.dtb \
+	sun8i-h3-zeropi.dtb
 dtb-$(CONFIG_MACH_SUN8I_R40) += \
 	sun8i-r40-bananapi-m2-ultra.dtb \
 	sun8i-v40-bananapi-m2-berry.dtb
arch/arm/dts/sun8i-h3-zeropi.dts new file +48 -0

48 lines not on this page · raw message

board/sunxi/MAINTAINERS +6 -0
index 76eba2ad20..4fc26077b2 100644
@@ -529,3 +529,9 @@ YONES TOPTECH BS1078 V2 BOARD
 M:	Peter Korsgaard <[email protected]>
 S:	Maintained
 F:	configs/Yones_Toptech_BS1078_V2_defconfig
+
+ZEROPI BOARD
+M:	Yu-Tung Chang <[email protected]>
+S:	Maintained
+F:	configs/zeropi_defconfig
+F:	arch/arm/dts/sun8i-h3-zeropi.dts
configs/zeropi_defconfig new file +13 -0
new file mode 100644
index 0000000000..f921b09892
@@ -0,0 +1,13 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_SPL=y
+CONFIG_MACH_SUN8I_H3=y
+CONFIG_DRAM_CLK=408
+CONFIG_MACPWR="PD6"
+# CONFIG_VIDEO_DE2 is not set
+CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-zeropi"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_CONSOLE_MUX=y
+CONFIG_SUN8I_EMAC=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
Signature · 1 line
2.31.1
#2 lore raw
Quoted 11 lines · On Tue, 15 Jun 2021 11:25:52 +0800 Yu-Tung Chang <[email protected]> wrote:

ZeroPi is a new board of high performance with low cost designed by FriendlyElec., using the Allwinner H3 SOC.

ZeroPi features
- Allwinner H3, Quad-core [email protected]
- 256MB/512MB DDR3 RAM
- microsd slot
- 10/100/1000Mbps Ethernet
- Debug Serial Port
- DC 5V/2A power-supply

Quoted 1 line

Looks alright, thanks for sending this. One nit below.

Quoted 29 lines
---
 arch/arm/dts/Makefile            |  3 +-
 arch/arm/dts/sun8i-h3-zeropi.dts | 48 ++++++++++++++++++++++++++++++++
 board/sunxi/MAINTAINERS          |  6 ++++
 configs/zeropi_defconfig         | 13 +++++++++
 4 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/sun8i-h3-zeropi.dts
 create mode 100644 configs/zeropi_defconfig
arch/arm/dts/Makefile +2 -1
index 096068261d..7c8e253350 100644
@@ -607,7 +607,8 @@ dtb-$(CONFIG_MACH_SUN8I_H3) += \
 	sun8i-h3-orangepi-plus.dtb \
 	sun8i-h3-orangepi-plus2e.dtb \
 	sun8i-h3-orangepi-zero-plus2.dtb \
-	sun8i-h3-rervision-dvk.dtb
+	sun8i-h3-rervision-dvk.dtb \
+	sun8i-h3-zeropi.dtb
 dtb-$(CONFIG_MACH_SUN8I_R40) += \
 	sun8i-r40-bananapi-m2-ultra.dtb \
 	sun8i-v40-bananapi-m2-berry.dtb
arch/arm/dts/sun8i-h3-zeropi.dts new file +0 -0
new file mode 100644
index 0000000000..e36381f11b

arch/arm/dts/sun8i-h3-zeropi.dts line 1

Quoted 1 line
arch/arm/dts/sun8i-h3-zeropi.dts new file +1 -0
@@ -0,0 +1,48 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)

While I like those SPDX lines more, the Linux kernel copy still(?) uses the more explicit license header. And we aim to stay as close as possible to the kernel DTs, that includes comments as well.

So if you resend a v2 which just copies the kernel .dts, I will queue it for the next merge window.

Cheers,
Andre

P.S. For the first version of a single patch "series", just use "[PATCH]" in the subject. There is never a "v1", and also little reason for a "1/1". If you have some comments that would typically go into a cover letter, put them behind the "---" in the top of the email.

Quoted 80 lines
arch/arm/dts/sun8i-h3-zeropi.dts new file +47 -0
+/*
+ * Copyright (C) 2021 Yu-Tung Chang <[email protected]>
+ */
+
+#include "sun8i-h3-nanopi.dtsi"
+
+/ {
+	model = "FriendlyARM ZeroPi";
+	compatible = "friendlyarm,zeropi", "allwinner,sun8i-h3";
+
+	aliases {
+		ethernet0 = &emac;
+	};
+
+	reg_gmac_3v3: gmac-3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "gmac-3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		startup-delay-us = <100000>;
+		enable-active-high;
+		gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
+	};
+};
+
+&external_mdio {
+	ext_rgmii_phy: ethernet-phy@7 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <7>;
+	};
+};
+
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&emac_rgmii_pins>;
+	phy-supply = <&reg_gmac_3v3>;
+	phy-handle = <&ext_rgmii_phy>;
+	phy-mode = "rgmii-id";
+
+	allwinner,leds-active-low;
+	status = "okay";
+};
+
+&usb_otg {
+	status = "okay";
+	dr_mode = "host";
+};
board/sunxi/MAINTAINERS +6 -0
index 76eba2ad20..4fc26077b2 100644
@@ -529,3 +529,9 @@ YONES TOPTECH BS1078 V2 BOARD
 M:	Peter Korsgaard <[email protected]>
 S:	Maintained
 F:	configs/Yones_Toptech_BS1078_V2_defconfig
+
+ZEROPI BOARD
+M:	Yu-Tung Chang <[email protected]>
+S:	Maintained
+F:	configs/zeropi_defconfig
+F:	arch/arm/dts/sun8i-h3-zeropi.dts
configs/zeropi_defconfig new file +13 -0
new file mode 100644
index 0000000000..f921b09892
@@ -0,0 +1,13 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_SPL=y
+CONFIG_MACH_SUN8I_H3=y
+CONFIG_DRAM_CLK=408
+CONFIG_MACPWR="PD6"
+# CONFIG_VIDEO_DE2 is not set
+CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-zeropi"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_CONSOLE_MUX=y
+CONFIG_SUN8I_EMAC=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y