1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2017 Chen-Yu Tsai <wens@csie.org>
4 */
5
6/dts-v1/;
7#include "sun8i-h3.dtsi"
8
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/input/input.h>
11
12/ {
13	model = "Libre Computer Board ALL-H3-CC H3";
14	compatible = "libretech,all-h3-cc-h3", "allwinner,sun8i-h3";
15
16	aliases {
17		ethernet0 = &emac;
18		serial0 = &uart0;
19	};
20
21	chosen {
22		stdout-path = "serial0:115200n8";
23	};
24
25	leds {
26		compatible = "gpio-leds";
27
28		pwr_led {
29			label = "librecomputer:green:pwr";
30			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
31			default-state = "on";
32		};
33
34		status_led {
35			label = "librecomputer:blue:status";
36			gpios = <&pio 0 7 GPIO_ACTIVE_HIGH>; /* PA7 */
37		};
38	};
39
40	gpio_keys {
41		compatible = "gpio-keys";
42
43		power {
44			label = "power";
45			linux,code = <KEY_POWER>;
46			gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
47		};
48	};
49
50	reg_vcc1v2: vcc1v2 {
51		compatible = "regulator-fixed";
52		regulator-name = "vcc1v2";
53		regulator-min-microvolt = <3300000>;
54		regulator-max-microvolt = <3300000>;
55		regulator-always-on;
56		regulator-boot-on;
57		vin-supply = <&reg_vcc5v0>;
58		gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
59		enable-active-high;
60	};
61
62	reg_vcc3v3: vcc3v3 {
63		compatible = "regulator-fixed";
64		regulator-name = "vcc3v3";
65		regulator-min-microvolt = <3300000>;
66		regulator-max-microvolt = <3300000>;
67		vin-supply = <&reg_vcc5v0>;
68	};
69
70	/* This represents the board's 5V input */
71	reg_vcc5v0: vcc5v0 {
72		compatible = "regulator-fixed";
73		regulator-name = "vcc5v0";
74		regulator-min-microvolt = <5000000>;
75		regulator-max-microvolt = <5000000>;
76	};
77
78	reg_vcc_dram: vcc-dram {
79		compatible = "regulator-fixed";
80		regulator-name = "vcc-dram";
81		regulator-min-microvolt = <1500000>;
82		regulator-max-microvolt = <1500000>;
83		regulator-always-on;
84		regulator-boot-on;
85		vin-supply = <&reg_vcc5v0>;
86		gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
87		enable-active-high;
88	};
89
90	reg_vcc_io: vcc-io {
91		compatible = "regulator-fixed";
92		regulator-name = "vcc-io";
93		regulator-min-microvolt = <3300000>;
94		regulator-max-microvolt = <3300000>;
95		regulator-always-on;
96		regulator-boot-on;
97		vin-supply = <&reg_vcc3v3>;
98		gpio = <&r_pio 0 5 GPIO_ACTIVE_LOW>; /* PL5 */
99	};
100
101	reg_vdd_cpux: vdd-cpux {
102		compatible = "regulator-fixed";
103		regulator-name = "vdd-cpux";
104		regulator-min-microvolt = <3300000>;
105		regulator-max-microvolt = <3300000>;
106		regulator-always-on;
107		regulator-boot-on;
108		vin-supply = <&reg_vcc5v0>;
109		gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
110		enable-active-high;
111	};
112};
113
114&ehci1 {
115	status = "okay";
116};
117
118&ehci2 {
119	status = "okay";
120};
121
122&ehci3 {
123	status = "okay";
124};
125
126&emac {
127	phy-handle = <&int_mii_phy>;
128	phy-mode = "mii";
129	allwinner,leds-active-low;
130	status = "okay";
131};
132
133&ir {
134	pinctrl-names = "default";
135	pinctrl-0 = <&ir_pins_a>;
136	status = "okay";
137};
138
139&mmc0 {
140	pinctrl-names = "default";
141	pinctrl-0 = <&mmc0_pins_a>;
142	vmmc-supply = <&reg_vcc_io>;
143	bus-width = <4>;
144	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
145	cd-inverted;
146	status = "okay";
147};
148
149&ohci1 {
150	status = "okay";
151};
152
153&ohci2 {
154	status = "okay";
155};
156
157&ohci3 {
158	status = "okay";
159};
160
161&uart0 {
162	pinctrl-names = "default";
163	pinctrl-0 = <&uart0_pins_a>;
164	status = "okay";
165};
166
167&usbphy {
168	/* VBUS on USB ports are always on */
169	usb0_vbus-supply = <&reg_vcc5v0>;
170	usb1_vbus-supply = <&reg_vcc5v0>;
171	usb2_vbus-supply = <&reg_vcc5v0>;
172	usb3_vbus-supply = <&reg_vcc5v0>;
173	status = "okay";
174};
175