1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2// Copyright (c) 2017 Icenowy Zheng <icenowy@aosc.io>
3
4/dts-v1/;
5
6#include "sun50i-h6.dtsi"
7
8#include <dt-bindings/gpio/gpio.h>
9
10/ {
11	model = "Pine H64 model A";
12	compatible = "pine64,pine-h64", "allwinner,sun50i-h6";
13
14	aliases {
15		ethernet0 = &emac;
16		serial0 = &uart0;
17	};
18
19	chosen {
20		stdout-path = "serial0:115200n8";
21	};
22
23	hdmi_connector: connector {
24		compatible = "hdmi-connector";
25		type = "a";
26		ddc-en-gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */
27
28		port {
29			hdmi_con_in: endpoint {
30				remote-endpoint = <&hdmi_out_con>;
31			};
32		};
33	};
34
35	leds {
36		compatible = "gpio-leds";
37
38		heartbeat {
39			label = "pine-h64:green:heartbeat";
40			gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
41		};
42
43		link {
44			label = "pine-h64:white:link";
45			gpios = <&r_pio 0 3 GPIO_ACTIVE_HIGH>; /* PL3 */
46		};
47
48		status {
49			label = "pine-h64:blue:status";
50			gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
51		};
52	};
53
54	reg_gmac_3v3: gmac-3v3 {
55		compatible = "regulator-fixed";
56		regulator-name = "vcc-gmac-3v3";
57		regulator-min-microvolt = <3300000>;
58		regulator-max-microvolt = <3300000>;
59		startup-delay-us = <100000>;
60		gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>;
61		enable-active-high;
62	};
63
64	reg_usb_vbus: vbus {
65		compatible = "regulator-fixed";
66		regulator-name = "usb-vbus";
67		regulator-min-microvolt = <5000000>;
68		regulator-max-microvolt = <5000000>;
69		startup-delay-us = <100000>;
70		gpio = <&r_pio 0 5 GPIO_ACTIVE_HIGH>;
71		enable-active-high;
72	};
73};
74
75&emac {
76	pinctrl-names = "default";
77	pinctrl-0 = <&ext_rgmii_pins>;
78	phy-mode = "rgmii";
79	phy-handle = <&ext_rgmii_phy>;
80	phy-supply = <&reg_gmac_3v3>;
81	allwinner,rx-delay-ps = <200>;
82	allwinner,tx-delay-ps = <200>;
83	status = "okay";
84};
85
86&mdio {
87	ext_rgmii_phy: ethernet-phy@1 {
88		compatible = "ethernet-phy-ieee802.3-c22";
89		reg = <1>;
90	};
91};
92
93&de {
94	status = "okay";
95};
96
97&gpu {
98	mali-supply = <&reg_dcdcc>;
99	status = "okay";
100};
101
102&hdmi {
103	status = "okay";
104};
105
106&hdmi_out {
107	hdmi_out_con: endpoint {
108		remote-endpoint = <&hdmi_con_in>;
109	};
110};
111
112&ehci0 {
113	status = "okay";
114};
115
116&ehci3 {
117	status = "okay";
118};
119
120&mmc0 {
121	vmmc-supply = <&reg_cldo1>;
122	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
123	bus-width = <4>;
124	status = "okay";
125};
126
127&mmc2 {
128	vmmc-supply = <&reg_cldo1>;
129	vqmmc-supply = <&reg_bldo2>;
130	non-removable;
131	cap-mmc-hw-reset;
132	bus-width = <8>;
133	status = "okay";
134};
135
136&ohci0 {
137	status = "okay";
138};
139
140&ohci3 {
141	status = "okay";
142};
143
144&pio {
145	vcc-pc-supply = <&reg_bldo2>;
146	vcc-pd-supply = <&reg_cldo1>;
147	vcc-pg-supply = <&reg_aldo1>;
148};
149
150&r_i2c {
151	status = "okay";
152
153	axp805: pmic@36 {
154		compatible = "x-powers,axp805", "x-powers,axp806";
155		reg = <0x36>;
156		interrupt-parent = <&r_intc>;
157		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
158		interrupt-controller;
159		#interrupt-cells = <1>;
160		x-powers,self-working-mode;
161
162		regulators {
163			reg_aldo1: aldo1 {
164				regulator-always-on;
165				regulator-min-microvolt = <3300000>;
166				regulator-max-microvolt = <3300000>;
167				regulator-name = "vcc-pl";
168			};
169
170			reg_aldo2: aldo2 {
171				regulator-min-microvolt = <3300000>;
172				regulator-max-microvolt = <3300000>;
173				regulator-name = "vcc-ac200";
174				regulator-enable-ramp-delay = <100000>;
175			};
176
177			reg_aldo3: aldo3 {
178				/* This regulator is connected with CLDO1 */
179				regulator-always-on;
180				regulator-min-microvolt = <3300000>;
181				regulator-max-microvolt = <3300000>;
182				regulator-name = "vcc-3v3-1";
183			};
184
185			reg_bldo1: bldo1 {
186				regulator-always-on;
187				regulator-min-microvolt = <1800000>;
188				regulator-max-microvolt = <1800000>;
189				regulator-name = "vcc-bias-pll";
190			};
191
192			reg_bldo2: bldo2 {
193				regulator-always-on;
194				regulator-min-microvolt = <1800000>;
195				regulator-max-microvolt = <1800000>;
196				regulator-name = "vcc-efuse-pcie-hdmi-io";
197			};
198
199			reg_bldo3: bldo3 {
200				regulator-always-on;
201				regulator-min-microvolt = <1800000>;
202				regulator-max-microvolt = <1800000>;
203				regulator-name = "vcc-dcxoio";
204			};
205
206			bldo4 {
207				/* unused */
208			};
209
210			reg_cldo1: cldo1 {
211				/* This regulator is connected with ALDO3 */
212				regulator-always-on;
213				regulator-min-microvolt = <3300000>;
214				regulator-max-microvolt = <3300000>;
215				regulator-name = "vcc-3v3-2";
216			};
217
218			reg_cldo2: cldo2 {
219				regulator-min-microvolt = <3300000>;
220				regulator-max-microvolt = <3300000>;
221				regulator-name = "vcc-wifi-1";
222			};
223
224			reg_cldo3: cldo3 {
225				regulator-min-microvolt = <3300000>;
226				regulator-max-microvolt = <3300000>;
227				regulator-name = "vcc-wifi-2";
228			};
229
230			reg_dcdca: dcdca {
231				regulator-always-on;
232				regulator-min-microvolt = <810000>;
233				regulator-max-microvolt = <1080000>;
234				regulator-name = "vdd-cpu";
235			};
236
237			reg_dcdcc: dcdcc {
238				regulator-enable-ramp-delay = <32000>;
239				regulator-min-microvolt = <810000>;
240				regulator-max-microvolt = <1080000>;
241				regulator-name = "vdd-gpu";
242			};
243
244			reg_dcdcd: dcdcd {
245				regulator-always-on;
246				regulator-min-microvolt = <960000>;
247				regulator-max-microvolt = <960000>;
248				regulator-name = "vdd-sys";
249			};
250
251			reg_dcdce: dcdce {
252				regulator-always-on;
253				regulator-min-microvolt = <1200000>;
254				regulator-max-microvolt = <1200000>;
255				regulator-name = "vcc-dram";
256			};
257
258			sw {
259				/* unused */
260			};
261		};
262	};
263
264	pcf8563: rtc@51 {
265		compatible = "nxp,pcf8563";
266		reg = <0x51>;
267		interrupt-parent = <&r_intc>;
268		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
269		#clock-cells = <0>;
270	};
271};
272
273&r_ir {
274	status = "okay";
275};
276
277&r_pio {
278	vcc-pm-supply = <&reg_aldo1>;
279};
280
281&uart0 {
282	pinctrl-names = "default";
283	pinctrl-0 = <&uart0_ph_pins>;
284	status = "okay";
285};
286
287&usb2otg {
288	dr_mode = "host";
289	status = "okay";
290};
291
292&usb2phy {
293	usb0_vbus-supply = <&reg_usb_vbus>;
294	usb3_vbus-supply = <&reg_usb_vbus>;
295	status = "okay";
296};
297