xref: /freebsd/sys/contrib/device-tree/src/arm/allwinner/sun8i-h3-orangepi-zero-plus2.dts (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1*f126890aSEmmanuel Vadot/*
2*f126890aSEmmanuel Vadot * Copyright (C) 2017 Jagan Teki <jteki@openedev.com>
3*f126890aSEmmanuel Vadot * Copyright (C) 2018 Diego Rondini <diego.rondini@kynetics.com>
4*f126890aSEmmanuel Vadot *
5*f126890aSEmmanuel Vadot * This file is dual-licensed: you can use it either under the terms
6*f126890aSEmmanuel Vadot * of the GPL or the X11 license, at your option. Note that this dual
7*f126890aSEmmanuel Vadot * licensing only applies to this file, and not this project as a
8*f126890aSEmmanuel Vadot * whole.
9*f126890aSEmmanuel Vadot *
10*f126890aSEmmanuel Vadot *  a) This file is free software; you can redistribute it and/or
11*f126890aSEmmanuel Vadot *     modify it under the terms of the GNU General Public License as
12*f126890aSEmmanuel Vadot *     published by the Free Software Foundation; either version 2 of the
13*f126890aSEmmanuel Vadot *     License, or (at your option) any later version.
14*f126890aSEmmanuel Vadot *
15*f126890aSEmmanuel Vadot *     This file is distributed in the hope that it will be useful,
16*f126890aSEmmanuel Vadot *     but WITHOUT ANY WARRANTY; without even the implied warranty of
17*f126890aSEmmanuel Vadot *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*f126890aSEmmanuel Vadot *     GNU General Public License for more details.
19*f126890aSEmmanuel Vadot *
20*f126890aSEmmanuel Vadot * Or, alternatively,
21*f126890aSEmmanuel Vadot *
22*f126890aSEmmanuel Vadot *  b) Permission is hereby granted, free of charge, to any person
23*f126890aSEmmanuel Vadot *     obtaining a copy of this software and associated documentation
24*f126890aSEmmanuel Vadot *     files (the "Software"), to deal in the Software without
25*f126890aSEmmanuel Vadot *     restriction, including without limitation the rights to use,
26*f126890aSEmmanuel Vadot *     copy, modify, merge, publish, distribute, sublicense, and/or
27*f126890aSEmmanuel Vadot *     sell copies of the Software, and to permit persons to whom the
28*f126890aSEmmanuel Vadot *     Software is furnished to do so, subject to the following
29*f126890aSEmmanuel Vadot *     conditions:
30*f126890aSEmmanuel Vadot *
31*f126890aSEmmanuel Vadot *     The above copyright notice and this permission notice shall be
32*f126890aSEmmanuel Vadot *     included in all copies or substantial portions of the Software.
33*f126890aSEmmanuel Vadot *
34*f126890aSEmmanuel Vadot *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35*f126890aSEmmanuel Vadot *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36*f126890aSEmmanuel Vadot *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37*f126890aSEmmanuel Vadot *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38*f126890aSEmmanuel Vadot *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39*f126890aSEmmanuel Vadot *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40*f126890aSEmmanuel Vadot *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41*f126890aSEmmanuel Vadot *     OTHER DEALINGS IN THE SOFTWARE.
42*f126890aSEmmanuel Vadot */
43*f126890aSEmmanuel Vadot
44*f126890aSEmmanuel Vadot/dts-v1/;
45*f126890aSEmmanuel Vadot
46*f126890aSEmmanuel Vadot#include "sun8i-h3.dtsi"
47*f126890aSEmmanuel Vadot
48*f126890aSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h>
49*f126890aSEmmanuel Vadot
50*f126890aSEmmanuel Vadot/ {
51*f126890aSEmmanuel Vadot	model = "OrangePi Zero Plus2 H3";
52*f126890aSEmmanuel Vadot	compatible = "xunlong,orangepi-zero-plus2-h3", "allwinner,sun8i-h3";
53*f126890aSEmmanuel Vadot
54*f126890aSEmmanuel Vadot	aliases {
55*f126890aSEmmanuel Vadot		serial0 = &uart0;
56*f126890aSEmmanuel Vadot	};
57*f126890aSEmmanuel Vadot
58*f126890aSEmmanuel Vadot	chosen {
59*f126890aSEmmanuel Vadot		stdout-path = "serial0:115200n8";
60*f126890aSEmmanuel Vadot	};
61*f126890aSEmmanuel Vadot
62*f126890aSEmmanuel Vadot	connector {
63*f126890aSEmmanuel Vadot		compatible = "hdmi-connector";
64*f126890aSEmmanuel Vadot		type = "a";
65*f126890aSEmmanuel Vadot
66*f126890aSEmmanuel Vadot		port {
67*f126890aSEmmanuel Vadot			hdmi_con_in: endpoint {
68*f126890aSEmmanuel Vadot				remote-endpoint = <&hdmi_out_con>;
69*f126890aSEmmanuel Vadot			};
70*f126890aSEmmanuel Vadot		};
71*f126890aSEmmanuel Vadot	};
72*f126890aSEmmanuel Vadot
73*f126890aSEmmanuel Vadot	leds {
74*f126890aSEmmanuel Vadot		compatible = "gpio-leds";
75*f126890aSEmmanuel Vadot
76*f126890aSEmmanuel Vadot		led-0 {
77*f126890aSEmmanuel Vadot			label = "orangepi:green:pwr";
78*f126890aSEmmanuel Vadot			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
79*f126890aSEmmanuel Vadot			default-state = "on";
80*f126890aSEmmanuel Vadot		};
81*f126890aSEmmanuel Vadot
82*f126890aSEmmanuel Vadot		led-1 {
83*f126890aSEmmanuel Vadot			label = "orangepi:red:status";
84*f126890aSEmmanuel Vadot			gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
85*f126890aSEmmanuel Vadot		};
86*f126890aSEmmanuel Vadot	};
87*f126890aSEmmanuel Vadot
88*f126890aSEmmanuel Vadot	reg_vcc3v3: vcc3v3 {
89*f126890aSEmmanuel Vadot		compatible = "regulator-fixed";
90*f126890aSEmmanuel Vadot		regulator-name = "vcc3v3";
91*f126890aSEmmanuel Vadot		regulator-min-microvolt = <3300000>;
92*f126890aSEmmanuel Vadot		regulator-max-microvolt = <3300000>;
93*f126890aSEmmanuel Vadot	};
94*f126890aSEmmanuel Vadot
95*f126890aSEmmanuel Vadot	wifi_pwrseq: wifi_pwrseq {
96*f126890aSEmmanuel Vadot		compatible = "mmc-pwrseq-simple";
97*f126890aSEmmanuel Vadot		reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
98*f126890aSEmmanuel Vadot		post-power-on-delay-ms = <200>;
99*f126890aSEmmanuel Vadot	};
100*f126890aSEmmanuel Vadot};
101*f126890aSEmmanuel Vadot
102*f126890aSEmmanuel Vadot&de {
103*f126890aSEmmanuel Vadot	status = "okay";
104*f126890aSEmmanuel Vadot};
105*f126890aSEmmanuel Vadot
106*f126890aSEmmanuel Vadot&ehci0 {
107*f126890aSEmmanuel Vadot	status = "okay";
108*f126890aSEmmanuel Vadot};
109*f126890aSEmmanuel Vadot
110*f126890aSEmmanuel Vadot&hdmi {
111*f126890aSEmmanuel Vadot	status = "okay";
112*f126890aSEmmanuel Vadot};
113*f126890aSEmmanuel Vadot
114*f126890aSEmmanuel Vadot&hdmi_out {
115*f126890aSEmmanuel Vadot	hdmi_out_con: endpoint {
116*f126890aSEmmanuel Vadot		remote-endpoint = <&hdmi_con_in>;
117*f126890aSEmmanuel Vadot	};
118*f126890aSEmmanuel Vadot};
119*f126890aSEmmanuel Vadot
120*f126890aSEmmanuel Vadot&mmc0 {
121*f126890aSEmmanuel Vadot	vmmc-supply = <&reg_vcc3v3>;
122*f126890aSEmmanuel Vadot	bus-width = <4>;
123*f126890aSEmmanuel Vadot	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
124*f126890aSEmmanuel Vadot	status = "okay";
125*f126890aSEmmanuel Vadot};
126*f126890aSEmmanuel Vadot
127*f126890aSEmmanuel Vadot&mmc1 {
128*f126890aSEmmanuel Vadot	vmmc-supply = <&reg_vcc3v3>;
129*f126890aSEmmanuel Vadot	vqmmc-supply = <&reg_vcc3v3>;
130*f126890aSEmmanuel Vadot	mmc-pwrseq = <&wifi_pwrseq>;
131*f126890aSEmmanuel Vadot	bus-width = <4>;
132*f126890aSEmmanuel Vadot	non-removable;
133*f126890aSEmmanuel Vadot	status = "okay";
134*f126890aSEmmanuel Vadot
135*f126890aSEmmanuel Vadot	brcmf: wifi@1 {
136*f126890aSEmmanuel Vadot		reg = <1>;
137*f126890aSEmmanuel Vadot		compatible = "brcm,bcm4329-fmac";
138*f126890aSEmmanuel Vadot		interrupt-parent = <&r_pio>;
139*f126890aSEmmanuel Vadot		interrupts = <0 7 IRQ_TYPE_LEVEL_LOW>;	/* PL7 */
140*f126890aSEmmanuel Vadot		interrupt-names = "host-wake";
141*f126890aSEmmanuel Vadot	};
142*f126890aSEmmanuel Vadot};
143*f126890aSEmmanuel Vadot
144*f126890aSEmmanuel Vadot&mmc2 {
145*f126890aSEmmanuel Vadot	pinctrl-names = "default";
146*f126890aSEmmanuel Vadot	pinctrl-0 = <&mmc2_8bit_pins>;
147*f126890aSEmmanuel Vadot	vmmc-supply = <&reg_vcc3v3>;
148*f126890aSEmmanuel Vadot	bus-width = <8>;
149*f126890aSEmmanuel Vadot	non-removable;
150*f126890aSEmmanuel Vadot	cap-mmc-hw-reset;
151*f126890aSEmmanuel Vadot	status = "okay";
152*f126890aSEmmanuel Vadot};
153*f126890aSEmmanuel Vadot
154*f126890aSEmmanuel Vadot&ohci0 {
155*f126890aSEmmanuel Vadot	status = "okay";
156*f126890aSEmmanuel Vadot};
157*f126890aSEmmanuel Vadot
158*f126890aSEmmanuel Vadot&uart0 {
159*f126890aSEmmanuel Vadot	pinctrl-names = "default";
160*f126890aSEmmanuel Vadot	pinctrl-0 = <&uart0_pa_pins>;
161*f126890aSEmmanuel Vadot	status = "okay";
162*f126890aSEmmanuel Vadot};
163*f126890aSEmmanuel Vadot
164*f126890aSEmmanuel Vadot&usb_otg {
165*f126890aSEmmanuel Vadot	/*
166*f126890aSEmmanuel Vadot	 * According to schematics CN1 MicroUSB port can be used to take
167*f126890aSEmmanuel Vadot	 * external 5V to power up the board VBUS. On the contrary CN1 MicroUSB
168*f126890aSEmmanuel Vadot	 * port cannot provide power externally even if the board is powered
169*f126890aSEmmanuel Vadot	 * via GPIO pins. It thus makes sense to force peripheral mode.
170*f126890aSEmmanuel Vadot	 */
171*f126890aSEmmanuel Vadot	dr_mode = "peripheral";
172*f126890aSEmmanuel Vadot	status = "okay";
173*f126890aSEmmanuel Vadot};
174*f126890aSEmmanuel Vadot
175*f126890aSEmmanuel Vadot&usbphy {
176*f126890aSEmmanuel Vadot	status = "okay";
177*f126890aSEmmanuel Vadot};
178