1012af553SClément Péron// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2cabbaed7SClément Péron// Copyright (c) 2017 Icenowy Zheng <icenowy@aosc.io>
3494d8367SIcenowy Zheng
4494d8367SIcenowy Zheng/dts-v1/;
5494d8367SIcenowy Zheng
6494d8367SIcenowy Zheng#include "sun50i-h6.dtsi"
7494d8367SIcenowy Zheng
8494d8367SIcenowy Zheng#include <dt-bindings/gpio/gpio.h>
9494d8367SIcenowy Zheng
10494d8367SIcenowy Zheng/ {
1124e9f61cSCorentin Labbe	model = "Pine H64 model A";
12494d8367SIcenowy Zheng	compatible = "pine64,pine-h64", "allwinner,sun50i-h6";
13494d8367SIcenowy Zheng
14494d8367SIcenowy Zheng	aliases {
15729e1ffcSIcenowy Zheng		ethernet0 = &emac;
16494d8367SIcenowy Zheng		serial0 = &uart0;
17e757bdd0SAndre Przywara		spi0 = &spi0;
18494d8367SIcenowy Zheng	};
19494d8367SIcenowy Zheng
20494d8367SIcenowy Zheng	chosen {
21494d8367SIcenowy Zheng		stdout-path = "serial0:115200n8";
22494d8367SIcenowy Zheng	};
236677bbdeSChen-Yu Tsai
2424e9f61cSCorentin Labbe	hdmi_connector: connector {
257d5bca1cSJernej Skrabec		compatible = "hdmi-connector";
267d5bca1cSJernej Skrabec		type = "a";
2724e9f61cSCorentin Labbe		ddc-en-gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */
287d5bca1cSJernej Skrabec
297d5bca1cSJernej Skrabec		port {
307d5bca1cSJernej Skrabec			hdmi_con_in: endpoint {
317d5bca1cSJernej Skrabec				remote-endpoint = <&hdmi_out_con>;
327d5bca1cSJernej Skrabec			};
337d5bca1cSJernej Skrabec		};
347d5bca1cSJernej Skrabec	};
357d5bca1cSJernej Skrabec
366677bbdeSChen-Yu Tsai	leds {
376677bbdeSChen-Yu Tsai		compatible = "gpio-leds";
386677bbdeSChen-Yu Tsai
396677bbdeSChen-Yu Tsai		heartbeat {
406677bbdeSChen-Yu Tsai			label = "pine-h64:green:heartbeat";
416677bbdeSChen-Yu Tsai			gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
426677bbdeSChen-Yu Tsai		};
436677bbdeSChen-Yu Tsai
446677bbdeSChen-Yu Tsai		link {
456677bbdeSChen-Yu Tsai			label = "pine-h64:white:link";
466677bbdeSChen-Yu Tsai			gpios = <&r_pio 0 3 GPIO_ACTIVE_HIGH>; /* PL3 */
476677bbdeSChen-Yu Tsai		};
486677bbdeSChen-Yu Tsai
496677bbdeSChen-Yu Tsai		status {
506677bbdeSChen-Yu Tsai			label = "pine-h64:blue:status";
516677bbdeSChen-Yu Tsai			gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
526677bbdeSChen-Yu Tsai		};
536677bbdeSChen-Yu Tsai	};
5444eb589cSIcenowy Zheng
5524e9f61cSCorentin Labbe	reg_gmac_3v3: gmac-3v3 {
5624e9f61cSCorentin Labbe		compatible = "regulator-fixed";
5724e9f61cSCorentin Labbe		regulator-name = "vcc-gmac-3v3";
5824e9f61cSCorentin Labbe		regulator-min-microvolt = <3300000>;
5924e9f61cSCorentin Labbe		regulator-max-microvolt = <3300000>;
6024e9f61cSCorentin Labbe		startup-delay-us = <100000>;
6124e9f61cSCorentin Labbe		gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>;
6224e9f61cSCorentin Labbe		enable-active-high;
6324e9f61cSCorentin Labbe	};
6424e9f61cSCorentin Labbe
6544eb589cSIcenowy Zheng	reg_usb_vbus: vbus {
6644eb589cSIcenowy Zheng		compatible = "regulator-fixed";
6744eb589cSIcenowy Zheng		regulator-name = "usb-vbus";
6844eb589cSIcenowy Zheng		regulator-min-microvolt = <5000000>;
6944eb589cSIcenowy Zheng		regulator-max-microvolt = <5000000>;
7044eb589cSIcenowy Zheng		startup-delay-us = <100000>;
7144eb589cSIcenowy Zheng		gpio = <&r_pio 0 5 GPIO_ACTIVE_HIGH>;
7244eb589cSIcenowy Zheng		enable-active-high;
7344eb589cSIcenowy Zheng	};
74494d8367SIcenowy Zheng};
75494d8367SIcenowy Zheng
76729e1ffcSIcenowy Zheng&emac {
77729e1ffcSIcenowy Zheng	pinctrl-names = "default";
78729e1ffcSIcenowy Zheng	pinctrl-0 = <&ext_rgmii_pins>;
79729e1ffcSIcenowy Zheng	phy-mode = "rgmii";
80729e1ffcSIcenowy Zheng	phy-handle = <&ext_rgmii_phy>;
8124e9f61cSCorentin Labbe	phy-supply = <&reg_gmac_3v3>;
82729e1ffcSIcenowy Zheng	allwinner,rx-delay-ps = <200>;
83729e1ffcSIcenowy Zheng	allwinner,tx-delay-ps = <200>;
84729e1ffcSIcenowy Zheng	status = "okay";
85729e1ffcSIcenowy Zheng};
86729e1ffcSIcenowy Zheng
87729e1ffcSIcenowy Zheng&mdio {
88729e1ffcSIcenowy Zheng	ext_rgmii_phy: ethernet-phy@1 {
89729e1ffcSIcenowy Zheng		compatible = "ethernet-phy-ieee802.3-c22";
90729e1ffcSIcenowy Zheng		reg = <1>;
91729e1ffcSIcenowy Zheng	};
92729e1ffcSIcenowy Zheng};
93729e1ffcSIcenowy Zheng
947d5bca1cSJernej Skrabec&de {
957d5bca1cSJernej Skrabec	status = "okay";
967d5bca1cSJernej Skrabec};
977d5bca1cSJernej Skrabec
988abc4c4aSClément Péron&gpu {
998abc4c4aSClément Péron	mali-supply = <&reg_dcdcc>;
1008abc4c4aSClément Péron	status = "okay";
1018abc4c4aSClément Péron};
1028abc4c4aSClément Péron
1037d5bca1cSJernej Skrabec&hdmi {
1047d5bca1cSJernej Skrabec	status = "okay";
1057d5bca1cSJernej Skrabec};
1067d5bca1cSJernej Skrabec
1077d5bca1cSJernej Skrabec&hdmi_out {
1087d5bca1cSJernej Skrabec	hdmi_out_con: endpoint {
1097d5bca1cSJernej Skrabec		remote-endpoint = <&hdmi_con_in>;
1107d5bca1cSJernej Skrabec	};
1117d5bca1cSJernej Skrabec};
1127d5bca1cSJernej Skrabec
1133bfa011dSIcenowy Zheng&ehci0 {
1143bfa011dSIcenowy Zheng	status = "okay";
1153bfa011dSIcenowy Zheng};
1163bfa011dSIcenowy Zheng
1173bfa011dSIcenowy Zheng&ehci3 {
1183bfa011dSIcenowy Zheng	status = "okay";
1193bfa011dSIcenowy Zheng};
1203bfa011dSIcenowy Zheng
121ecbd6118SIcenowy Zheng&mmc0 {
122ecbd6118SIcenowy Zheng	vmmc-supply = <&reg_cldo1>;
123ecbd6118SIcenowy Zheng	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
124d177c8b6SIcenowy Zheng	bus-width = <4>;
125ecbd6118SIcenowy Zheng	status = "okay";
126ecbd6118SIcenowy Zheng};
127ecbd6118SIcenowy Zheng
128ecbd6118SIcenowy Zheng&mmc2 {
129ecbd6118SIcenowy Zheng	vmmc-supply = <&reg_cldo1>;
130ecbd6118SIcenowy Zheng	vqmmc-supply = <&reg_bldo2>;
131ecbd6118SIcenowy Zheng	non-removable;
132ecbd6118SIcenowy Zheng	cap-mmc-hw-reset;
133d177c8b6SIcenowy Zheng	bus-width = <8>;
134ecbd6118SIcenowy Zheng	status = "okay";
135ecbd6118SIcenowy Zheng};
136ecbd6118SIcenowy Zheng
1373bfa011dSIcenowy Zheng&ohci0 {
1383bfa011dSIcenowy Zheng	status = "okay";
1393bfa011dSIcenowy Zheng};
1403bfa011dSIcenowy Zheng
1413bfa011dSIcenowy Zheng&ohci3 {
1423bfa011dSIcenowy Zheng	status = "okay";
1433bfa011dSIcenowy Zheng};
1443bfa011dSIcenowy Zheng
14522538576SIcenowy Zheng&pio {
14622538576SIcenowy Zheng	vcc-pc-supply = <&reg_bldo2>;
14722538576SIcenowy Zheng	vcc-pd-supply = <&reg_cldo1>;
14822538576SIcenowy Zheng	vcc-pg-supply = <&reg_aldo1>;
14922538576SIcenowy Zheng};
15022538576SIcenowy Zheng
15117ebc33aSIcenowy Zheng&r_i2c {
15217ebc33aSIcenowy Zheng	status = "okay";
15317ebc33aSIcenowy Zheng
154eb28fb9eSIcenowy Zheng	axp805: pmic@36 {
155eb28fb9eSIcenowy Zheng		compatible = "x-powers,axp805", "x-powers,axp806";
156eb28fb9eSIcenowy Zheng		reg = <0x36>;
157eb28fb9eSIcenowy Zheng		interrupt-parent = <&r_intc>;
158eb28fb9eSIcenowy Zheng		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
159eb28fb9eSIcenowy Zheng		interrupt-controller;
160eb28fb9eSIcenowy Zheng		#interrupt-cells = <1>;
161eb28fb9eSIcenowy Zheng		x-powers,self-working-mode;
162eb28fb9eSIcenowy Zheng
163eb28fb9eSIcenowy Zheng		regulators {
164eb28fb9eSIcenowy Zheng			reg_aldo1: aldo1 {
165eb28fb9eSIcenowy Zheng				regulator-always-on;
166eb28fb9eSIcenowy Zheng				regulator-min-microvolt = <3300000>;
167eb28fb9eSIcenowy Zheng				regulator-max-microvolt = <3300000>;
168eb28fb9eSIcenowy Zheng				regulator-name = "vcc-pl";
169eb28fb9eSIcenowy Zheng			};
170eb28fb9eSIcenowy Zheng
171eb28fb9eSIcenowy Zheng			reg_aldo2: aldo2 {
172eb28fb9eSIcenowy Zheng				regulator-min-microvolt = <3300000>;
173eb28fb9eSIcenowy Zheng				regulator-max-microvolt = <3300000>;
174eb28fb9eSIcenowy Zheng				regulator-name = "vcc-ac200";
175729e1ffcSIcenowy Zheng				regulator-enable-ramp-delay = <100000>;
176eb28fb9eSIcenowy Zheng			};
177eb28fb9eSIcenowy Zheng
178eb28fb9eSIcenowy Zheng			reg_aldo3: aldo3 {
179eb28fb9eSIcenowy Zheng				/* This regulator is connected with CLDO1 */
180eb28fb9eSIcenowy Zheng				regulator-always-on;
181eb28fb9eSIcenowy Zheng				regulator-min-microvolt = <3300000>;
182eb28fb9eSIcenowy Zheng				regulator-max-microvolt = <3300000>;
183eb28fb9eSIcenowy Zheng				regulator-name = "vcc-3v3-1";
184eb28fb9eSIcenowy Zheng			};
185eb28fb9eSIcenowy Zheng
186eb28fb9eSIcenowy Zheng			reg_bldo1: bldo1 {
187eb28fb9eSIcenowy Zheng				regulator-always-on;
188eb28fb9eSIcenowy Zheng				regulator-min-microvolt = <1800000>;
189eb28fb9eSIcenowy Zheng				regulator-max-microvolt = <1800000>;
190eb28fb9eSIcenowy Zheng				regulator-name = "vcc-bias-pll";
191eb28fb9eSIcenowy Zheng			};
192eb28fb9eSIcenowy Zheng
193eb28fb9eSIcenowy Zheng			reg_bldo2: bldo2 {
194eb28fb9eSIcenowy Zheng				regulator-always-on;
195eb28fb9eSIcenowy Zheng				regulator-min-microvolt = <1800000>;
196eb28fb9eSIcenowy Zheng				regulator-max-microvolt = <1800000>;
197eb28fb9eSIcenowy Zheng				regulator-name = "vcc-efuse-pcie-hdmi-io";
198eb28fb9eSIcenowy Zheng			};
199eb28fb9eSIcenowy Zheng
200eb28fb9eSIcenowy Zheng			reg_bldo3: bldo3 {
201eb28fb9eSIcenowy Zheng				regulator-always-on;
202eb28fb9eSIcenowy Zheng				regulator-min-microvolt = <1800000>;
203eb28fb9eSIcenowy Zheng				regulator-max-microvolt = <1800000>;
204eb28fb9eSIcenowy Zheng				regulator-name = "vcc-dcxoio";
205eb28fb9eSIcenowy Zheng			};
206eb28fb9eSIcenowy Zheng
207eb28fb9eSIcenowy Zheng			bldo4 {
208eb28fb9eSIcenowy Zheng				/* unused */
209eb28fb9eSIcenowy Zheng			};
210eb28fb9eSIcenowy Zheng
211eb28fb9eSIcenowy Zheng			reg_cldo1: cldo1 {
212eb28fb9eSIcenowy Zheng				/* This regulator is connected with ALDO3 */
213eb28fb9eSIcenowy Zheng				regulator-always-on;
214eb28fb9eSIcenowy Zheng				regulator-min-microvolt = <3300000>;
215eb28fb9eSIcenowy Zheng				regulator-max-microvolt = <3300000>;
216eb28fb9eSIcenowy Zheng				regulator-name = "vcc-3v3-2";
217eb28fb9eSIcenowy Zheng			};
218eb28fb9eSIcenowy Zheng
219eb28fb9eSIcenowy Zheng			reg_cldo2: cldo2 {
220eb28fb9eSIcenowy Zheng				regulator-min-microvolt = <3300000>;
221eb28fb9eSIcenowy Zheng				regulator-max-microvolt = <3300000>;
222eb28fb9eSIcenowy Zheng				regulator-name = "vcc-wifi-1";
223eb28fb9eSIcenowy Zheng			};
224eb28fb9eSIcenowy Zheng
225eb28fb9eSIcenowy Zheng			reg_cldo3: cldo3 {
226eb28fb9eSIcenowy Zheng				regulator-min-microvolt = <3300000>;
227eb28fb9eSIcenowy Zheng				regulator-max-microvolt = <3300000>;
228eb28fb9eSIcenowy Zheng				regulator-name = "vcc-wifi-2";
229eb28fb9eSIcenowy Zheng			};
230eb28fb9eSIcenowy Zheng
231eb28fb9eSIcenowy Zheng			reg_dcdca: dcdca {
232eb28fb9eSIcenowy Zheng				regulator-always-on;
233eb28fb9eSIcenowy Zheng				regulator-min-microvolt = <810000>;
234eb28fb9eSIcenowy Zheng				regulator-max-microvolt = <1080000>;
235eb28fb9eSIcenowy Zheng				regulator-name = "vdd-cpu";
236eb28fb9eSIcenowy Zheng			};
237eb28fb9eSIcenowy Zheng
238eb28fb9eSIcenowy Zheng			reg_dcdcc: dcdcc {
2398abc4c4aSClément Péron				regulator-enable-ramp-delay = <32000>;
240eb28fb9eSIcenowy Zheng				regulator-min-microvolt = <810000>;
241eb28fb9eSIcenowy Zheng				regulator-max-microvolt = <1080000>;
242eb28fb9eSIcenowy Zheng				regulator-name = "vdd-gpu";
243eb28fb9eSIcenowy Zheng			};
244eb28fb9eSIcenowy Zheng
245eb28fb9eSIcenowy Zheng			reg_dcdcd: dcdcd {
246eb28fb9eSIcenowy Zheng				regulator-always-on;
247eb28fb9eSIcenowy Zheng				regulator-min-microvolt = <960000>;
248eb28fb9eSIcenowy Zheng				regulator-max-microvolt = <960000>;
249eb28fb9eSIcenowy Zheng				regulator-name = "vdd-sys";
250eb28fb9eSIcenowy Zheng			};
251eb28fb9eSIcenowy Zheng
252eb28fb9eSIcenowy Zheng			reg_dcdce: dcdce {
253eb28fb9eSIcenowy Zheng				regulator-always-on;
254eb28fb9eSIcenowy Zheng				regulator-min-microvolt = <1200000>;
255eb28fb9eSIcenowy Zheng				regulator-max-microvolt = <1200000>;
256eb28fb9eSIcenowy Zheng				regulator-name = "vcc-dram";
257eb28fb9eSIcenowy Zheng			};
258eb28fb9eSIcenowy Zheng
259eb28fb9eSIcenowy Zheng			sw {
260eb28fb9eSIcenowy Zheng				/* unused */
261eb28fb9eSIcenowy Zheng			};
262eb28fb9eSIcenowy Zheng		};
263eb28fb9eSIcenowy Zheng	};
264eb28fb9eSIcenowy Zheng
26517ebc33aSIcenowy Zheng	pcf8563: rtc@51 {
26617ebc33aSIcenowy Zheng		compatible = "nxp,pcf8563";
26717ebc33aSIcenowy Zheng		reg = <0x51>;
2680bb9d187SChen-Yu Tsai		interrupt-parent = <&r_intc>;
2690bb9d187SChen-Yu Tsai		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
27017ebc33aSIcenowy Zheng		#clock-cells = <0>;
27117ebc33aSIcenowy Zheng	};
27217ebc33aSIcenowy Zheng};
27317ebc33aSIcenowy Zheng
27486be7408SClément Péron&r_ir {
27586be7408SClément Péron	status = "okay";
27686be7408SClément Péron};
27786be7408SClément Péron
27822538576SIcenowy Zheng&r_pio {
27922538576SIcenowy Zheng	vcc-pm-supply = <&reg_aldo1>;
28022538576SIcenowy Zheng};
28122538576SIcenowy Zheng
282e757bdd0SAndre Przywara/*
283e757bdd0SAndre Przywara * The CS pin is shared with the MMC2 CMD pin, so we cannot have the SPI
284e757bdd0SAndre Przywara * flash and eMMC at the same time, as one of them would fail probing.
285e757bdd0SAndre Przywara * Disable SPI0 in here, to prefer the more useful eMMC. U-Boot can
286e757bdd0SAndre Przywara * fix this up in no eMMC is connected.
287e757bdd0SAndre Przywara */
288e757bdd0SAndre Przywara&spi0 {
289e757bdd0SAndre Przywara	pinctrl-0 = <&spi0_pins>, <&spi0_cs_pin>;
290e757bdd0SAndre Przywara	pinctrl-names = "default";
291e757bdd0SAndre Przywara	status = "disabled";
292e757bdd0SAndre Przywara
293e757bdd0SAndre Przywara	flash@0 {
294e757bdd0SAndre Przywara		compatible = "winbond,w25q128", "jedec,spi-nor";
295e757bdd0SAndre Przywara		reg = <0>;
296e757bdd0SAndre Przywara		spi-max-frequency = <4000000>;
297e757bdd0SAndre Przywara	};
298e757bdd0SAndre Przywara};
299e757bdd0SAndre Przywara
300494d8367SIcenowy Zheng&uart0 {
301494d8367SIcenowy Zheng	pinctrl-names = "default";
302494d8367SIcenowy Zheng	pinctrl-0 = <&uart0_ph_pins>;
303494d8367SIcenowy Zheng	status = "okay";
304494d8367SIcenowy Zheng};
3053bfa011dSIcenowy Zheng
3063bfa011dSIcenowy Zheng&usb2otg {
3073bfa011dSIcenowy Zheng	dr_mode = "host";
3083bfa011dSIcenowy Zheng	status = "okay";
3093bfa011dSIcenowy Zheng};
3103bfa011dSIcenowy Zheng
3113bfa011dSIcenowy Zheng&usb2phy {
3123bfa011dSIcenowy Zheng	usb0_vbus-supply = <&reg_usb_vbus>;
3133bfa011dSIcenowy Zheng	usb3_vbus-supply = <&reg_usb_vbus>;
3143bfa011dSIcenowy Zheng	status = "okay";
3153bfa011dSIcenowy Zheng};
316