ARM: sun7i: i12 tvbox: Convert to DT label based syntax
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / sun7i-a20-i12-tvbox.dts
1 /*
2  * Copyright 2014 Hans de Goede <hdegoede@redhat.com>
3  *
4  * This file is dual-licensed: you can use it either under the terms
5  * of the GPL or the X11 license, at your option. Note that this dual
6  * licensing only applies to this file, and not this project as a
7  * whole.
8  *
9  *  a) This file is free software; you can redistribute it and/or
10  *     modify it under the terms of the GNU General Public License as
11  *     published by the Free Software Foundation; either version 2 of the
12  *     License, or (at your option) any later version.
13  *
14  *     This file is distributed in the hope that it will be useful,
15  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *     GNU General Public License for more details.
18  *
19  *     You should have received a copy of the GNU General Public
20  *     License along with this file; if not, write to the Free
21  *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
22  *     MA 02110-1301 USA
23  *
24  * Or, alternatively,
25  *
26  *  b) Permission is hereby granted, free of charge, to any person
27  *     obtaining a copy of this software and associated documentation
28  *     files (the "Software"), to deal in the Software without
29  *     restriction, including without limitation the rights to use,
30  *     copy, modify, merge, publish, distribute, sublicense, and/or
31  *     sell copies of the Software, and to permit persons to whom the
32  *     Software is furnished to do so, subject to the following
33  *     conditions:
34  *
35  *     The above copyright notice and this permission notice shall be
36  *     included in all copies or substantial portions of the Software.
37  *
38  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
39  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
40  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
41  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
42  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
43  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
44  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
45  *     OTHER DEALINGS IN THE SOFTWARE.
46  */
47
48 /dts-v1/;
49 #include "sun7i-a20.dtsi"
50 #include "sunxi-common-regulators.dtsi"
51
52 #include <dt-bindings/gpio/gpio.h>
53 #include <dt-bindings/interrupt-controller/irq.h>
54 #include <dt-bindings/pinctrl/sun4i-a10.h>
55
56 / {
57         model = "I12 / Q5 / QT840A A20 tvbox";
58         compatible = "allwinner,i12-tvbox", "allwinner,sun7i-a20";
59
60         leds {
61                 compatible = "gpio-leds";
62                 pinctrl-names = "default";
63                 pinctrl-0 = <&led_pins_i12_tvbox>;
64
65                 red {
66                         label = "i12_tvbox:red:usr";
67                         gpios = <&pio 7 9 GPIO_ACTIVE_LOW>;
68                 };
69
70                 blue {
71                         label = "i12_tvbox:blue:usr";
72                         gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
73                 };
74         };
75
76         reg_vmmc3: vmmc3 {
77                 compatible = "regulator-fixed";
78                 pinctrl-names = "default";
79                 pinctrl-0 = <&vmmc3_pin_i12_tvbox>;
80                 regulator-name = "vmmc3";
81                 regulator-min-microvolt = <3300000>;
82                 regulator-max-microvolt = <3300000>;
83                 enable-active-high;
84                 gpio = <&pio 7 2 GPIO_ACTIVE_HIGH>;
85         };
86
87         reg_vmmc3_io: vmmc3-io {
88                 compatible = "regulator-fixed";
89                 pinctrl-names = "default";
90                 pinctrl-0 = <&vmmc3_io_pin_i12_tvbox>;
91                 regulator-name = "vmmc3-io";
92                 regulator-min-microvolt = <3300000>;
93                 regulator-max-microvolt = <3300000>;
94                 /* This controls VCC-PI, must be always on! */
95                 regulator-always-on;
96                 enable-active-high;
97                 gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
98         };
99
100         reg_gmac_3v3: gmac-3v3 {
101                 compatible = "regulator-fixed";
102                 pinctrl-names = "default";
103                 pinctrl-0 = <&gmac_power_pin_i12_tvbox>;
104                 regulator-name = "gmac-3v3";
105                 regulator-min-microvolt = <3300000>;
106                 regulator-max-microvolt = <3300000>;
107                 startup-delay-us = <50000>;
108                 enable-active-high;
109                 gpio = <&pio 7 21 GPIO_ACTIVE_HIGH>;
110         };
111 };
112
113 &ehci0 {
114         status = "okay";
115 };
116
117 &ehci1 {
118         status = "okay";
119 };
120
121 &gmac {
122         pinctrl-names = "default";
123         pinctrl-0 = <&gmac_pins_mii_a>;
124         phy = <&phy1>;
125         phy-mode = "mii";
126         phy-supply = <&reg_gmac_3v3>;
127         status = "okay";
128
129         phy1: ethernet-phy@1 {
130                 reg = <1>;
131         };
132 };
133
134 &i2c0 {
135         pinctrl-names = "default";
136         pinctrl-0 = <&i2c0_pins_a>;
137         status = "okay";
138
139         axp209: pmic@34 {
140                 compatible = "x-powers,axp209";
141                 reg = <0x34>;
142                 interrupt-parent = <&nmi_intc>;
143                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
144
145                 interrupt-controller;
146                 #interrupt-cells = <1>;
147         };
148 };
149
150 &ir0 {
151         pinctrl-names = "default";
152         pinctrl-0 = <&ir0_pins_a>;
153         status = "okay";
154 };
155
156 &mmc0 {
157         pinctrl-names = "default";
158         pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
159         vmmc-supply = <&reg_vcc3v3>;
160         bus-width = <4>;
161         cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
162         cd-inverted;
163         status = "okay";
164 };
165
166 &mmc3 {
167         pinctrl-names = "default";
168         pinctrl-0 = <&mmc3_pins_a>;
169         vmmc-supply = <&reg_vmmc3>;
170         bus-width = <4>;
171         non-removable;
172         status = "okay";
173 };
174
175 &mmc3_pins_a {
176         /* AP6210 / AP6330 requires pull-up */
177         allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
178 };
179
180 &ohci0 {
181         status = "okay";
182 };
183
184 &ohci1 {
185         status = "okay";
186 };
187
188 &pio {
189         vmmc3_pin_i12_tvbox: vmmc3_pin@0 {
190                 allwinner,pins = "PH2";
191                 allwinner,function = "gpio_out";
192                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
193                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
194         };
195
196         vmmc3_io_pin_i12_tvbox: vmmc3_io_pin@0 {
197                 allwinner,pins = "PH12";
198                 allwinner,function = "gpio_out";
199                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
200                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
201         };
202
203         gmac_power_pin_i12_tvbox: gmac_power_pin@0 {
204                 allwinner,pins = "PH21";
205                 allwinner,function = "gpio_out";
206                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
207                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
208         };
209
210         led_pins_i12_tvbox: led_pins@0 {
211                 allwinner,pins = "PH9", "PH20";
212                 allwinner,function = "gpio_out";
213                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
214                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
215         };
216 };
217
218 &reg_usb1_vbus {
219         status = "okay";
220 };
221
222 &reg_usb2_vbus {
223         status = "okay";
224 };
225
226 &uart0 {
227         pinctrl-names = "default";
228         pinctrl-0 = <&uart0_pins_a>;
229         status = "okay";
230 };
231
232 &usbphy {
233         usb1_vbus-supply = <&reg_usb1_vbus>;
234         usb2_vbus-supply = <&reg_usb2_vbus>;
235         status = "okay";
236 };