Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / meson8b-odroidc1.dts
1 /*
2  * Copyright 2015 Endless Mobile, Inc.
3  * Author: Carlo Caione <carlo@endlessm.com>
4  *
5  * This file is dual-licensed: you can use it either under the terms
6  * of the GPL or the X11 license, at your option. Note that this dual
7  * licensing only applies to this file, and not this project as a
8  * whole.
9  *
10  *  a) This library is free software; you can redistribute it and/or
11  *     modify it under the terms of the GNU General Public License as
12  *     published by the Free Software Foundation; either version 2 of the
13  *     License, or (at your option) any later version.
14  *
15  *     This library is distributed in the hope that it will be useful,
16  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *     GNU General Public License for more details.
19  *
20  *     You should have received a copy of the GNU General Public License
21  *     along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * Or, alternatively,
24  *
25  *  b) Permission is hereby granted, free of charge, to any person
26  *     obtaining a copy of this software and associated documentation
27  *     files (the "Software"), to deal in the Software without
28  *     restriction, including without limitation the rights to use,
29  *     copy, modify, merge, publish, distribute, sublicense, and/or
30  *     sell copies of the Software, and to permit persons to whom the
31  *     Software is furnished to do so, subject to the following
32  *     conditions:
33  *
34  *     The above copyright notice and this permission notice shall be
35  *     included in all copies or substantial portions of the Software.
36  *
37  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
38  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
39  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
40  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
41  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
42  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
43  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
44  *     OTHER DEALINGS IN THE SOFTWARE.
45  */
46
47 /dts-v1/;
48 #include "meson8b.dtsi"
49 #include <dt-bindings/gpio/gpio.h>
50
51 / {
52         model = "Hardkernel ODROID-C1";
53         compatible = "hardkernel,odroid-c1", "amlogic,meson8b";
54
55         aliases {
56                 serial0 = &uart_AO;
57                 mmc0 = &sd_card_slot;
58         };
59
60         chosen {
61                 stdout-path = "serial0:115200n8";
62         };
63
64         memory {
65                 device_type = "memory";
66                 reg = <0x40000000 0x40000000>;
67         };
68
69         leds {
70                 compatible = "gpio-leds";
71                 blue {
72                         label = "c1:blue:alive";
73                         gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>;
74                         linux,default-trigger = "heartbeat";
75                         default-state = "off";
76                 };
77         };
78
79         p5v0: regulator-p5v0 {
80                 compatible = "regulator-fixed";
81
82                 regulator-name = "P5V0";
83                 regulator-min-microvolt = <5000000>;
84                 regulator-max-microvolt = <5000000>;
85         };
86
87         tflash_vdd: regulator-tflash_vdd {
88                 /*
89                  * signal name from schematics: TFLASH_VDD_EN
90                  */
91                 compatible = "regulator-fixed";
92
93                 regulator-name = "TFLASH_VDD";
94                 regulator-min-microvolt = <3300000>;
95                 regulator-max-microvolt = <3300000>;
96
97                 vin-supply = <&vcc_3v3>;
98
99                 gpio = <&gpio GPIOY_12 GPIO_ACTIVE_HIGH>;
100                 enable-active-high;
101         };
102
103         tf_io: gpio-regulator-tf_io {
104                 compatible = "regulator-gpio";
105
106                 regulator-name = "TF_IO";
107                 regulator-min-microvolt = <1800000>;
108                 regulator-max-microvolt = <3300000>;
109
110                 vin-supply = <&vcc_3v3>;
111
112                 /*
113                  * signal name from schematics: TF_3V3N_1V8_EN
114                  */
115                 gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
116                 gpios-states = <0>;
117
118                 states = <3300000 0
119                           1800000 1>;
120         };
121
122         iio-hwmon {
123                 compatible = "iio-hwmon";
124                 io-channels = <&saradc 8>;
125         };
126
127         rtc32k_xtal: rtc32k-xtal-clk {
128                 /* X3 in the schematics */
129                 compatible = "fixed-clock";
130                 clock-frequency = <32768>;
131                 clock-output-names = "RTC32K";
132                 #clock-cells = <0>;
133         };
134
135         vcc_1v8: regulator-vcc-1v8 {
136                 /*
137                  * RICHTEK RT9179 configured for a fixed output voltage of
138                  * 1.8V. This supplies not only VCC1V8 but also IOREF_1V8 and
139                  * VDD1V8 according to the schematics.
140                  */
141                 compatible = "regulator-fixed";
142
143                 regulator-name = "VCC1V8";
144                 regulator-min-microvolt = <1800000>;
145                 regulator-max-microvolt = <1800000>;
146
147                 vin-supply = <&p5v0>;
148         };
149
150         vcc_3v3: regulator-vcc-3v3 {
151                 /*
152                  * Monolithic Power Systems MP2161 configured for a fixed
153                  * output voltage of 3.3V. This supplies not only VCC3V3 but
154                  * also VDD3V3 and VDDIO_AO3V3 according to the schematics.
155                  */
156                 compatible = "regulator-fixed";
157
158                 regulator-name = "VCC3V3";
159                 regulator-min-microvolt = <3300000>;
160                 regulator-max-microvolt = <3300000>;
161
162                 vin-supply = <&p5v0>;
163         };
164
165         vcck: regulator-vcck {
166                 /* Monolithic Power Systems MP2161 */
167                 compatible = "pwm-regulator";
168
169                 regulator-name = "VCCK";
170                 regulator-min-microvolt = <860000>;
171                 regulator-max-microvolt = <1140000>;
172
173                 vin-supply = <&p5v0>;
174
175                 pwms = <&pwm_cd 0 12218 0>;
176                 pwm-dutycycle-range = <91 0>;
177
178                 regulator-boot-on;
179                 regulator-always-on;
180         };
181
182         vddc_ddr: regulator-vddc-ddr {
183                 /*
184                  * Monolithic Power Systems MP2161 configured for a fixed
185                  * output voltage of 1.5V. This supplies not only DDR_VDDC but
186                  * also DDR3_1V5 according to the schematics.
187                  */
188                 compatible = "regulator-fixed";
189
190                 regulator-name = "DDR_VDDC";
191                 regulator-min-microvolt = <1500000>;
192                 regulator-max-microvolt = <1500000>;
193
194                 vin-supply = <&p5v0>;
195         };
196
197         vdd_rtc: regulator-vdd-rtc {
198                 /*
199                  * Torex Semiconductor XC6215 configured for a fixed output of
200                  * 0.9V.
201                  */
202                 compatible = "regulator-fixed";
203
204                 regulator-name = "VDD_RTC";
205                 regulator-min-microvolt = <900000>;
206                 regulator-max-microvolt = <900000>;
207
208                 vin-supply = <&vcc_3v3>;
209         };
210 };
211
212 &cpu0 {
213         cpu-supply = <&vcck>;
214 };
215
216 &ethmac {
217         status = "okay";
218
219         snps,reset-gpio = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH>;
220         snps,reset-active-low;
221         snps,reset-delays-us = <0 10000 30000>;
222
223         pinctrl-0 = <&eth_rgmii_pins>;
224         pinctrl-names = "default";
225
226         phy-mode = "rgmii";
227         phy-handle = <&eth_phy>;
228         amlogic,tx-delay-ns = <4>;
229
230         mdio {
231                 compatible = "snps,dwmac-mdio";
232                 #address-cells = <1>;
233                 #size-cells = <0>;
234
235                 /* Realtek RTL8211F (0x001cc916) */
236                 eth_phy: ethernet-phy@0 {
237                         reg = <0>;
238                         interrupt-parent = <&gpio_intc>;
239                         /* GPIOH_3 */
240                         interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
241                 };
242         };
243 };
244
245 &gpio {
246         gpio-line-names = /* Bank GPIOX */
247                           "J2 Header Pin 35", "J2 Header Pin 36",
248                           "J2 Header Pin 32", "J2 Header Pin 31",
249                           "J2 Header Pin 29", "J2 Header Pin 18",
250                           "J2 Header Pin 22", "J2 Header Pin 16",
251                           "J2 Header Pin 23", "J2 Header Pin 21",
252                           "J2 Header Pin 19", "J2 Header Pin 33",
253                           "J2 Header Pin 8", "J2 Header Pin 10",
254                           "J2 Header Pin 15", "J2 Header Pin 13",
255                           "J2 Header Pin 24", "J2 Header Pin 26",
256                           /* Bank GPIOY */
257                           "Revision (upper)", "Revision (lower)",
258                           "J2 Header Pin 7", "", "J2 Header Pin 12",
259                           "J2 Header Pin 11", "", "", "",
260                           "TFLASH_VDD_EN", "", "",
261                           /* Bank GPIODV */
262                           "VCCK_PWM (PWM_C)", "I2CA_SDA", "I2CA_SCL",
263                           "I2CB_SDA", "I2CB_SCL", "VDDEE_PWM (PWM_D)",
264                           "",
265                           /* Bank GPIOH */
266                           "HDMI_HPD", "HDMI_I2C_SDA", "HDMI_I2C_SCL",
267                           "ETH_PHY_INTR", "ETH_PHY_NRST", "ETH_TXD1",
268                           "ETH_TXD0", "ETH_TXD3", "ETH_TXD2",
269                           "ETH_RGMII_TX_CLK",
270                           /* Bank CARD */
271                           "SD_DATA1 (SDB_D1)", "SD_DATA0 (SDB_D0)",
272                           "SD_CLK",  "SD_CMD", "SD_DATA3 (SDB_D3)",
273                           "SD_DATA2 (SDB_D2)", "SD_CDN (SD_DET_N)",
274                           /* Bank BOOT */
275                           "SDC_D0 (EMMC)", "SDC_D1 (EMMC)",
276                           "SDC_D2 (EMMC)", "SDC_D3 (EMMC)",
277                           "SDC_D4 (EMMC)", "SDC_D5 (EMMC)",
278                           "SDC_D6 (EMMC)", "SDC_D7 (EMMC)",
279                           "SDC_CLK (EMMC)", "SDC_RSTn (EMMC)",
280                           "SDC_CMD (EMMC)", "BOOT_SEL", "", "", "",
281                           "", "", "", "",
282                           /* Bank DIF */
283                           "ETH_RXD1", "ETH_RXD0", "ETH_RX_DV",
284                           "RGMII_RX_CLK", "ETH_RXD3", "ETH_RXD2",
285                           "ETH_TXEN", "ETH_PHY_REF_CLK_25MOUT",
286                           "ETH_MDC", "ETH_MDIO";
287 };
288
289 &gpio_ao {
290         gpio-line-names = "UART TX", "UART RX", "",
291                           "TF_3V3N_1V8_EN", "USB_HUB_RST_N",
292                           "USB_OTG_PWREN", "J7 Header Pin 2",
293                           "IR_IN", "J7 Header Pin 4",
294                           "J7 Header Pin 6", "J7 Header Pin 5",
295                           "J7 Header Pin 7", "HDMI_CEC",
296                           "SYS_LED", "", "";
297
298         /*
299          * WARNING: The USB Hub on the Odroid-C1/C1+ needs a reset signal
300          * to be turned high in order to be detected by the USB Controller.
301          * This signal should be handled by a USB specific power sequence
302          * in order to reset the Hub when USB bus is powered down.
303          */
304         usb-hub {
305                 gpio-hog;
306                 gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>;
307                 output-high;
308                 line-name = "usb-hub-reset";
309         };
310 };
311
312 &ir_receiver {
313         status = "okay";
314         pinctrl-0 = <&ir_recv_pins>;
315         pinctrl-names = "default";
316 };
317
318 &saradc {
319         status = "okay";
320         vref-supply = <&vcc_1v8>;
321 };
322
323 &sdio {
324         status = "okay";
325
326         pinctrl-0 = <&sd_b_pins>;
327         pinctrl-names = "default";
328
329         /* SD card */
330         sd_card_slot: slot@1 {
331                 compatible = "mmc-slot";
332                 reg = <1>;
333                 status = "okay";
334
335                 bus-width = <4>;
336                 no-sdio;
337                 cap-mmc-highspeed;
338                 cap-sd-highspeed;
339                 disable-wp;
340
341                 cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
342
343                 vmmc-supply = <&tflash_vdd>;
344                 vqmmc-supply = <&tf_io>;
345         };
346 };
347
348 &pwm_cd {
349         status = "okay";
350         pinctrl-0 = <&pwm_c1_pins>;
351         pinctrl-names = "default";
352         clocks = <&clkc CLKID_XTAL>;
353         clock-names = "clkin0";
354 };
355
356 &rtc {
357         /* needs to be enabled manually when a battery is connected */
358         clocks = <&rtc32k_xtal>;
359         vdd-supply = <&vdd_rtc>;
360 };
361
362 &uart_AO {
363         status = "okay";
364         pinctrl-0 = <&uart_ao_a_pins>;
365         pinctrl-names = "default";
366 };
367
368 &usb1_phy {
369         status = "okay";
370 };
371
372 &usb1 {
373         status = "okay";
374 };