1 From fd576a3c594ee2356b50a0738403e5cef094935a Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sat, 9 Jun 2018 15:16:42 +0200
4 Subject: sun50i: h5: Add initial Orange Pi Zero Plus support
6 Orange Pi Zero Plus is an open-source single-board computer
7 using the Allwinner H5 SOC.
9 H5 Orangepi Zero Plus has
10 - Quad-core Cortex-A53
13 - 16MBit SPI Nor flash
15 - 1GBit/s Ethernet (RTL8211E)
18 - USB 2.0 OTG + power supply
20 The device tree file is copied from the Linux kernel 4.18.
22 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
24 arch/arm/dts/Makefile | 1 +
25 arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts | 145 ++++++++++++++++++++++++++
26 board/sunxi/MAINTAINERS | 5 +
27 configs/orangepi_zero_plus_defconfig | 16 +++
28 4 files changed, 167 insertions(+)
29 create mode 100644 arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts
30 create mode 100644 configs/orangepi_zero_plus_defconfig
32 --- a/arch/arm/dts/Makefile
33 +++ b/arch/arm/dts/Makefile
34 @@ -372,6 +372,7 @@ dtb-$(CONFIG_MACH_SUN8I_V3S) += \
35 dtb-$(CONFIG_MACH_SUN50I_H5) += \
36 sun50i-h5-nanopi-neo2.dtb \
37 sun50i-h5-nanopi-neo-plus2.dtb \
38 + sun50i-h5-orangepi-zero-plus.dtb \
39 sun50i-h5-orangepi-pc2.dtb \
40 sun50i-h5-orangepi-prime.dtb \
41 sun50i-h5-orangepi-zero-plus2.dtb
43 +++ b/arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts
46 + * Copyright (C) 2016 ARM Ltd.
47 + * Copyright (C) 2018 Hauke Mehrtens <hauke@hauke-m.de>
49 + * SPDX-License-Identifier: (GPL-2.0+ OR X11)
53 +#include "sun50i-h5.dtsi"
55 +#include <dt-bindings/gpio/gpio.h>
56 +#include <dt-bindings/input/input.h>
57 +#include <dt-bindings/pinctrl/sun4i-a10.h>
60 + model = "Xunlong Orange Pi Zero Plus";
61 + compatible = "xunlong,orangepi-zero-plus", "allwinner,sun50i-h5";
63 + reg_vcc3v3: vcc3v3 {
64 + compatible = "regulator-fixed";
65 + regulator-name = "vcc3v3";
66 + regulator-min-microvolt = <3300000>;
67 + regulator-max-microvolt = <3300000>;
72 + ethernet1 = &rtl8189ftv;
77 + stdout-path = "serial0:115200n8";
81 + compatible = "gpio-leds";
84 + label = "orangepi:green:pwr";
85 + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */
86 + default-state = "on";
90 + label = "orangepi:red:status";
91 + gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */
95 + reg_gmac_3v3: gmac-3v3 {
96 + compatible = "regulator-fixed";
97 + regulator-name = "gmac-3v3";
98 + regulator-min-microvolt = <3300000>;
99 + regulator-max-microvolt = <3300000>;
100 + startup-delay-us = <100000>;
101 + enable-active-high;
102 + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
115 + pinctrl-names = "default";
116 + pinctrl-0 = <&emac_rgmii_pins>;
117 + phy-supply = <®_gmac_3v3>;
118 + phy-handle = <&ext_rgmii_phy>;
119 + phy-mode = "rgmii";
124 + ext_rgmii_phy: ethernet-phy@1 {
125 + compatible = "ethernet-phy-ieee802.3-c22";
131 + vmmc-supply = <®_vcc3v3>;
133 + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
138 + vmmc-supply = <®_vcc3v3>;
144 + * Explicitly define the sdio device, so that we can add an ethernet
145 + * alias for it (which e.g. makes u-boot set a mac-address).
147 + rtl8189ftv: sdio_wifi@1 {
157 + #address-cells = <1>;
159 + compatible = "mxicy,mx25l1606e", "winbond,w25q128";
161 + spi-max-frequency = <40000000>;
175 + pinctrl-names = "default";
176 + pinctrl-0 = <&uart0_pins_a>;
181 + dr_mode = "peripheral";
186 + /* USB Type-A ports' VBUS is always on */
187 + usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
190 --- a/board/sunxi/MAINTAINERS
191 +++ b/board/sunxi/MAINTAINERS
192 @@ -327,6 +327,11 @@ M: Icenowy Zheng <icenowy@aosc.xyz>
194 F: configs/orangepi_zero_defconfig
196 +ORANGEPI ZERO PLUS BOARD
197 +M: Hauke Mehrtens <hauke@hauke-m.de>
199 +F: configs/orangepi_zero_plus_defconfig
201 ORANGEPI ZERO PLUS 2 BOARD
202 M: Jagan Teki <jagan@amarulasolutions.com>
205 +++ b/configs/orangepi_zero_plus_defconfig
210 +CONFIG_MACH_SUN50I_H5=y
212 +CONFIG_DRAM_ZQ=3881977
213 +CONFIG_MMC0_CD_PIN="PH13"
214 +CONFIG_MMC_SUNXI_SLOT_EXTRA=2
215 +CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-zero-plus"
216 +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
217 +# CONFIG_CMD_FLASH is not set
218 +# CONFIG_SPL_DOS_PARTITION is not set
219 +# CONFIG_SPL_EFI_PARTITION is not set
221 +CONFIG_USB_EHCI_HCD=y
222 +CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y