Merge tag 'riscv-for-linus-4.20-mw2' 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                 reg = <0x40000000 0x40000000>;
66         };
67
68         leds {
69                 compatible = "gpio-leds";
70                 blue {
71                         label = "c1:blue:alive";
72                         gpios = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_LOW>;
73                         linux,default-trigger = "heartbeat";
74                         default-state = "off";
75                 };
76         };
77
78         p5v0: regulator-p5v0 {
79                 compatible = "regulator-fixed";
80
81                 regulator-name = "P5V0";
82                 regulator-min-microvolt = <5000000>;
83                 regulator-max-microvolt = <5000000>;
84         };
85
86         tflash_vdd: regulator-tflash_vdd {
87                 /*
88                  * signal name from schematics: TFLASH_VDD_EN
89                  */
90                 compatible = "regulator-fixed";
91
92                 regulator-name = "TFLASH_VDD";
93                 regulator-min-microvolt = <3300000>;
94                 regulator-max-microvolt = <3300000>;
95
96                 vin-supply = <&vcc_3v3>;
97
98                 gpio = <&gpio GPIOY_12 GPIO_ACTIVE_HIGH>;
99                 enable-active-high;
100         };
101
102         tf_io: gpio-regulator-tf_io {
103                 compatible = "regulator-gpio";
104
105                 regulator-name = "TF_IO";
106                 regulator-min-microvolt = <1800000>;
107                 regulator-max-microvolt = <3300000>;
108
109                 vin-supply = <&vcc_3v3>;
110
111                 /*
112                  * signal name from schematics: TF_3V3N_1V8_EN
113                  */
114                 gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>;
115                 gpios-states = <0>;
116
117                 states = <3300000 0
118                           1800000 1>;
119         };
120
121         vcc_1v8: regulator-vcc-1v8 {
122                 /*
123                  * RICHTEK RT9179 configured for a fixed output voltage of
124                  * 1.8V. This supplies not only VCC1V8 but also IOREF_1V8 and
125                  * VDD1V8 according to the schematics.
126                  */
127                 compatible = "regulator-fixed";
128
129                 regulator-name = "VCC1V8";
130                 regulator-min-microvolt = <1800000>;
131                 regulator-max-microvolt = <1800000>;
132
133                 vin-supply = <&p5v0>;
134         };
135
136         vcc_3v3: regulator-vcc-3v3 {
137                 /*
138                  * Monolithic Power Systems MP2161 configured for a fixed
139                  * output voltage of 3.3V. This supplies not only VCC3V3 but
140                  * also VDD3V3 and VDDIO_AO3V3 according to the schematics.
141                  */
142                 compatible = "regulator-fixed";
143
144                 regulator-name = "VCC3V3";
145                 regulator-min-microvolt = <3300000>;
146                 regulator-max-microvolt = <3300000>;
147
148                 vin-supply = <&p5v0>;
149         };
150
151         vcck: regulator-vcck {
152                 /* Monolithic Power Systems MP2161 */
153                 compatible = "pwm-regulator";
154
155                 regulator-name = "VCCK";
156                 regulator-min-microvolt = <860000>;
157                 regulator-max-microvolt = <1140000>;
158
159                 vin-supply = <&p5v0>;
160
161                 pwms = <&pwm_cd 0 12218 0>;
162                 pwm-dutycycle-range = <91 0>;
163
164                 regulator-boot-on;
165                 regulator-always-on;
166         };
167
168         vddc_ddr: regulator-vddc-ddr {
169                 /*
170                  * Monolithic Power Systems MP2161 configured for a fixed
171                  * output voltage of 1.5V. This supplies not only DDR_VDDC but
172                  * also DDR3_1V5 according to the schematics.
173                  */
174                 compatible = "regulator-fixed";
175
176                 regulator-name = "DDR_VDDC";
177                 regulator-min-microvolt = <1500000>;
178                 regulator-max-microvolt = <1500000>;
179
180                 vin-supply = <&p5v0>;
181         };
182
183         vdd_rtc: regulator-vdd-rtc {
184                 /*
185                  * Torex Semiconductor XC6215 configured for a fixed output of
186                  * 0.9V.
187                  */
188                 compatible = "regulator-fixed";
189
190                 regulator-name = "VDD_RTC";
191                 regulator-min-microvolt = <900000>;
192                 regulator-max-microvolt = <900000>;
193
194                 vin-supply = <&vcc_3v3>;
195         };
196 };
197
198 &cpu0 {
199         cpu-supply = <&vcck>;
200 };
201
202 &ethmac {
203         status = "okay";
204
205         snps,reset-gpio = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH>;
206         snps,reset-active-low;
207         snps,reset-delays-us = <0 10000 30000>;
208
209         pinctrl-0 = <&eth_rgmii_pins>;
210         pinctrl-names = "default";
211
212         phy-mode = "rgmii";
213         phy-handle = <&eth_phy>;
214         amlogic,tx-delay-ns = <4>;
215
216         mdio {
217                 compatible = "snps,dwmac-mdio";
218                 #address-cells = <1>;
219                 #size-cells = <0>;
220
221                 /* Realtek RTL8211F (0x001cc916) */
222                 eth_phy: ethernet-phy@0 {
223                         reg = <0>;
224                         eee-broken-1000t;
225                         interrupt-parent = <&gpio_intc>;
226                         /* GPIOH_3 */
227                         interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
228                 };
229         };
230 };
231
232 &gpio_ao {
233         /*
234          * WARNING: The USB Hub on the Odroid-C1/C1+ needs a reset signal
235          * to be turned high in order to be detected by the USB Controller.
236          * This signal should be handled by a USB specific power sequence
237          * in order to reset the Hub when USB bus is powered down.
238          */
239         usb-hub {
240                 gpio-hog;
241                 gpios = <GPIOAO_4 GPIO_ACTIVE_HIGH>;
242                 output-high;
243                 line-name = "usb-hub-reset";
244         };
245 };
246
247 &ir_receiver {
248         status = "okay";
249         pinctrl-0 = <&ir_recv_pins>;
250         pinctrl-names = "default";
251 };
252
253 &saradc {
254         status = "okay";
255         vref-supply = <&vcc_1v8>;
256 };
257
258 &sdio {
259         status = "okay";
260
261         pinctrl-0 = <&sd_b_pins>;
262         pinctrl-names = "default";
263
264         /* SD card */
265         sd_card_slot: slot@1 {
266                 compatible = "mmc-slot";
267                 reg = <1>;
268                 status = "okay";
269
270                 bus-width = <4>;
271                 no-sdio;
272                 cap-mmc-highspeed;
273                 cap-sd-highspeed;
274                 disable-wp;
275
276                 cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
277                 cd-inverted;
278
279                 vmmc-supply = <&tflash_vdd>;
280                 vqmmc-supply = <&tf_io>;
281         };
282 };
283
284 &pwm_cd {
285         status = "okay";
286         pinctrl-0 = <&pwm_c1_pins>;
287         pinctrl-names = "default";
288         clocks = <&clkc CLKID_XTAL>;
289         clock-names = "clkin0";
290 };
291
292 &uart_AO {
293         status = "okay";
294         pinctrl-0 = <&uart_ao_a_pins>;
295         pinctrl-names = "default";
296 };
297
298 &usb1_phy {
299         status = "okay";
300 };
301
302 &usb1 {
303         status = "okay";
304 };