ARM: sun7i: hummingbird: Relicense the device tree under GPLv2/X11
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / sun7i-a20-hummingbird.dts
1 /*
2  * Copyright 2013 Wills Wang
3  *
4  * Wills Wang <wills.wang.open@gmail.com>
5  *
6  * This file is dual-licensed: you can use it either under the terms
7  * of the GPL or the X11 license, at your option. Note that this dual
8  * licensing only applies to this file, and not this project as a
9  * whole.
10  *
11  *  a) This file is free software; you can redistribute it and/or
12  *     modify it under the terms of the GNU General Public License as
13  *     published by the Free Software Foundation; either version 2 of the
14  *     License, or (at your option) any later version.
15  *
16  *     This file is distributed in the hope that it will be useful,
17  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *     GNU General Public License for more details.
20  *
21  *     You should have received a copy of the GNU General Public
22  *     License along with this file; if not, write to the Free
23  *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
24  *     MA 02110-1301 USA
25  *
26  * Or, alternatively,
27  *
28  *  b) Permission is hereby granted, free of charge, to any person
29  *     obtaining a copy of this software and associated documentation
30  *     files (the "Software"), to deal in the Software without
31  *     restriction, including without limitation the rights to use,
32  *     copy, modify, merge, publish, distribute, sublicense, and/or
33  *     sell copies of the Software, and to permit persons to whom the
34  *     Software is furnished to do so, subject to the following
35  *     conditions:
36  *
37  *     The above copyright notice and this permission notice shall be
38  *     included in all copies or substantial portions of the Software.
39  *
40  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
41  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
42  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
43  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
44  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
45  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
46  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
47  *     OTHER DEALINGS IN THE SOFTWARE.
48  */
49
50 /dts-v1/;
51 #include "sun7i-a20.dtsi"
52 #include "sunxi-common-regulators.dtsi"
53
54 #include <dt-bindings/gpio/gpio.h>
55 #include <dt-bindings/interrupt-controller/irq.h>
56 #include <dt-bindings/pinctrl/sun4i-a10.h>
57
58 / {
59         model = "Merrii A20 Hummingbird";
60         compatible = "merrii,a20-hummingbird", "allwinner,sun7i-a20";
61
62         aliases {
63                 serial0 = &uart0;
64                 serial1 = &uart2;
65                 serial2 = &uart3;
66                 serial3 = &uart4;
67                 serial4 = &uart5;
68         };
69
70         soc@01c00000 {
71                 mmc0: mmc@01c0f000 {
72                         pinctrl-names = "default";
73                         pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
74                         vmmc-supply = <&reg_vcc3v0>;
75                         bus-width = <4>;
76                         cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
77                         cd-inverted;
78                         status = "okay";
79                 };
80
81                 mmc3: mmc@01c12000 {
82                         pinctrl-names = "default";
83                         pinctrl-0 = <&mmc3_pins_a>;
84                         vmmc-supply = <&reg_mmc3_vdd>;
85                         bus-width = <4>;
86                         non-removable;
87                         status = "okay";
88                 };
89
90                 usbphy: phy@01c13400 {
91                         usb1_vbus-supply = <&reg_usb1_vbus>;
92                         usb2_vbus-supply = <&reg_usb2_vbus>;
93                         status = "okay";
94                 };
95
96                 ehci0: usb@01c14000 {
97                         status = "okay";
98                 };
99
100                 ohci0: usb@01c14400 {
101                         status = "okay";
102                 };
103
104                 ahci: sata@01c18000 {
105                         target-supply = <&reg_ahci_5v>;
106                         status = "okay";
107                 };
108
109                 ehci1: usb@01c1c000 {
110                         status = "okay";
111                 };
112
113                 ohci1: usb@01c1c400 {
114                         status = "okay";
115                 };
116
117                 pio: pinctrl@01c20800 {
118                         ahci_pwr_pin_a20_hummingbird: ahci_pwr_pin@0 {
119                                 allwinner,pins = "PH15";
120                                 allwinner,function = "gpio_out";
121                                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
122                                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
123                         };
124
125                         usb1_vbus_pin_a20_hummingbird: usb1_vbus_pin@0 {
126                                 allwinner,pins = "PH2";
127                                 allwinner,function = "gpio_out";
128                                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
129                                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
130                         };
131
132                         mmc3_vdd_pin_a20_hummingbird: mmc3_vdd_pin@0 {
133                                 allwinner,pins = "PH9";
134                                 allwinner,function = "gpio_out";
135                                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
136                                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
137                         };
138
139                         gmac_vdd_pin_a20_hummingbird: gmac_vdd_pin@0 {
140                                 allwinner,pins = "PH16";
141                                 allwinner,function = "gpio_out";
142                                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
143                                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
144                         };
145                 };
146
147                 pwm: pwm@01c20e00 {
148                         pinctrl-names = "default";
149                         pinctrl-0 = <&pwm0_pins_a>;
150                         status = "okay";
151                 };
152
153                 ir0: ir@01c21800 {
154                         pinctrl-names = "default";
155                         pinctrl-0 = <&ir0_pins_a>;
156                         status = "okay";
157                 };
158
159                 uart0: serial@01c28000 {
160                         pinctrl-names = "default";
161                         pinctrl-0 = <&uart0_pins_a>;
162                         status = "okay";
163                 };
164
165                 uart2: serial@01c28800 {
166                         pinctrl-names = "default";
167                         pinctrl-0 = <&uart2_pins_a>;
168                         status = "okay";
169                 };
170
171                 uart3: serial@01c28c00 {
172                         pinctrl-names = "default";
173                         pinctrl-0 = <&uart3_pins_a>;
174                         status = "okay";
175                 };
176
177                 uart4: serial@01c29000 {
178                         pinctrl-names = "default";
179                         pinctrl-0 = <&uart4_pins_a>;
180                         status = "okay";
181                 };
182
183                 uart5: serial@01c29400 {
184                         pinctrl-names = "default";
185                         pinctrl-0 = <&uart5_pins_a>;
186                         status = "okay";
187                 };
188
189                 i2c0: i2c@01c2ac00 {
190                         pinctrl-names = "default";
191                         pinctrl-0 = <&i2c0_pins_a>;
192                         status = "okay";
193
194                         axp209: pmic@34 {
195                                 compatible = "x-powers,axp209";
196                                 reg = <0x34>;
197                                 interrupt-parent = <&nmi_intc>;
198                                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
199                                 interrupt-controller;
200                                 #interrupt-cells = <1>;
201                         };
202                 };
203
204                 i2c1: i2c@01c2b000 {
205                         pinctrl-names = "default";
206                         pinctrl-0 = <&i2c1_pins_a>;
207                         status = "okay";
208                 };
209
210                 i2c2: i2c@01c2b400 {
211                         pinctrl-names = "default";
212                         pinctrl-0 = <&i2c2_pins_a>;
213                         status = "okay";
214                 };
215
216                 i2c3: i2c@01c2b800 {
217                         pinctrl-names = "default";
218                         pinctrl-0 = <&i2c3_pins_a>;
219                         status = "okay";
220                 };
221
222                 spi2: spi@01c17000 {
223                         pinctrl-names = "default";
224                         pinctrl-0 = <&spi2_pins_b>;
225                         status = "okay";
226                 };
227
228                 gmac: ethernet@01c50000 {
229                         pinctrl-names = "default";
230                         pinctrl-0 = <&gmac_pins_rgmii_a>;
231                         phy = <&phy1>;
232                         phy-mode = "rgmii";
233                         phy-supply = <&reg_gmac_vdd>;
234                         /* phy reset config */
235                         snps,reset-gpio = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */
236                         snps,reset-active-low;
237                         /* wait 1s after reset, otherwise fail to read phy id */
238                         snps,reset-delays-us = <0 10000 1000000>;
239                         status = "okay";
240
241                         phy1: ethernet-phy@1 {
242                                 reg = <1>;
243                         };
244                 };
245         };
246
247         reg_ahci_5v: ahci-5v {
248                 pinctrl-0 = <&ahci_pwr_pin_a20_hummingbird>;
249                 gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */
250                 status = "okay";
251         };
252
253         reg_usb1_vbus: usb1-vbus {
254                 pinctrl-0 = <&usb1_vbus_pin_a20_hummingbird>;
255                 gpio = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */
256                 status = "okay";
257         };
258
259         reg_usb2_vbus: usb2-vbus {
260                 status = "okay";
261         };
262
263         reg_mmc3_vdd: mmc3_vdd {
264                 compatible = "regulator-fixed";
265                 pinctrl-names = "default";
266                 pinctrl-0 = <&mmc3_vdd_pin_a20_hummingbird>;
267                 regulator-name = "mmc3_vdd";
268                 regulator-min-microvolt = <3000000>;
269                 regulator-max-microvolt = <3000000>;
270                 enable-active-high;
271                 gpio = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
272         };
273
274         reg_gmac_vdd: gmac_vdd {
275                 compatible = "regulator-fixed";
276                 pinctrl-names = "default";
277                 pinctrl-0 = <&gmac_vdd_pin_a20_hummingbird>;
278                 regulator-name = "gmac_vdd";
279                 regulator-min-microvolt = <3000000>;
280                 regulator-max-microvolt = <3000000>;
281                 enable-active-high;
282                 gpio = <&pio 7 16 GPIO_ACTIVE_HIGH>; /* PH16 */
283         };
284 };