d4f987eb65d866bff00690b638005bb4717efa02
[openwrt/openwrt.git] / target / linux / sunxi / patches-4.14 / 220-ARM-dts-orange-pi-zero-plus.patch
1 --- a/arch/arm64/boot/dts/allwinner/Makefile
2 +++ b/arch/arm64/boot/dts/allwinner/Makefile
3 @@ -8,6 +8,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-s
4 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
5 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb
6 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb
7 +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb
8 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb
9 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb
10
11 --- /dev/null
12 +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts
13 @@ -0,0 +1,180 @@
14 +/*
15 + * Copyright (C) 2016 ARM Ltd.
16 + *
17 + * This file is dual-licensed: you can use it either under the terms
18 + * of the GPL or the X11 license, at your option. Note that this dual
19 + * licensing only applies to this file, and not this project as a
20 + * whole.
21 + *
22 + * a) This file is free software; you can redistribute it and/or
23 + * modify it under the terms of the GNU General Public License as
24 + * published by the Free Software Foundation; either version 2 of the
25 + * License, or (at your option) any later version.
26 + *
27 + * This file is distributed in the hope that it will be useful,
28 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 + * GNU General Public License for more details.
31 + *
32 + * Or, alternatively,
33 + *
34 + * b) Permission is hereby granted, free of charge, to any person
35 + * obtaining a copy of this software and associated documentation
36 + * files (the "Software"), to deal in the Software without
37 + * restriction, including without limitation the rights to use,
38 + * copy, modify, merge, publish, distribute, sublicense, and/or
39 + * sell copies of the Software, and to permit persons to whom the
40 + * Software is furnished to do so, subject to the following
41 + * conditions:
42 + *
43 + * The above copyright notice and this permission notice shall be
44 + * included in all copies or substantial portions of the Software.
45 + *
46 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
47 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
48 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
49 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
50 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
51 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
52 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
53 + * OTHER DEALINGS IN THE SOFTWARE.
54 + */
55 +
56 +/dts-v1/;
57 +#include "sun50i-h5.dtsi"
58 +
59 +#include <dt-bindings/gpio/gpio.h>
60 +#include <dt-bindings/input/input.h>
61 +#include <dt-bindings/pinctrl/sun4i-a10.h>
62 +
63 +/ {
64 + model = "Xunlong Orange Pi Zero Plus";
65 + compatible = "xunlong,orangepi-pc2", "allwinner,sun50i-h5";
66 +
67 + reg_vcc3v3: vcc3v3 {
68 + compatible = "regulator-fixed";
69 + regulator-name = "vcc3v3";
70 + regulator-min-microvolt = <3300000>;
71 + regulator-max-microvolt = <3300000>;
72 + };
73 +
74 + aliases {
75 + ethernet0 = &emac;
76 + ethernet1 = &rtl8189ftv;
77 + serial0 = &uart0;
78 + };
79 +
80 + chosen {
81 + stdout-path = "serial0:115200n8";
82 + };
83 +
84 + leds {
85 + compatible = "gpio-leds";
86 +
87 + pwr {
88 + label = "orangepi:green:pwr";
89 + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
90 + default-state = "on";
91 + };
92 +
93 + status {
94 + label = "orangepi:red:status";
95 + gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
96 + };
97 + };
98 +
99 + reg_gmac_3v3: gmac-3v3 {
100 + compatible = "regulator-fixed";
101 + regulator-name = "gmac-3v3";
102 + regulator-min-microvolt = <3300000>;
103 + regulator-max-microvolt = <3300000>;
104 + startup-delay-us = <100000>;
105 + enable-active-high;
106 + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
107 + };
108 +
109 + reg_usb0_vbus: usb0-vbus {
110 + compatible = "regulator-fixed";
111 + regulator-name = "usb0-vbus";
112 + regulator-min-microvolt = <5000000>;
113 + regulator-max-microvolt = <5000000>;
114 + enable-active-high;
115 + gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
116 + status = "okay";
117 + };
118 +};
119 +
120 +&ehci0 {
121 + status = "okay";
122 +};
123 +
124 +&ehci1 {
125 + status = "okay";
126 +};
127 +
128 +&emac {
129 + pinctrl-names = "default";
130 + pinctrl-0 = <&emac_rgmii_pins>;
131 + phy-supply = <&reg_gmac_3v3>;
132 + phy-handle = <&ext_rgmii_phy>;
133 + phy-mode = "rgmii";
134 + status = "okay";
135 +};
136 +
137 +&external_mdio {
138 + ext_rgmii_phy: ethernet-phy@1 {
139 + compatible = "ethernet-phy-ieee802.3-c22";
140 + reg = <1>;
141 + };
142 +};
143 +
144 +&mmc0 {
145 + pinctrl-names = "default";
146 + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
147 + vmmc-supply = <&reg_vcc3v3>;
148 + bus-width = <4>;
149 + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
150 + status = "okay";
151 +};
152 +
153 +&mmc1 {
154 + pinctrl-names = "default";
155 + pinctrl-0 = <&mmc1_pins_a>;
156 + vmmc-supply = <&reg_vcc3v3>;
157 + bus-width = <4>;
158 + non-removable;
159 + status = "okay";
160 +
161 + /*
162 + * Explicitly define the sdio device, so that we can add an ethernet
163 + * alias for it (which e.g. makes u-boot set a mac-address).
164 + */
165 + rtl8189ftv: sdio_wifi@1 {
166 + reg = <1>;
167 + };
168 +};
169 +
170 +&ohci0 {
171 + status = "okay";
172 +};
173 +
174 +&ohci1 {
175 + status = "okay";
176 +};
177 +
178 +&uart0 {
179 + pinctrl-names = "default";
180 + pinctrl-0 = <&uart0_pins_a>;
181 + status = "okay";
182 +};
183 +
184 +&usb_otg {
185 + dr_mode = "peripheral";
186 + status = "okay";
187 +};
188 +
189 +&usbphy {
190 + /* USB Type-A ports' VBUS is always on */
191 + usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
192 + status = "okay";
193 +};