xref: /OK3568_Linux_fs/u-boot/arch/arm/dts/sun5i-gr8-chip-pro.dts (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun/*
2*4882a593Smuzhiyun * Copyright 2016 Free Electrons
3*4882a593Smuzhiyun * Copyright 2016 NextThing Co
4*4882a593Smuzhiyun *
5*4882a593Smuzhiyun * Maxime Ripard <maxime.ripard@free-electrons.com>
6*4882a593Smuzhiyun *
7*4882a593Smuzhiyun * This file is dual-licensed: you can use it either under the terms
8*4882a593Smuzhiyun * of the GPL or the X11 license, at your option. Note that this dual
9*4882a593Smuzhiyun * licensing only applies to this file, and not this project as a
10*4882a593Smuzhiyun * whole.
11*4882a593Smuzhiyun *
12*4882a593Smuzhiyun *  a) This file is free software; you can redistribute it and/or
13*4882a593Smuzhiyun *     modify it under the terms of the GNU General Public License as
14*4882a593Smuzhiyun *     published by the Free Software Foundation; either version 2 of the
15*4882a593Smuzhiyun *     License, or (at your option) any later version.
16*4882a593Smuzhiyun *
17*4882a593Smuzhiyun *     This file is distributed in the hope that it will be useful,
18*4882a593Smuzhiyun *     but WITHOUT ANY WARRANTY; without even the implied warranty of
19*4882a593Smuzhiyun *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20*4882a593Smuzhiyun *     GNU General Public License for more details.
21*4882a593Smuzhiyun *
22*4882a593Smuzhiyun * Or, alternatively,
23*4882a593Smuzhiyun *
24*4882a593Smuzhiyun *  b) Permission is hereby granted, free of charge, to any person
25*4882a593Smuzhiyun *     obtaining a copy of this software and associated documentation
26*4882a593Smuzhiyun *     files (the "Software"), to deal in the Software without
27*4882a593Smuzhiyun *     restriction, including without limitation the rights to use,
28*4882a593Smuzhiyun *     copy, modify, merge, publish, distribute, sublicense, and/or
29*4882a593Smuzhiyun *     sell copies of the Software, and to permit persons to whom the
30*4882a593Smuzhiyun *     Software is furnished to do so, subject to the following
31*4882a593Smuzhiyun *     conditions:
32*4882a593Smuzhiyun *
33*4882a593Smuzhiyun *     The above copyright notice and this permission notice shall be
34*4882a593Smuzhiyun *     included in all copies or substantial portions of the Software.
35*4882a593Smuzhiyun *
36*4882a593Smuzhiyun *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37*4882a593Smuzhiyun *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
38*4882a593Smuzhiyun *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39*4882a593Smuzhiyun *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
40*4882a593Smuzhiyun *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41*4882a593Smuzhiyun *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42*4882a593Smuzhiyun *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
43*4882a593Smuzhiyun *     OTHER DEALINGS IN THE SOFTWARE.
44*4882a593Smuzhiyun */
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun/dts-v1/;
47*4882a593Smuzhiyun#include "sun5i-gr8.dtsi"
48*4882a593Smuzhiyun#include "sunxi-common-regulators.dtsi"
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun#include <dt-bindings/gpio/gpio.h>
51*4882a593Smuzhiyun#include <dt-bindings/input/input.h>
52*4882a593Smuzhiyun#include <dt-bindings/interrupt-controller/irq.h>
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun/ {
55*4882a593Smuzhiyun	model = "NextThing C.H.I.P. Pro";
56*4882a593Smuzhiyun	compatible = "nextthing,chip-pro", "nextthing,gr8";
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun	aliases {
59*4882a593Smuzhiyun		i2c0 = &i2c0;
60*4882a593Smuzhiyun		i2c1 = &i2c1;
61*4882a593Smuzhiyun		serial0 = &uart1;
62*4882a593Smuzhiyun		serial1 = &uart2;
63*4882a593Smuzhiyun		serial2 = &uart3;
64*4882a593Smuzhiyun	};
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun	chosen {
67*4882a593Smuzhiyun		stdout-path = "serial0:115200n8";
68*4882a593Smuzhiyun	};
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun	leds {
71*4882a593Smuzhiyun		compatible = "gpio-leds";
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun		status {
74*4882a593Smuzhiyun			label = "chip-pro:white:status";
75*4882a593Smuzhiyun			gpios = <&axp_gpio 2 GPIO_ACTIVE_HIGH>;
76*4882a593Smuzhiyun			default-state = "on";
77*4882a593Smuzhiyun		};
78*4882a593Smuzhiyun	};
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun	mmc0_pwrseq: mmc0_pwrseq {
81*4882a593Smuzhiyun		compatible = "mmc-pwrseq-simple";
82*4882a593Smuzhiyun		pinctrl-names = "default";
83*4882a593Smuzhiyun		pinctrl-0 = <&wifi_reg_on_pin_chip_pro>;
84*4882a593Smuzhiyun		reset-gpios = <&pio 1 10 GPIO_ACTIVE_LOW>; /* PB10 */
85*4882a593Smuzhiyun	};
86*4882a593Smuzhiyun};
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun&codec {
89*4882a593Smuzhiyun	status = "okay";
90*4882a593Smuzhiyun};
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun&ehci0 {
93*4882a593Smuzhiyun	status = "okay";
94*4882a593Smuzhiyun};
95*4882a593Smuzhiyun
96*4882a593Smuzhiyun&i2c0 {
97*4882a593Smuzhiyun	pinctrl-names = "default";
98*4882a593Smuzhiyun	pinctrl-0 = <&i2c0_pins_a>;
99*4882a593Smuzhiyun	status = "okay";
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun	axp209: pmic@34 {
102*4882a593Smuzhiyun		reg = <0x34>;
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun		/*
105*4882a593Smuzhiyun		* The interrupt is routed through the "External Fast
106*4882a593Smuzhiyun		* Interrupt Request" pin (ball G13 of the module)
107*4882a593Smuzhiyun		* directly to the main interrupt controller, without
108*4882a593Smuzhiyun		* any other controller interfering.
109*4882a593Smuzhiyun		*/
110*4882a593Smuzhiyun		interrupts = <0>;
111*4882a593Smuzhiyun	};
112*4882a593Smuzhiyun};
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun#include "axp209.dtsi"
115*4882a593Smuzhiyun
116*4882a593Smuzhiyun&i2c1 {
117*4882a593Smuzhiyun	pinctrl-names = "default";
118*4882a593Smuzhiyun	pinctrl-0 = <&i2c1_pins_a>;
119*4882a593Smuzhiyun	status = "disabled";
120*4882a593Smuzhiyun};
121*4882a593Smuzhiyun
122*4882a593Smuzhiyun&i2s0 {
123*4882a593Smuzhiyun	pinctrl-names = "default";
124*4882a593Smuzhiyun	pinctrl-0 = <&i2s0_mclk_pins_a>, <&i2s0_data_pins_a>;
125*4882a593Smuzhiyun	status = "disabled";
126*4882a593Smuzhiyun};
127*4882a593Smuzhiyun
128*4882a593Smuzhiyun&mmc0 {
129*4882a593Smuzhiyun	pinctrl-names = "default";
130*4882a593Smuzhiyun	pinctrl-0 = <&mmc0_pins_a>;
131*4882a593Smuzhiyun	vmmc-supply = <&reg_vcc3v3>;
132*4882a593Smuzhiyun	mmc-pwrseq = <&mmc0_pwrseq>;
133*4882a593Smuzhiyun	bus-width = <4>;
134*4882a593Smuzhiyun	non-removable;
135*4882a593Smuzhiyun	status = "okay";
136*4882a593Smuzhiyun};
137*4882a593Smuzhiyun
138*4882a593Smuzhiyun&nfc {
139*4882a593Smuzhiyun	pinctrl-names = "default";
140*4882a593Smuzhiyun	pinctrl-0 = <&nand_pins_a &nand_cs0_pins_a &nand_rb0_pins_a>;
141*4882a593Smuzhiyun	status = "okay";
142*4882a593Smuzhiyun
143*4882a593Smuzhiyun	nand@0 {
144*4882a593Smuzhiyun		#address-cells = <2>;
145*4882a593Smuzhiyun		#size-cells = <2>;
146*4882a593Smuzhiyun		reg = <0>;
147*4882a593Smuzhiyun		allwinner,rb = <0>;
148*4882a593Smuzhiyun		nand-ecc-mode = "hw";
149*4882a593Smuzhiyun	};
150*4882a593Smuzhiyun};
151*4882a593Smuzhiyun
152*4882a593Smuzhiyun&ohci0 {
153*4882a593Smuzhiyun	status = "okay";
154*4882a593Smuzhiyun};
155*4882a593Smuzhiyun
156*4882a593Smuzhiyun&otg_sram {
157*4882a593Smuzhiyun	status = "okay";
158*4882a593Smuzhiyun};
159*4882a593Smuzhiyun
160*4882a593Smuzhiyun&pio {
161*4882a593Smuzhiyun	usb0_id_pin_chip_pro: usb0-id-pin@0 {
162*4882a593Smuzhiyun		allwinner,pins = "PG2";
163*4882a593Smuzhiyun		allwinner,function = "gpio_in";
164*4882a593Smuzhiyun		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
165*4882a593Smuzhiyun		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
166*4882a593Smuzhiyun	};
167*4882a593Smuzhiyun
168*4882a593Smuzhiyun	wifi_reg_on_pin_chip_pro: wifi-reg-on-pin@0 {
169*4882a593Smuzhiyun		allwinner,pins = "PB10";
170*4882a593Smuzhiyun		allwinner,function = "gpio_out";
171*4882a593Smuzhiyun		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
172*4882a593Smuzhiyun		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
173*4882a593Smuzhiyun	};
174*4882a593Smuzhiyun};
175*4882a593Smuzhiyun
176*4882a593Smuzhiyun&pwm {
177*4882a593Smuzhiyun	pinctrl-names = "default";
178*4882a593Smuzhiyun	pinctrl-0 = <&pwm0_pins_a>, <&pwm1_pins>;
179*4882a593Smuzhiyun	status = "disabled";
180*4882a593Smuzhiyun};
181*4882a593Smuzhiyun
182*4882a593Smuzhiyun&reg_dcdc2 {
183*4882a593Smuzhiyun	regulator-min-microvolt = <1000000>;
184*4882a593Smuzhiyun	regulator-max-microvolt = <1400000>;
185*4882a593Smuzhiyun	regulator-name = "vdd-cpu";
186*4882a593Smuzhiyun	regulator-always-on;
187*4882a593Smuzhiyun};
188*4882a593Smuzhiyun
189*4882a593Smuzhiyun&reg_dcdc3 {
190*4882a593Smuzhiyun	regulator-min-microvolt = <1000000>;
191*4882a593Smuzhiyun	regulator-max-microvolt = <1300000>;
192*4882a593Smuzhiyun	regulator-name = "vdd-sys";
193*4882a593Smuzhiyun	regulator-always-on;
194*4882a593Smuzhiyun};
195*4882a593Smuzhiyun
196*4882a593Smuzhiyun&reg_ldo1 {
197*4882a593Smuzhiyun	regulator-name = "vdd-rtc";
198*4882a593Smuzhiyun};
199*4882a593Smuzhiyun
200*4882a593Smuzhiyun&reg_ldo2 {
201*4882a593Smuzhiyun	regulator-min-microvolt = <2700000>;
202*4882a593Smuzhiyun	regulator-max-microvolt = <3300000>;
203*4882a593Smuzhiyun	regulator-name = "avcc";
204*4882a593Smuzhiyun	regulator-always-on;
205*4882a593Smuzhiyun};
206*4882a593Smuzhiyun
207*4882a593Smuzhiyun/*
208*4882a593Smuzhiyun * Both LDO3 and LDO4 are used in parallel to power up the
209*4882a593Smuzhiyun * WiFi/BT chip.
210*4882a593Smuzhiyun */
211*4882a593Smuzhiyun&reg_ldo3 {
212*4882a593Smuzhiyun	regulator-min-microvolt = <3300000>;
213*4882a593Smuzhiyun	regulator-max-microvolt = <3300000>;
214*4882a593Smuzhiyun	regulator-name = "vcc-wifi-1";
215*4882a593Smuzhiyun	regulator-always-on;
216*4882a593Smuzhiyun};
217*4882a593Smuzhiyun
218*4882a593Smuzhiyun&reg_ldo4 {
219*4882a593Smuzhiyun	regulator-min-microvolt = <3300000>;
220*4882a593Smuzhiyun	regulator-max-microvolt = <3300000>;
221*4882a593Smuzhiyun	regulator-name = "vcc-wifi-2";
222*4882a593Smuzhiyun	regulator-always-on;
223*4882a593Smuzhiyun};
224*4882a593Smuzhiyun
225*4882a593Smuzhiyun&uart1 {
226*4882a593Smuzhiyun	pinctrl-names = "default";
227*4882a593Smuzhiyun	pinctrl-0 = <&uart1_pins_a>, <&uart1_cts_rts_pins_a>;
228*4882a593Smuzhiyun	status = "okay";
229*4882a593Smuzhiyun};
230*4882a593Smuzhiyun
231*4882a593Smuzhiyun&uart2 {
232*4882a593Smuzhiyun	pinctrl-names = "default";
233*4882a593Smuzhiyun	pinctrl-0 = <&uart2_pins_a>, <&uart2_cts_rts_pins_a>;
234*4882a593Smuzhiyun	status = "disabled";
235*4882a593Smuzhiyun};
236*4882a593Smuzhiyun
237*4882a593Smuzhiyun&uart3 {
238*4882a593Smuzhiyun	pinctrl-names = "default";
239*4882a593Smuzhiyun	pinctrl-0 = <&uart3_pins_a>, <&uart3_cts_rts_pins_a>;
240*4882a593Smuzhiyun	status = "okay";
241*4882a593Smuzhiyun};
242*4882a593Smuzhiyun
243*4882a593Smuzhiyun&usb_otg {
244*4882a593Smuzhiyun	/*
245*4882a593Smuzhiyun	 * The CHIP Pro doesn't have a controllable VBUS, nor does it
246*4882a593Smuzhiyun	 * have any 5v rail on the board itself.
247*4882a593Smuzhiyun	 *
248*4882a593Smuzhiyun	 * If one wants to use it as a true OTG port, it should be
249*4882a593Smuzhiyun	 * done in the baseboard, and its DT / overlay will add it.
250*4882a593Smuzhiyun	 */
251*4882a593Smuzhiyun	dr_mode = "otg";
252*4882a593Smuzhiyun	status = "okay";
253*4882a593Smuzhiyun};
254*4882a593Smuzhiyun
255*4882a593Smuzhiyun&usb_power_supply {
256*4882a593Smuzhiyun	status = "okay";
257*4882a593Smuzhiyun};
258*4882a593Smuzhiyun
259*4882a593Smuzhiyun&usbphy {
260*4882a593Smuzhiyun	pinctrl-names = "default";
261*4882a593Smuzhiyun	pinctrl-0 = <&usb0_id_pin_chip_pro>;
262*4882a593Smuzhiyun	usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
263*4882a593Smuzhiyun	usb0_vbus_power-supply = <&usb_power_supply>;
264*4882a593Smuzhiyun	usb1_vbus-supply = <&reg_vcc5v0>;
265*4882a593Smuzhiyun	status = "okay";
266*4882a593Smuzhiyun};
267