xref: /rk3399_rockchip-uboot/arch/arm/dts/sun5i-r8-chip.dts (revision c6b968da78ce3fa7224c0ddf15fe170c7c05b27e)
1fd8133b7SMaxime Ripard/*
2fd8133b7SMaxime Ripard * Copyright 2015 Free Electrons
3fd8133b7SMaxime Ripard * Copyright 2015 NextThing Co
4fd8133b7SMaxime Ripard *
5fd8133b7SMaxime Ripard * Maxime Ripard <maxime.ripard@free-electrons.com>
6fd8133b7SMaxime Ripard *
7fd8133b7SMaxime Ripard * This file is dual-licensed: you can use it either under the terms
8fd8133b7SMaxime Ripard * of the GPL or the X11 license, at your option. Note that this dual
9fd8133b7SMaxime Ripard * licensing only applies to this file, and not this project as a
10fd8133b7SMaxime Ripard * whole.
11fd8133b7SMaxime Ripard *
12fd8133b7SMaxime Ripard *  a) This file is free software; you can redistribute it and/or
13fd8133b7SMaxime Ripard *     modify it under the terms of the GNU General Public License as
14fd8133b7SMaxime Ripard *     published by the Free Software Foundation; either version 2 of the
15fd8133b7SMaxime Ripard *     License, or (at your option) any later version.
16fd8133b7SMaxime Ripard *
17fd8133b7SMaxime Ripard *     This file is distributed in the hope that it will be useful,
18fd8133b7SMaxime Ripard *     but WITHOUT ANY WARRANTY; without even the implied warranty of
19fd8133b7SMaxime Ripard *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20fd8133b7SMaxime Ripard *     GNU General Public License for more details.
21fd8133b7SMaxime Ripard *
22fd8133b7SMaxime Ripard * Or, alternatively,
23fd8133b7SMaxime Ripard *
24fd8133b7SMaxime Ripard *  b) Permission is hereby granted, free of charge, to any person
25fd8133b7SMaxime Ripard *     obtaining a copy of this software and associated documentation
26fd8133b7SMaxime Ripard *     files (the "Software"), to deal in the Software without
27fd8133b7SMaxime Ripard *     restriction, including without limitation the rights to use,
28fd8133b7SMaxime Ripard *     copy, modify, merge, publish, distribute, sublicense, and/or
29fd8133b7SMaxime Ripard *     sell copies of the Software, and to permit persons to whom the
30fd8133b7SMaxime Ripard *     Software is furnished to do so, subject to the following
31fd8133b7SMaxime Ripard *     conditions:
32fd8133b7SMaxime Ripard *
33fd8133b7SMaxime Ripard *     The above copyright notice and this permission notice shall be
34fd8133b7SMaxime Ripard *     included in all copies or substantial portions of the Software.
35fd8133b7SMaxime Ripard *
36fd8133b7SMaxime Ripard *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37fd8133b7SMaxime Ripard *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
38fd8133b7SMaxime Ripard *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39fd8133b7SMaxime Ripard *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
40fd8133b7SMaxime Ripard *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41fd8133b7SMaxime Ripard *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42fd8133b7SMaxime Ripard *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
43fd8133b7SMaxime Ripard *     OTHER DEALINGS IN THE SOFTWARE.
44fd8133b7SMaxime Ripard */
45fd8133b7SMaxime Ripard
46fd8133b7SMaxime Ripard/dts-v1/;
47fd8133b7SMaxime Ripard#include "sun5i-r8.dtsi"
48fd8133b7SMaxime Ripard#include "sunxi-common-regulators.dtsi"
49fd8133b7SMaxime Ripard
50fd8133b7SMaxime Ripard#include <dt-bindings/gpio/gpio.h>
51fd8133b7SMaxime Ripard#include <dt-bindings/interrupt-controller/irq.h>
52fd8133b7SMaxime Ripard
53fd8133b7SMaxime Ripard/ {
54fd8133b7SMaxime Ripard	model = "NextThing C.H.I.P.";
55*860fbdd4SHans de Goede	compatible = "nextthing,chip", "allwinner,sun5i-r8", "allwinner,sun5i-a13";
56fd8133b7SMaxime Ripard
57fd8133b7SMaxime Ripard	aliases {
58fd8133b7SMaxime Ripard		i2c0 = &i2c0;
59fd8133b7SMaxime Ripard		i2c2 = &i2c2;
60fd8133b7SMaxime Ripard		serial0 = &uart1;
61fd8133b7SMaxime Ripard		serial1 = &uart3;
62fd8133b7SMaxime Ripard	};
63fd8133b7SMaxime Ripard
64fd8133b7SMaxime Ripard	chosen {
65fd8133b7SMaxime Ripard		stdout-path = "serial0:115200n8";
66fd8133b7SMaxime Ripard	};
6780e5f83cSHans de Goede
6880e5f83cSHans de Goede	wifi_reg_on: wifi_reg_on {
6980e5f83cSHans de Goede		compatible = "regulator-fixed";
7080e5f83cSHans de Goede		pinctrl-names = "default";
7180e5f83cSHans de Goede		pinctrl-0 = <&chip_wifi_reg_on_pin>;
7280e5f83cSHans de Goede
7380e5f83cSHans de Goede		regulator-name = "wifi-reg-on";
7480e5f83cSHans de Goede		regulator-min-microvolt = <3300000>;
7580e5f83cSHans de Goede		regulator-max-microvolt = <3300000>;
7680e5f83cSHans de Goede		gpio = <&pio 2 19 GPIO_ACTIVE_HIGH>; /* PC19 */
7780e5f83cSHans de Goede		enable-active-high;
7880e5f83cSHans de Goede	};
7980e5f83cSHans de Goede};
8080e5f83cSHans de Goede
81*860fbdd4SHans de Goede&be0 {
82*860fbdd4SHans de Goede	status = "okay";
83*860fbdd4SHans de Goede};
84*860fbdd4SHans de Goede
8580e5f83cSHans de Goede&codec {
8680e5f83cSHans de Goede	status = "okay";
8780e5f83cSHans de Goede};
8880e5f83cSHans de Goede
8980e5f83cSHans de Goede&cpu0 {
9080e5f83cSHans de Goede	cpu-supply = <&reg_dcdc2>;
91fd8133b7SMaxime Ripard};
92fd8133b7SMaxime Ripard
93fd8133b7SMaxime Ripard&ehci0 {
94fd8133b7SMaxime Ripard	status = "okay";
95fd8133b7SMaxime Ripard};
96fd8133b7SMaxime Ripard
97fd8133b7SMaxime Ripard&i2c0 {
98fd8133b7SMaxime Ripard	pinctrl-names = "default";
99fd8133b7SMaxime Ripard	pinctrl-0 = <&i2c0_pins_a>;
100fd8133b7SMaxime Ripard	status = "okay";
101fd8133b7SMaxime Ripard
102fd8133b7SMaxime Ripard	axp209: pmic@34 {
103fd8133b7SMaxime Ripard		reg = <0x34>;
104fd8133b7SMaxime Ripard
105fd8133b7SMaxime Ripard		/*
106fd8133b7SMaxime Ripard		 * The interrupt is routed through the "External Fast
107fd8133b7SMaxime Ripard		 * Interrupt Request" pin (ball G13 of the module)
108fd8133b7SMaxime Ripard		 * directly to the main interrupt controller, without
109fd8133b7SMaxime Ripard		 * any other controller interfering.
110fd8133b7SMaxime Ripard		 */
111fd8133b7SMaxime Ripard		interrupts = <0>;
112fd8133b7SMaxime Ripard	};
113fd8133b7SMaxime Ripard};
114fd8133b7SMaxime Ripard
115fd8133b7SMaxime Ripard#include "axp209.dtsi"
116fd8133b7SMaxime Ripard
117fd8133b7SMaxime Ripard&i2c2 {
118fd8133b7SMaxime Ripard	pinctrl-names = "default";
119fd8133b7SMaxime Ripard	pinctrl-0 = <&i2c2_pins_a>;
120fd8133b7SMaxime Ripard	status = "okay";
121fd8133b7SMaxime Ripard
122fd8133b7SMaxime Ripard	xio: gpio@38 {
123fd8133b7SMaxime Ripard		compatible = "nxp,pcf8574a";
124fd8133b7SMaxime Ripard		reg = <0x38>;
125fd8133b7SMaxime Ripard
126fd8133b7SMaxime Ripard		gpio-controller;
127fd8133b7SMaxime Ripard		#gpio-cells = <2>;
128fd8133b7SMaxime Ripard
129fd8133b7SMaxime Ripard		interrupt-parent = <&pio>;
130fd8133b7SMaxime Ripard		interrupts = <6 0 IRQ_TYPE_EDGE_FALLING>;
131fd8133b7SMaxime Ripard		interrupt-controller;
132fd8133b7SMaxime Ripard		#interrupt-cells = <2>;
133fd8133b7SMaxime Ripard	};
134fd8133b7SMaxime Ripard};
135fd8133b7SMaxime Ripard
13680e5f83cSHans de Goede&mmc0_pins_a {
13780e5f83cSHans de Goede	allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
13880e5f83cSHans de Goede};
13980e5f83cSHans de Goede
140fd8133b7SMaxime Ripard&mmc0 {
141fd8133b7SMaxime Ripard	pinctrl-names = "default";
142fd8133b7SMaxime Ripard	pinctrl-0 = <&mmc0_pins_a>;
14380e5f83cSHans de Goede	vmmc-supply = <&wifi_reg_on>;
144fd8133b7SMaxime Ripard	bus-width = <4>;
145fd8133b7SMaxime Ripard	non-removable;
146fd8133b7SMaxime Ripard	status = "okay";
147fd8133b7SMaxime Ripard};
148fd8133b7SMaxime Ripard
149fd8133b7SMaxime Ripard&ohci0 {
150fd8133b7SMaxime Ripard	status = "okay";
151fd8133b7SMaxime Ripard};
152fd8133b7SMaxime Ripard
153fd8133b7SMaxime Ripard&otg_sram {
154fd8133b7SMaxime Ripard	status = "okay";
155fd8133b7SMaxime Ripard};
156fd8133b7SMaxime Ripard
157fd8133b7SMaxime Ripard&pio {
158fd8133b7SMaxime Ripard	chip_vbus_pin: chip_vbus_pin@0 {
159fd8133b7SMaxime Ripard		allwinner,pins = "PB10";
160fd8133b7SMaxime Ripard		allwinner,function = "gpio_out";
161fd8133b7SMaxime Ripard		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
162fd8133b7SMaxime Ripard		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
163fd8133b7SMaxime Ripard	};
164fd8133b7SMaxime Ripard
16580e5f83cSHans de Goede	chip_wifi_reg_on_pin: chip_wifi_reg_on_pin@0 {
16680e5f83cSHans de Goede		allwinner,pins = "PC19";
16780e5f83cSHans de Goede		allwinner,function = "gpio_out";
16880e5f83cSHans de Goede		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
16980e5f83cSHans de Goede		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
17080e5f83cSHans de Goede	};
17180e5f83cSHans de Goede
172fd8133b7SMaxime Ripard	chip_id_det_pin: chip_id_det_pin@0 {
173fd8133b7SMaxime Ripard		allwinner,pins = "PG2";
174fd8133b7SMaxime Ripard		allwinner,function = "gpio_in";
175fd8133b7SMaxime Ripard		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
176fd8133b7SMaxime Ripard		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
177fd8133b7SMaxime Ripard	};
178fd8133b7SMaxime Ripard};
179fd8133b7SMaxime Ripard
180fd8133b7SMaxime Ripard&reg_dcdc2 {
181fd8133b7SMaxime Ripard	regulator-min-microvolt = <1000000>;
182fd8133b7SMaxime Ripard	regulator-max-microvolt = <1400000>;
183fd8133b7SMaxime Ripard	regulator-name = "cpuvdd";
184fd8133b7SMaxime Ripard	regulator-always-on;
185fd8133b7SMaxime Ripard};
186fd8133b7SMaxime Ripard
187fd8133b7SMaxime Ripard&reg_dcdc3 {
188fd8133b7SMaxime Ripard	regulator-min-microvolt = <1000000>;
189fd8133b7SMaxime Ripard	regulator-max-microvolt = <1300000>;
190fd8133b7SMaxime Ripard	regulator-name = "corevdd";
191fd8133b7SMaxime Ripard	regulator-always-on;
192fd8133b7SMaxime Ripard};
193fd8133b7SMaxime Ripard
194fd8133b7SMaxime Ripard&reg_ldo1 {
195fd8133b7SMaxime Ripard	regulator-name = "rtcvdd";
196fd8133b7SMaxime Ripard};
197fd8133b7SMaxime Ripard
198fd8133b7SMaxime Ripard&reg_ldo2 {
199fd8133b7SMaxime Ripard	regulator-min-microvolt = <2700000>;
200fd8133b7SMaxime Ripard	regulator-max-microvolt = <3300000>;
201fd8133b7SMaxime Ripard	regulator-name = "avcc";
202fd8133b7SMaxime Ripard	regulator-always-on;
203fd8133b7SMaxime Ripard};
204fd8133b7SMaxime Ripard
20580e5f83cSHans de Goede&reg_ldo3 {
20680e5f83cSHans de Goede	regulator-min-microvolt = <3300000>;
20780e5f83cSHans de Goede	regulator-max-microvolt = <3300000>;
20880e5f83cSHans de Goede	regulator-name = "vdd-wifi1";
20980e5f83cSHans de Goede	regulator-always-on;
21080e5f83cSHans de Goede};
21180e5f83cSHans de Goede
21280e5f83cSHans de Goede&reg_ldo4 {
21380e5f83cSHans de Goede	regulator-min-microvolt = <3300000>;
21480e5f83cSHans de Goede	regulator-max-microvolt = <3300000>;
21580e5f83cSHans de Goede	regulator-name = "vdd-wifi2";
21680e5f83cSHans de Goede	regulator-always-on;
21780e5f83cSHans de Goede};
21880e5f83cSHans de Goede
219fd8133b7SMaxime Ripard&reg_ldo5 {
220fd8133b7SMaxime Ripard	regulator-min-microvolt = <1800000>;
221fd8133b7SMaxime Ripard	regulator-max-microvolt = <1800000>;
222fd8133b7SMaxime Ripard	regulator-name = "vcc-1v8";
223fd8133b7SMaxime Ripard};
224fd8133b7SMaxime Ripard
225fd8133b7SMaxime Ripard&reg_usb0_vbus {
226fd8133b7SMaxime Ripard	pinctrl-0 = <&chip_vbus_pin>;
227fd8133b7SMaxime Ripard	vin-supply = <&reg_vcc5v0>;
228fd8133b7SMaxime Ripard	gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
229fd8133b7SMaxime Ripard	status = "okay";
230fd8133b7SMaxime Ripard};
231fd8133b7SMaxime Ripard
232*860fbdd4SHans de Goede&tcon0 {
233*860fbdd4SHans de Goede	status = "okay";
234*860fbdd4SHans de Goede};
235*860fbdd4SHans de Goede
236*860fbdd4SHans de Goede&tve0 {
237*860fbdd4SHans de Goede	status = "okay";
238*860fbdd4SHans de Goede};
239*860fbdd4SHans de Goede
240fd8133b7SMaxime Ripard&uart1 {
241fd8133b7SMaxime Ripard	pinctrl-names = "default";
242fd8133b7SMaxime Ripard	pinctrl-0 = <&uart1_pins_b>;
243fd8133b7SMaxime Ripard	status = "okay";
244fd8133b7SMaxime Ripard};
245fd8133b7SMaxime Ripard
246fd8133b7SMaxime Ripard&uart3 {
247fd8133b7SMaxime Ripard	pinctrl-names = "default";
248fd8133b7SMaxime Ripard	pinctrl-0 = <&uart3_pins_a>,
249fd8133b7SMaxime Ripard		    <&uart3_pins_cts_rts_a>;
250fd8133b7SMaxime Ripard	status = "okay";
251fd8133b7SMaxime Ripard};
252fd8133b7SMaxime Ripard
253fd8133b7SMaxime Ripard&usb_otg {
254fd8133b7SMaxime Ripard	dr_mode = "otg";
255fd8133b7SMaxime Ripard	status = "okay";
256fd8133b7SMaxime Ripard};
257fd8133b7SMaxime Ripard
258fd8133b7SMaxime Ripard&usb_power_supply {
259fd8133b7SMaxime Ripard	status = "okay";
260fd8133b7SMaxime Ripard};
261fd8133b7SMaxime Ripard
262fd8133b7SMaxime Ripard&usbphy {
263fd8133b7SMaxime Ripard	pinctrl-names = "default";
264fd8133b7SMaxime Ripard	pinctrl-0 = <&chip_id_det_pin>;
265fd8133b7SMaxime Ripard	status = "okay";
266fd8133b7SMaxime Ripard
267fd8133b7SMaxime Ripard	usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
268fd8133b7SMaxime Ripard	usb0_vbus_power-supply = <&usb_power_supply>;
269fd8133b7SMaxime Ripard	usb0_vbus-supply = <&reg_usb0_vbus>;
270fd8133b7SMaxime Ripard	usb1_vbus-supply = <&reg_vcc5v0>;
271fd8133b7SMaxime Ripard};
272