xref: /freebsd-src/sys/contrib/device-tree/src/arm/allwinner/sun5i-r8-chip.dts (revision 7d0873ebb83b19ba1e8a89e679470d885efe12e3)
1f126890aSEmmanuel Vadot/*
2f126890aSEmmanuel Vadot * Copyright 2015 Free Electrons
3f126890aSEmmanuel Vadot * Copyright 2015 NextThing Co
4f126890aSEmmanuel Vadot *
5f126890aSEmmanuel Vadot * Maxime Ripard <maxime.ripard@free-electrons.com>
6f126890aSEmmanuel Vadot *
7f126890aSEmmanuel Vadot * This file is dual-licensed: you can use it either under the terms
8f126890aSEmmanuel Vadot * of the GPL or the X11 license, at your option. Note that this dual
9f126890aSEmmanuel Vadot * licensing only applies to this file, and not this project as a
10f126890aSEmmanuel Vadot * whole.
11f126890aSEmmanuel Vadot *
12f126890aSEmmanuel Vadot *  a) This file is free software; you can redistribute it and/or
13f126890aSEmmanuel Vadot *     modify it under the terms of the GNU General Public License as
14f126890aSEmmanuel Vadot *     published by the Free Software Foundation; either version 2 of the
15f126890aSEmmanuel Vadot *     License, or (at your option) any later version.
16f126890aSEmmanuel Vadot *
17f126890aSEmmanuel Vadot *     This file is distributed in the hope that it will be useful,
18f126890aSEmmanuel Vadot *     but WITHOUT ANY WARRANTY; without even the implied warranty of
19f126890aSEmmanuel Vadot *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20f126890aSEmmanuel Vadot *     GNU General Public License for more details.
21f126890aSEmmanuel Vadot *
22f126890aSEmmanuel Vadot * Or, alternatively,
23f126890aSEmmanuel Vadot *
24f126890aSEmmanuel Vadot *  b) Permission is hereby granted, free of charge, to any person
25f126890aSEmmanuel Vadot *     obtaining a copy of this software and associated documentation
26f126890aSEmmanuel Vadot *     files (the "Software"), to deal in the Software without
27f126890aSEmmanuel Vadot *     restriction, including without limitation the rights to use,
28f126890aSEmmanuel Vadot *     copy, modify, merge, publish, distribute, sublicense, and/or
29f126890aSEmmanuel Vadot *     sell copies of the Software, and to permit persons to whom the
30f126890aSEmmanuel Vadot *     Software is furnished to do so, subject to the following
31f126890aSEmmanuel Vadot *     conditions:
32f126890aSEmmanuel Vadot *
33f126890aSEmmanuel Vadot *     The above copyright notice and this permission notice shall be
34f126890aSEmmanuel Vadot *     included in all copies or substantial portions of the Software.
35f126890aSEmmanuel Vadot *
36f126890aSEmmanuel Vadot *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37f126890aSEmmanuel Vadot *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
38f126890aSEmmanuel Vadot *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39f126890aSEmmanuel Vadot *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
40f126890aSEmmanuel Vadot *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41f126890aSEmmanuel Vadot *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42f126890aSEmmanuel Vadot *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
43f126890aSEmmanuel Vadot *     OTHER DEALINGS IN THE SOFTWARE.
44f126890aSEmmanuel Vadot */
45f126890aSEmmanuel Vadot
46f126890aSEmmanuel Vadot/dts-v1/;
47f126890aSEmmanuel Vadot#include "sun5i-r8.dtsi"
48f126890aSEmmanuel Vadot#include "sunxi-common-regulators.dtsi"
49f126890aSEmmanuel Vadot
50f126890aSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h>
51f126890aSEmmanuel Vadot#include <dt-bindings/interrupt-controller/irq.h>
52f126890aSEmmanuel Vadot
53f126890aSEmmanuel Vadot/ {
54f126890aSEmmanuel Vadot	model = "NextThing C.H.I.P.";
55f126890aSEmmanuel Vadot	compatible = "nextthing,chip", "allwinner,sun5i-r8", "allwinner,sun5i-a13";
56f126890aSEmmanuel Vadot
57f126890aSEmmanuel Vadot	aliases {
58f126890aSEmmanuel Vadot		i2c0 = &i2c0;
59f126890aSEmmanuel Vadot		i2c1 = &i2c1;
60f126890aSEmmanuel Vadot		i2c2 = &i2c2;
61f126890aSEmmanuel Vadot		serial0 = &uart1;
62f126890aSEmmanuel Vadot		serial1 = &uart3;
63f126890aSEmmanuel Vadot		spi0 = &spi2;
64f126890aSEmmanuel Vadot	};
65f126890aSEmmanuel Vadot
66f126890aSEmmanuel Vadot	chosen {
67f126890aSEmmanuel Vadot		stdout-path = "serial0:115200n8";
68f126890aSEmmanuel Vadot	};
69f126890aSEmmanuel Vadot
70f126890aSEmmanuel Vadot	leds {
71f126890aSEmmanuel Vadot		compatible = "gpio-leds";
72f126890aSEmmanuel Vadot
73f126890aSEmmanuel Vadot		led-0 {
74f126890aSEmmanuel Vadot			label = "chip:white:status";
75f126890aSEmmanuel Vadot			gpios = <&axp_gpio 2 GPIO_ACTIVE_HIGH>;
76f126890aSEmmanuel Vadot			default-state = "on";
77f126890aSEmmanuel Vadot		};
78f126890aSEmmanuel Vadot	};
79f126890aSEmmanuel Vadot
80*7d0873ebSEmmanuel Vadot	mmc0_pwrseq: pwrseq {
81f126890aSEmmanuel Vadot		compatible = "mmc-pwrseq-simple";
82f126890aSEmmanuel Vadot		reset-gpios = <&pio 2 19 GPIO_ACTIVE_LOW>; /* PC19 */
83f126890aSEmmanuel Vadot	};
84f126890aSEmmanuel Vadot
85f126890aSEmmanuel Vadot	onewire {
86f126890aSEmmanuel Vadot		compatible = "w1-gpio";
87f126890aSEmmanuel Vadot		gpios = <&pio 3 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PD2 */
88f126890aSEmmanuel Vadot	};
89f126890aSEmmanuel Vadot};
90f126890aSEmmanuel Vadot
91f126890aSEmmanuel Vadot&be0 {
92f126890aSEmmanuel Vadot	status = "okay";
93f126890aSEmmanuel Vadot};
94f126890aSEmmanuel Vadot
95f126890aSEmmanuel Vadot&codec {
96f126890aSEmmanuel Vadot	status = "okay";
97f126890aSEmmanuel Vadot};
98f126890aSEmmanuel Vadot
99f126890aSEmmanuel Vadot&cpu0 {
100f126890aSEmmanuel Vadot	cpu-supply = <&reg_dcdc2>;
101f126890aSEmmanuel Vadot};
102f126890aSEmmanuel Vadot
103f126890aSEmmanuel Vadot&ehci0 {
104f126890aSEmmanuel Vadot	status = "okay";
105f126890aSEmmanuel Vadot};
106f126890aSEmmanuel Vadot
107f126890aSEmmanuel Vadot&i2c0 {
108f126890aSEmmanuel Vadot	status = "okay";
109f126890aSEmmanuel Vadot
110f126890aSEmmanuel Vadot	axp209: pmic@34 {
111f126890aSEmmanuel Vadot		reg = <0x34>;
112f126890aSEmmanuel Vadot
113f126890aSEmmanuel Vadot		/*
114f126890aSEmmanuel Vadot		 * The interrupt is routed through the "External Fast
115f126890aSEmmanuel Vadot		 * Interrupt Request" pin (ball G13 of the module)
116f126890aSEmmanuel Vadot		 * directly to the main interrupt controller, without
117f126890aSEmmanuel Vadot		 * any other controller interfering.
118f126890aSEmmanuel Vadot		 */
119f126890aSEmmanuel Vadot		interrupts = <0>;
120f126890aSEmmanuel Vadot	};
121f126890aSEmmanuel Vadot};
122f126890aSEmmanuel Vadot
123f126890aSEmmanuel Vadot#include "axp209.dtsi"
124f126890aSEmmanuel Vadot
125f126890aSEmmanuel Vadot&ac_power_supply {
126f126890aSEmmanuel Vadot	status = "okay";
127f126890aSEmmanuel Vadot};
128f126890aSEmmanuel Vadot
129f126890aSEmmanuel Vadot&battery_power_supply {
130f126890aSEmmanuel Vadot	status = "okay";
131f126890aSEmmanuel Vadot};
132f126890aSEmmanuel Vadot
133f126890aSEmmanuel Vadot&i2c1 {
134f126890aSEmmanuel Vadot	status = "disabled";
135f126890aSEmmanuel Vadot};
136f126890aSEmmanuel Vadot
137f126890aSEmmanuel Vadot&i2c2 {
138f126890aSEmmanuel Vadot	status = "okay";
139f126890aSEmmanuel Vadot
140f126890aSEmmanuel Vadot	xio: gpio@38 {
141f126890aSEmmanuel Vadot		compatible = "nxp,pcf8574a";
142f126890aSEmmanuel Vadot		reg = <0x38>;
143f126890aSEmmanuel Vadot
144f126890aSEmmanuel Vadot		gpio-controller;
145f126890aSEmmanuel Vadot		#gpio-cells = <2>;
146f126890aSEmmanuel Vadot
147f126890aSEmmanuel Vadot		interrupt-parent = <&pio>;
148f126890aSEmmanuel Vadot		interrupts = <6 0 IRQ_TYPE_EDGE_FALLING>;
149f126890aSEmmanuel Vadot		interrupt-controller;
150f126890aSEmmanuel Vadot		#interrupt-cells = <2>;
151f126890aSEmmanuel Vadot	};
152f126890aSEmmanuel Vadot};
153f126890aSEmmanuel Vadot
154f126890aSEmmanuel Vadot&mmc0_pins {
155f126890aSEmmanuel Vadot	bias-pull-up;
156f126890aSEmmanuel Vadot};
157f126890aSEmmanuel Vadot
158f126890aSEmmanuel Vadot&mmc0 {
159f126890aSEmmanuel Vadot	vmmc-supply = <&reg_vcc3v3>;
160f126890aSEmmanuel Vadot	mmc-pwrseq = <&mmc0_pwrseq>;
161f126890aSEmmanuel Vadot	bus-width = <4>;
162f126890aSEmmanuel Vadot	non-removable;
163f126890aSEmmanuel Vadot	status = "okay";
164f126890aSEmmanuel Vadot};
165f126890aSEmmanuel Vadot
166f126890aSEmmanuel Vadot&ohci0 {
167f126890aSEmmanuel Vadot	status = "okay";
168f126890aSEmmanuel Vadot};
169f126890aSEmmanuel Vadot
170f126890aSEmmanuel Vadot&otg_sram {
171f126890aSEmmanuel Vadot	status = "okay";
172f126890aSEmmanuel Vadot};
173f126890aSEmmanuel Vadot
174f126890aSEmmanuel Vadot&reg_dcdc2 {
175f126890aSEmmanuel Vadot	regulator-min-microvolt = <1000000>;
176f126890aSEmmanuel Vadot	regulator-max-microvolt = <1400000>;
177f126890aSEmmanuel Vadot	regulator-name = "cpuvdd";
178f126890aSEmmanuel Vadot	regulator-always-on;
179f126890aSEmmanuel Vadot};
180f126890aSEmmanuel Vadot
181f126890aSEmmanuel Vadot&reg_dcdc3 {
182f126890aSEmmanuel Vadot	regulator-min-microvolt = <1000000>;
183f126890aSEmmanuel Vadot	regulator-max-microvolt = <1300000>;
184f126890aSEmmanuel Vadot	regulator-name = "corevdd";
185f126890aSEmmanuel Vadot	regulator-always-on;
186f126890aSEmmanuel Vadot};
187f126890aSEmmanuel Vadot
188f126890aSEmmanuel Vadot&reg_ldo1 {
189f126890aSEmmanuel Vadot	regulator-name = "rtcvdd";
190f126890aSEmmanuel Vadot};
191f126890aSEmmanuel Vadot
192f126890aSEmmanuel Vadot&reg_ldo2 {
193f126890aSEmmanuel Vadot	regulator-min-microvolt = <2700000>;
194f126890aSEmmanuel Vadot	regulator-max-microvolt = <3300000>;
195f126890aSEmmanuel Vadot	regulator-name = "avcc";
196f126890aSEmmanuel Vadot	regulator-always-on;
197f126890aSEmmanuel Vadot};
198f126890aSEmmanuel Vadot
199f126890aSEmmanuel Vadot/*
200f126890aSEmmanuel Vadot * Both LDO3 and LDO4 are used in parallel to power up the WiFi/BT
201f126890aSEmmanuel Vadot * Chip.
202f126890aSEmmanuel Vadot *
203f126890aSEmmanuel Vadot * If those are not enabled, the SDIO part will not enumerate, and
204f126890aSEmmanuel Vadot * since there's no way currently to pass DT infos to an SDIO device,
205f126890aSEmmanuel Vadot * we cannot really do better than this ugly hack for now.
206f126890aSEmmanuel Vadot */
207f126890aSEmmanuel Vadot&reg_ldo3 {
208f126890aSEmmanuel Vadot	regulator-min-microvolt = <3300000>;
209f126890aSEmmanuel Vadot	regulator-max-microvolt = <3300000>;
210f126890aSEmmanuel Vadot	regulator-name = "vcc-wifi-1";
211f126890aSEmmanuel Vadot	regulator-always-on;
212f126890aSEmmanuel Vadot};
213f126890aSEmmanuel Vadot
214f126890aSEmmanuel Vadot&reg_ldo4 {
215f126890aSEmmanuel Vadot	regulator-min-microvolt = <3300000>;
216f126890aSEmmanuel Vadot	regulator-max-microvolt = <3300000>;
217f126890aSEmmanuel Vadot	regulator-name = "vcc-wifi-2";
218f126890aSEmmanuel Vadot	regulator-always-on;
219f126890aSEmmanuel Vadot};
220f126890aSEmmanuel Vadot
221f126890aSEmmanuel Vadot&reg_ldo5 {
222f126890aSEmmanuel Vadot	regulator-min-microvolt = <1800000>;
223f126890aSEmmanuel Vadot	regulator-max-microvolt = <1800000>;
224f126890aSEmmanuel Vadot	regulator-name = "vcc-1v8";
225f126890aSEmmanuel Vadot};
226f126890aSEmmanuel Vadot
227f126890aSEmmanuel Vadot&reg_usb0_vbus {
228f126890aSEmmanuel Vadot	vin-supply = <&reg_vcc5v0>;
229f126890aSEmmanuel Vadot	gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
230f126890aSEmmanuel Vadot	status = "okay";
231f126890aSEmmanuel Vadot};
232f126890aSEmmanuel Vadot
233f126890aSEmmanuel Vadot&spi2 {
234f126890aSEmmanuel Vadot	pinctrl-names = "default";
235f126890aSEmmanuel Vadot	pinctrl-0 = <&spi2_pe_pins>;
236f126890aSEmmanuel Vadot	status = "disabled";
237f126890aSEmmanuel Vadot};
238f126890aSEmmanuel Vadot
239f126890aSEmmanuel Vadot&tcon0 {
240f126890aSEmmanuel Vadot	status = "okay";
241f126890aSEmmanuel Vadot};
242f126890aSEmmanuel Vadot
243f126890aSEmmanuel Vadot&tve0 {
244f126890aSEmmanuel Vadot	status = "okay";
245f126890aSEmmanuel Vadot};
246f126890aSEmmanuel Vadot
247f126890aSEmmanuel Vadot&uart1 {
248f126890aSEmmanuel Vadot	pinctrl-names = "default";
249f126890aSEmmanuel Vadot	pinctrl-0 = <&uart1_pg_pins>;
250f126890aSEmmanuel Vadot	status = "okay";
251f126890aSEmmanuel Vadot};
252f126890aSEmmanuel Vadot
253f126890aSEmmanuel Vadot&uart3 {
254f126890aSEmmanuel Vadot	pinctrl-names = "default";
255f126890aSEmmanuel Vadot	pinctrl-0 = <&uart3_pg_pins>,
256f126890aSEmmanuel Vadot		    <&uart3_cts_rts_pg_pins>;
257f126890aSEmmanuel Vadot	status = "okay";
258f126890aSEmmanuel Vadot
259f126890aSEmmanuel Vadot	bluetooth {
260f126890aSEmmanuel Vadot		compatible = "realtek,rtl8723bs-bt";
261f126890aSEmmanuel Vadot		device-wake-gpios = <&axp_gpio 3 GPIO_ACTIVE_HIGH>;
262f126890aSEmmanuel Vadot		host-wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
263f126890aSEmmanuel Vadot	};
264f126890aSEmmanuel Vadot};
265f126890aSEmmanuel Vadot
266f126890aSEmmanuel Vadot&usb_otg {
267f126890aSEmmanuel Vadot	dr_mode = "otg";
268f126890aSEmmanuel Vadot	status = "okay";
269f126890aSEmmanuel Vadot};
270f126890aSEmmanuel Vadot
271f126890aSEmmanuel Vadot&usb_power_supply {
272f126890aSEmmanuel Vadot	status = "okay";
273f126890aSEmmanuel Vadot};
274f126890aSEmmanuel Vadot
275f126890aSEmmanuel Vadot&usbphy {
276f126890aSEmmanuel Vadot	status = "okay";
277f126890aSEmmanuel Vadot
278f126890aSEmmanuel Vadot	usb0_id_det-gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
279f126890aSEmmanuel Vadot	usb0_vbus_power-supply = <&usb_power_supply>;
280f126890aSEmmanuel Vadot	usb0_vbus-supply = <&reg_usb0_vbus>;
281f126890aSEmmanuel Vadot	usb1_vbus-supply = <&reg_vcc5v0>;
282f126890aSEmmanuel Vadot};
283