1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2017 Chen-Yu Tsai <wens@csie.org>
4 */
5
6#include <dt-bindings/gpio/gpio.h>
7#include <dt-bindings/input/input.h>
8
9/ {
10	aliases {
11		ethernet0 = &emac;
12		serial0 = &uart0;
13	};
14
15	chosen {
16		stdout-path = "serial0:115200n8";
17	};
18
19	connector {
20		compatible = "hdmi-connector";
21		type = "a";
22
23		port {
24			hdmi_con_in: endpoint {
25				remote-endpoint = <&hdmi_out_con>;
26			};
27		};
28	};
29
30	leds {
31		compatible = "gpio-leds";
32
33		pwr_led {
34			label = "librecomputer:green:pwr";
35			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
36			default-state = "on";
37		};
38
39		status_led {
40			label = "librecomputer:blue:status";
41			gpios = <&pio 0 7 GPIO_ACTIVE_HIGH>; /* PA7 */
42		};
43	};
44
45	gpio_keys {
46		compatible = "gpio-keys";
47
48		power {
49			label = "power";
50			linux,code = <KEY_POWER>;
51			gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
52		};
53	};
54
55	reg_vcc1v2: vcc1v2 {
56		compatible = "regulator-fixed";
57		regulator-name = "vcc1v2";
58		regulator-min-microvolt = <1200000>;
59		regulator-max-microvolt = <1200000>;
60		regulator-always-on;
61		regulator-boot-on;
62		vin-supply = <&reg_vcc5v0>;
63		gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
64		enable-active-high;
65	};
66
67	reg_vcc3v3: vcc3v3 {
68		compatible = "regulator-fixed";
69		regulator-name = "vcc3v3";
70		regulator-min-microvolt = <3300000>;
71		regulator-max-microvolt = <3300000>;
72		vin-supply = <&reg_vcc5v0>;
73	};
74
75	/* This represents the board's 5V input */
76	reg_vcc5v0: vcc5v0 {
77		compatible = "regulator-fixed";
78		regulator-name = "vcc5v0";
79		regulator-min-microvolt = <5000000>;
80		regulator-max-microvolt = <5000000>;
81	};
82
83	reg_vcc_dram: vcc-dram {
84		compatible = "regulator-fixed";
85		regulator-name = "vcc-dram";
86		regulator-min-microvolt = <1500000>;
87		regulator-max-microvolt = <1500000>;
88		regulator-always-on;
89		regulator-boot-on;
90		vin-supply = <&reg_vcc5v0>;
91		gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
92		enable-active-high;
93	};
94
95	reg_vcc_io: vcc-io {
96		compatible = "regulator-fixed";
97		regulator-name = "vcc-io";
98		regulator-min-microvolt = <3300000>;
99		regulator-max-microvolt = <3300000>;
100		regulator-always-on;
101		regulator-boot-on;
102		vin-supply = <&reg_vcc3v3>;
103		gpio = <&r_pio 0 5 GPIO_ACTIVE_LOW>; /* PL5 */
104	};
105
106	reg_vdd_cpux: vdd-cpux {
107		compatible = "regulator-fixed";
108		regulator-name = "vdd-cpux";
109		regulator-min-microvolt = <1200000>;
110		regulator-max-microvolt = <1200000>;
111		regulator-always-on;
112		regulator-boot-on;
113		vin-supply = <&reg_vcc5v0>;
114		gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
115		enable-active-high;
116	};
117};
118
119&codec {
120	allwinner,audio-routing =
121		"Line Out", "LINEOUT",
122		"MIC1", "Mic",
123		"Mic",  "MBIAS";
124	status = "okay";
125};
126
127&cpu0 {
128	cpu-supply = <&reg_vdd_cpux>;
129};
130
131&cpu1 {
132	cpu-supply = <&reg_vdd_cpux>;
133};
134
135&cpu2 {
136	cpu-supply = <&reg_vdd_cpux>;
137};
138
139&cpu3 {
140	cpu-supply = <&reg_vdd_cpux>;
141};
142
143&de {
144	status = "okay";
145};
146
147&ehci0 {
148	status = "okay";
149};
150
151&ehci1 {
152	status = "okay";
153};
154
155&ehci2 {
156	status = "okay";
157};
158
159&ehci3 {
160	status = "okay";
161};
162
163&emac {
164	phy-handle = <&int_mii_phy>;
165	phy-mode = "mii";
166	allwinner,leds-active-low;
167	status = "okay";
168};
169
170&hdmi {
171	status = "okay";
172};
173
174&hdmi_out {
175	hdmi_out_con: endpoint {
176		remote-endpoint = <&hdmi_con_in>;
177	};
178};
179
180&ir {
181	pinctrl-names = "default";
182	pinctrl-0 = <&r_ir_rx_pin>;
183	status = "okay";
184};
185
186&mmc0 {
187	vmmc-supply = <&reg_vcc_io>;
188	bus-width = <4>;
189	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
190	status = "okay";
191};
192
193&mmc2 {
194	pinctrl-names = "default";
195	pinctrl-0 = <&mmc2_8bit_pins>;
196	vmmc-supply = <&reg_vcc_io>;
197	bus-width = <8>;
198	non-removable;
199	status = "okay";
200};
201
202&ohci0 {
203	status = "okay";
204};
205
206&ohci1 {
207	status = "okay";
208};
209
210&ohci2 {
211	status = "okay";
212};
213
214&ohci3 {
215	status = "okay";
216};
217
218&uart0 {
219	pinctrl-names = "default";
220	pinctrl-0 = <&uart0_pa_pins>;
221	status = "okay";
222};
223
224&usb_otg {
225	dr_mode = "host";
226	status = "okay";
227};
228
229&usbphy {
230	/* VBUS on USB ports are always on */
231	usb0_vbus-supply = <&reg_vcc5v0>;
232	usb1_vbus-supply = <&reg_vcc5v0>;
233	usb2_vbus-supply = <&reg_vcc5v0>;
234	usb3_vbus-supply = <&reg_vcc5v0>;
235	status = "okay";
236};
237