• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright 2015 Tyler Baker
3 *
4 * Tyler Baker <tyler.baker@linaro.org>
5 * Chen-Yu Tsai <wens@csie.org>
6 *
7 * This file is dual-licensed: you can use it either under the terms
8 * of the GPL or the X11 license, at your option. Note that this dual
9 * licensing only applies to this file, and not this project as a
10 * whole.
11 *
12 *  a) This file is free software; you can redistribute it and/or
13 *     modify it under the terms of the GNU General Public License as
14 *     published by the Free Software Foundation; either version 2 of the
15 *     License, or (at your option) any later version.
16 *
17 *     This file is distributed in the hope that it will be useful,
18 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
19 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 *     GNU General Public License for more details.
21 *
22 * Or, alternatively,
23 *
24 *  b) Permission is hereby granted, free of charge, to any person
25 *     obtaining a copy of this software and associated documentation
26 *     files (the "Software"), to deal in the Software without
27 *     restriction, including without limitation the rights to use,
28 *     copy, modify, merge, publish, distribute, sublicense, and/or
29 *     sell copies of the Software, and to permit persons to whom the
30 *     Software is furnished to do so, subject to the following
31 *     conditions:
32 *
33 *     The above copyright notice and this permission notice shall be
34 *     included in all copies or substantial portions of the Software.
35 *
36 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
38 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
40 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
43 *     OTHER DEALINGS IN THE SOFTWARE.
44 */
45
46/dts-v1/;
47#include "sun9i-a80.dtsi"
48
49#include <dt-bindings/gpio/gpio.h>
50
51/ {
52	model = "Cubietech Cubieboard4";
53	compatible = "cubietech,a80-cubieboard4", "allwinner,sun9i-a80";
54
55	aliases {
56		serial0 = &uart0;
57	};
58
59	chosen {
60		stdout-path = "serial0:115200n8";
61	};
62
63	leds {
64		compatible = "gpio-leds";
65		pinctrl-names = "default";
66		pinctrl-0 = <&led_pins_cubieboard4>;
67
68		green {
69			label = "cubieboard4:green:usr";
70			gpios = <&pio 7 17 GPIO_ACTIVE_HIGH>; /* PH17 */
71		};
72
73		red {
74			label = "cubieboard4:red:usr";
75			gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
76		};
77	};
78
79	wifi_pwrseq: wifi_pwrseq {
80		compatible = "mmc-pwrseq-simple";
81		clocks = <&ac100_rtc 1>;
82		clock-names = "ext_clock";
83		/* enables internal regulator and de-asserts reset */
84		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
85	};
86};
87
88&mmc0 {
89	pinctrl-names = "default";
90	pinctrl-0 = <&mmc0_pins>, <&mmc0_cd_pin_cubieboard4>;
91	vmmc-supply = <&reg_dcdc1>;
92	bus-width = <4>;
93	cd-gpios = <&pio 7 18 GPIO_ACTIVE_HIGH>; /* PH18 */
94	cd-inverted;
95	status = "okay";
96};
97
98&mmc1 {
99	pinctrl-names = "default";
100	pinctrl-0 = <&mmc1_pins>, <&wifi_en_pin_cubieboard4>;
101	vmmc-supply = <&reg_dldo1>;
102	vqmmc-supply = <&reg_cldo3>;
103	mmc-pwrseq = <&wifi_pwrseq>;
104	bus-width = <4>;
105	non-removable;
106	status = "okay";
107};
108
109&mmc1_pins {
110	bias-pull-up;
111};
112
113&mmc2 {
114	pinctrl-names = "default";
115	pinctrl-0 = <&mmc2_8bit_pins>;
116	vmmc-supply = <&reg_dcdc1>;
117	bus-width = <8>;
118	non-removable;
119	cap-mmc-hw-reset;
120	status = "okay";
121};
122
123&mmc2_8bit_pins {
124	/* Increase drive strength for DDR modes */
125	drive-strength = <40>;
126};
127
128&osc32k {
129	/* osc32k input is from AC100 */
130	clocks = <&ac100_rtc 0>;
131};
132
133&pio {
134	led_pins_cubieboard4: led-pins@0 {
135		pins = "PH6", "PH17";
136		function = "gpio_out";
137	};
138
139	mmc0_cd_pin_cubieboard4: mmc0_cd_pin@0 {
140		pins = "PH18";
141		function = "gpio_in";
142		bias-pull-up;
143	};
144};
145
146&r_ir {
147	status = "okay";
148};
149
150&r_pio {
151	wifi_en_pin_cubieboard4: wifi_en_pin@0 {
152		pins = "PL2";
153		function = "gpio_out";
154	};
155};
156
157&r_rsb {
158	status = "okay";
159
160	axp809: pmic@3a3 {
161		reg = <0x3a3>;
162		interrupt-parent = <&nmi_intc>;
163		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
164
165		regulators {
166			reg_aldo1: aldo1 {
167				/*
168				 * TODO: This should be handled by the
169				 * USB PHY driver.
170				 */
171				regulator-always-on;
172				regulator-min-microvolt = <3000000>;
173				regulator-max-microvolt = <3000000>;
174				regulator-name = "vcc33-usbh";
175			};
176
177			reg_aldo2: aldo2 {
178				regulator-min-microvolt = <1800000>;
179				regulator-max-microvolt = <1800000>;
180				regulator-name = "vcc-pb-io-cam";
181			};
182
183			aldo3 {
184				/* unused */
185			};
186
187			reg_dc5ldo: dc5ldo {
188				regulator-always-on;
189				regulator-min-microvolt = <800000>;
190				regulator-max-microvolt = <1100000>;
191				regulator-name = "vdd-cpus-09-usbh";
192			};
193
194			reg_dcdc1: dcdc1 {
195				regulator-always-on;
196				regulator-min-microvolt = <3000000>;
197				regulator-max-microvolt = <3000000>;
198				regulator-name = "vcc-3v";
199			};
200
201			reg_dcdc2: dcdc2 {
202				regulator-min-microvolt = <800000>;
203				regulator-max-microvolt = <1100000>;
204				regulator-name = "vdd-gpu";
205			};
206
207			reg_dcdc3: dcdc3 {
208				regulator-always-on;
209				regulator-min-microvolt = <800000>;
210				regulator-max-microvolt = <1100000>;
211				regulator-name = "vdd-cpua";
212			};
213
214			reg_dcdc4: dcdc4 {
215				regulator-always-on;
216				regulator-min-microvolt = <800000>;
217				regulator-max-microvolt = <1100000>;
218				regulator-name = "vdd-sys-usb0-hdmi";
219			};
220
221			reg_dcdc5: dcdc5 {
222				regulator-always-on;
223				regulator-min-microvolt = <1425000>;
224				regulator-max-microvolt = <1575000>;
225				regulator-name = "vcc-dram";
226			};
227
228			reg_dldo1: dldo1 {
229				/*
230				 * The WiFi chip supports a wide range
231				 * (3.0 ~ 4.8V) of voltages, and so does
232				 * this regulator (3.0 ~ 4.2V), but
233				 * Allwinner SDK always sets it to 3.3V.
234				 */
235				regulator-min-microvolt = <3300000>;
236				regulator-max-microvolt = <3300000>;
237				regulator-name = "vcc-wifi";
238			};
239
240			reg_dldo2: dldo2 {
241				regulator-always-on;
242				regulator-min-microvolt = <3000000>;
243				regulator-max-microvolt = <3000000>;
244				regulator-name = "vcc-pl";
245			};
246
247			reg_eldo1: eldo1 {
248				regulator-min-microvolt = <1200000>;
249				regulator-max-microvolt = <1200000>;
250				regulator-name = "vcc-dvdd-cam";
251			};
252
253			reg_eldo2: eldo2 {
254				regulator-min-microvolt = <1800000>;
255				regulator-max-microvolt = <1800000>;
256				regulator-name = "vcc-pe";
257			};
258
259			reg_eldo3: eldo3 {
260				regulator-always-on;
261				regulator-min-microvolt = <3000000>;
262				regulator-max-microvolt = <3000000>;
263				regulator-name = "vcc-pm-codec-io1";
264			};
265
266			reg_ldo_io0: ldo_io0 {
267				regulator-always-on;
268				regulator-min-microvolt = <3000000>;
269				regulator-max-microvolt = <3000000>;
270				regulator-name = "vcc-pg";
271			};
272
273			reg_ldo_io1: ldo_io1 {
274				regulator-min-microvolt = <2500000>;
275				regulator-max-microvolt = <2500000>;
276				regulator-name = "vcc-pa-gmac-2v5";
277			};
278
279			reg_rtc_ldo: rtc_ldo {
280				regulator-name = "vcc-rtc-vdd1v8-io";
281			};
282
283			sw {
284				/* unused */
285			};
286		};
287	};
288
289	axp806: pmic@745 {
290		compatible = "x-powers,axp806";
291		reg = <0x745>;
292		interrupt-parent = <&nmi_intc>;
293		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
294		interrupt-controller;
295		#interrupt-cells = <1>;
296		bldoin-supply = <&reg_dcdce>;
297
298		regulators {
299			reg_s_aldo1: aldo1 {
300				regulator-always-on;
301				regulator-min-microvolt = <3000000>;
302				regulator-max-microvolt = <3000000>;
303				regulator-name = "avcc";
304			};
305
306			aldo2 {
307				/*
308				 * unused, but use a different name to
309				 * avoid name clash with axp809's aldo's
310				 */
311				regulator-name = "s_aldo2";
312			};
313
314			aldo3 {
315				/*
316				 * unused, but use a different name to
317				 * avoid name clash with axp809's aldo's
318				 */
319				regulator-name = "s_aldo3";
320			};
321
322			reg_bldo1: bldo1 {
323				regulator-always-on;
324				regulator-min-microvolt = <1700000>;
325				regulator-max-microvolt = <1900000>;
326				regulator-name = "vcc18-efuse-adc-display-csi";
327			};
328
329			reg_bldo2: bldo2 {
330				regulator-always-on;
331				regulator-min-microvolt = <1700000>;
332				regulator-max-microvolt = <1900000>;
333				regulator-name =
334					"vdd18-drampll-vcc18-pll-cpvdd";
335			};
336
337			bldo3 {
338				/* unused */
339			};
340
341			reg_bldo4: bldo4 {
342				regulator-min-microvolt = <1100000>;
343				regulator-max-microvolt = <1300000>;
344				regulator-name = "vcc12-hsic";
345			};
346
347			reg_cldo1: cldo1 {
348				/*
349				 * This was 3V in the original design, but
350				 * 3.3V is the recommended supply voltage
351				 * for the Ethernet PHY.
352				 */
353				regulator-min-microvolt = <3300000>;
354				regulator-max-microvolt = <3300000>;
355				regulator-name = "vcc-gmac-phy";
356			};
357
358			reg_cldo2: cldo2 {
359				regulator-min-microvolt = <2800000>;
360				regulator-max-microvolt = <2800000>;
361				regulator-name = "afvcc-cam";
362			};
363
364			reg_cldo3: cldo3 {
365				regulator-min-microvolt = <3000000>;
366				regulator-max-microvolt = <3000000>;
367				regulator-name = "vcc-io-wifi-codec-io2";
368			};
369
370			reg_dcdca: dcdca {
371				regulator-always-on;
372				regulator-min-microvolt = <800000>;
373				regulator-max-microvolt = <1100000>;
374				regulator-name = "vdd-cpub";
375			};
376
377			reg_dcdcd: dcdcd {
378				regulator-always-on;
379				regulator-min-microvolt = <800000>;
380				regulator-max-microvolt = <1100000>;
381				regulator-name = "vdd-vpu";
382			};
383
384			reg_dcdce: dcdce {
385				regulator-always-on;
386				regulator-min-microvolt = <2100000>;
387				regulator-max-microvolt = <2100000>;
388				regulator-name = "vcc-bldo-codec-ldoin";
389			};
390
391			sw {
392				/*
393				 * unused, but use a different name to
394				 * avoid name clash with axp809's sw
395				 */
396				regulator-name = "s_sw";
397			};
398		};
399	};
400
401	ac100: codec@e89 {
402		compatible = "x-powers,ac100";
403		reg = <0xe89>;
404
405		ac100_codec: codec {
406			compatible = "x-powers,ac100-codec";
407			interrupt-parent = <&r_pio>;
408			interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PL9 */
409			#clock-cells = <0>;
410			clock-output-names = "4M_adda";
411		};
412
413		ac100_rtc: rtc {
414			compatible = "x-powers,ac100-rtc";
415			interrupt-parent = <&nmi_intc>;
416			interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
417			clocks = <&ac100_codec>;
418			#clock-cells = <1>;
419			clock-output-names = "cko1_rtc",
420					     "cko2_rtc",
421					     "cko3_rtc";
422		};
423	};
424};
425
426#include "axp809.dtsi"
427
428&uart0 {
429	pinctrl-names = "default";
430	pinctrl-0 = <&uart0_pins_a>;
431	status = "okay";
432};
433