uboot-sunxi: update Orange Pi R1 and Zero Plus
[openwrt/openwrt.git] / package / boot / uboot-sunxi / patches / 400-ARM-dts-orange-pi-zero-plus.patch
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
5
6 Orange Pi Zero Plus is an open-source single-board computer
7 using the Allwinner H5 SOC.
8
9 H5 Orangepi Zero Plus has
10 - Quad-core Cortex-A53
11 - 512MB DDR3
12 - micrSD slot
13 - 16MBit SPI Nor flash
14 - Debug TTL UART
15 - 1GBit/s Ethernet (RTL8211E)
16 - Wifi (RTL8189FTV)
17 - USB 2.0 Host
18 - USB 2.0 OTG + power supply
19
20 The device tree file is copied from the Linux kernel 4.18.
21
22 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
23 ---
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
31
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
42 --- /dev/null
43 +++ b/arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts
44 @@ -0,0 +1,145 @@
45 +/*
46 + * Copyright (C) 2016 ARM Ltd.
47 + * Copyright (C) 2018 Hauke Mehrtens <hauke@hauke-m.de>
48 + *
49 + * SPDX-License-Identifier: (GPL-2.0+ OR X11)
50 + */
51 +
52 +/dts-v1/;
53 +#include "sun50i-h5.dtsi"
54 +
55 +#include <dt-bindings/gpio/gpio.h>
56 +#include <dt-bindings/input/input.h>
57 +#include <dt-bindings/pinctrl/sun4i-a10.h>
58 +
59 +/ {
60 + model = "Xunlong Orange Pi Zero Plus";
61 + compatible = "xunlong,orangepi-zero-plus", "allwinner,sun50i-h5";
62 +
63 + reg_vcc3v3: vcc3v3 {
64 + compatible = "regulator-fixed";
65 + regulator-name = "vcc3v3";
66 + regulator-min-microvolt = <3300000>;
67 + regulator-max-microvolt = <3300000>;
68 + };
69 +
70 + aliases {
71 + ethernet0 = &emac;
72 + ethernet1 = &rtl8189ftv;
73 + serial0 = &uart0;
74 + };
75 +
76 + chosen {
77 + stdout-path = "serial0:115200n8";
78 + };
79 +
80 + leds {
81 + compatible = "gpio-leds";
82 +
83 + pwr {
84 + label = "orangepi:green:pwr";
85 + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */
86 + default-state = "on";
87 + };
88 +
89 + status {
90 + label = "orangepi:red:status";
91 + gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */
92 + };
93 + };
94 +
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 */
103 + };
104 +};
105 +
106 +&ehci0 {
107 + status = "okay";
108 +};
109 +
110 +&ehci1 {
111 + status = "okay";
112 +};
113 +
114 +&emac {
115 + pinctrl-names = "default";
116 + pinctrl-0 = <&emac_rgmii_pins>;
117 + phy-supply = <&reg_gmac_3v3>;
118 + phy-handle = <&ext_rgmii_phy>;
119 + phy-mode = "rgmii";
120 + status = "okay";
121 +};
122 +
123 +&external_mdio {
124 + ext_rgmii_phy: ethernet-phy@1 {
125 + compatible = "ethernet-phy-ieee802.3-c22";
126 + reg = <1>;
127 + };
128 +};
129 +
130 +&mmc0 {
131 + vmmc-supply = <&reg_vcc3v3>;
132 + bus-width = <4>;
133 + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
134 + status = "okay";
135 +};
136 +
137 +&mmc1 {
138 + vmmc-supply = <&reg_vcc3v3>;
139 + bus-width = <4>;
140 + non-removable;
141 + status = "okay";
142 +
143 + /*
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).
146 + */
147 + rtl8189ftv: sdio_wifi@1 {
148 + reg = <1>;
149 + };
150 +};
151 +
152 +/*
153 +&spi0 {
154 + status = "okay";
155 +
156 + flash@0 {
157 + #address-cells = <1>;
158 + #size-cells = <1>;
159 + compatible = "mxicy,mx25l1606e", "winbond,w25q128";
160 + reg = <0>;
161 + spi-max-frequency = <40000000>;
162 + };
163 +};
164 +*/
165 +
166 +&ohci0 {
167 + status = "okay";
168 +};
169 +
170 +&ohci1 {
171 + status = "okay";
172 +};
173 +
174 +&uart0 {
175 + pinctrl-names = "default";
176 + pinctrl-0 = <&uart0_pins_a>;
177 + status = "okay";
178 +};
179 +
180 +&usb_otg {
181 + dr_mode = "peripheral";
182 + status = "okay";
183 +};
184 +
185 +&usbphy {
186 + /* USB Type-A ports' VBUS is always on */
187 + usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
188 + status = "okay";
189 +};
190 --- a/board/sunxi/MAINTAINERS
191 +++ b/board/sunxi/MAINTAINERS
192 @@ -327,6 +327,11 @@ M: Icenowy Zheng <icenowy@aosc.xyz>
193 S: Maintained
194 F: configs/orangepi_zero_defconfig
195
196 +ORANGEPI ZERO PLUS BOARD
197 +M: Hauke Mehrtens <hauke@hauke-m.de>
198 +S: Maintained
199 +F: configs/orangepi_zero_plus_defconfig
200 +
201 ORANGEPI ZERO PLUS 2 BOARD
202 M: Jagan Teki <jagan@amarulasolutions.com>
203 S: Maintained
204 --- /dev/null
205 +++ b/configs/orangepi_zero_plus_defconfig
206 @@ -0,0 +1,16 @@
207 +CONFIG_ARM=y
208 +CONFIG_ARCH_SUNXI=y
209 +CONFIG_SPL=y
210 +CONFIG_MACH_SUN50I_H5=y
211 +CONFIG_DRAM_CLK=624
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
220 +CONFIG_SUN8I_EMAC=y
221 +CONFIG_USB_EHCI_HCD=y
222 +CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y