1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
4 *
5 * Based on sun50i-h5-orangepi-pc2.dts, which is:
6 *   Copyright (C) 2016 ARM Ltd.
7 */
8
9/dts-v1/;
10#include "sun50i-h5.dtsi"
11
12#include <dt-bindings/gpio/gpio.h>
13#include <dt-bindings/input/input.h>
14
15/ {
16	model = "Xunlong Orange Pi Prime";
17	compatible = "xunlong,orangepi-prime", "allwinner,sun50i-h5";
18
19	aliases {
20		ethernet0 = &emac;
21		serial0 = &uart0;
22	};
23
24	chosen {
25		stdout-path = "serial0:115200n8";
26	};
27
28	connector {
29		compatible = "hdmi-connector";
30		type = "a";
31
32		port {
33			hdmi_con_in: endpoint {
34				remote-endpoint = <&hdmi_out_con>;
35			};
36		};
37	};
38
39	leds {
40		compatible = "gpio-leds";
41
42		pwr {
43			label = "orangepi:green:pwr";
44			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
45			default-state = "on";
46		};
47
48		status {
49			label = "orangepi:red:status";
50			gpios = <&pio 0 20 GPIO_ACTIVE_HIGH>;
51		};
52	};
53
54	r-gpio-keys {
55		compatible = "gpio-keys";
56
57		sw4 {
58			label = "sw4";
59			linux,code = <BTN_0>;
60			gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
61		};
62	};
63
64	reg_gmac_3v3: gmac-3v3 {
65		compatible = "regulator-fixed";
66		regulator-name = "gmac-3v3";
67		regulator-min-microvolt = <3300000>;
68		regulator-max-microvolt = <3300000>;
69		startup-delay-us = <100000>;
70		enable-active-high;
71		gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
72	};
73
74	reg_vcc3v3: vcc3v3 {
75		compatible = "regulator-fixed";
76		regulator-name = "vcc3v3";
77		regulator-min-microvolt = <3300000>;
78		regulator-max-microvolt = <3300000>;
79	};
80
81	reg_usb0_vbus: usb0-vbus {
82		compatible = "regulator-fixed";
83		regulator-name = "usb0-vbus";
84		regulator-min-microvolt = <5000000>;
85		regulator-max-microvolt = <5000000>;
86		enable-active-high;
87		gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
88		status = "okay";
89	};
90
91	wifi_pwrseq: wifi_pwrseq {
92		compatible = "mmc-pwrseq-simple";
93		reset-gpios = <&pio 2 14 GPIO_ACTIVE_LOW>; /* PC14 */
94	};
95};
96
97&codec {
98	allwinner,audio-routing =
99		"Line Out", "LINEOUT",
100		"MIC1", "Mic",
101		"Mic",  "MBIAS";
102	status = "okay";
103};
104
105&de {
106	status = "okay";
107};
108
109&ehci0 {
110	status = "okay";
111};
112
113&ehci1 {
114	status = "okay";
115};
116
117&ehci2 {
118	status = "okay";
119};
120
121&ehci3 {
122	status = "okay";
123};
124
125&emac {
126	pinctrl-names = "default";
127	pinctrl-0 = <&emac_rgmii_pins>;
128	phy-supply = <&reg_gmac_3v3>;
129	phy-handle = <&ext_rgmii_phy>;
130	phy-mode = "rgmii";
131	status = "okay";
132};
133
134&external_mdio {
135	ext_rgmii_phy: ethernet-phy@1 {
136		compatible = "ethernet-phy-ieee802.3-c22";
137		reg = <1>;
138	};
139};
140
141&hdmi {
142	status = "okay";
143};
144
145&hdmi_out {
146	hdmi_out_con: endpoint {
147		remote-endpoint = <&hdmi_con_in>;
148	};
149};
150
151&ir {
152	pinctrl-names = "default";
153	pinctrl-0 = <&r_ir_rx_pin>;
154	status = "okay";
155};
156
157&mmc0 {
158	vmmc-supply = <&reg_vcc3v3>;
159	bus-width = <4>;
160	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
161	status = "okay";
162};
163
164&mmc1 {
165	vmmc-supply = <&reg_vcc3v3>;
166	mmc-pwrseq = <&wifi_pwrseq>;
167	bus-width = <4>;
168	non-removable;
169	status = "okay";
170};
171
172&ohci0 {
173	status = "okay";
174};
175
176&ohci1 {
177	status = "okay";
178};
179
180&ohci2 {
181	status = "okay";
182};
183
184&ohci3 {
185	status = "okay";
186};
187
188&uart0 {
189	pinctrl-names = "default";
190	pinctrl-0 = <&uart0_pa_pins>;
191	status = "okay";
192};
193
194&uart1 {
195	pinctrl-names = "default";
196	pinctrl-0 = <&uart1_pins>;
197	status = "disabled";
198};
199
200&uart2 {
201	pinctrl-names = "default";
202	pinctrl-0 = <&uart2_pins>;
203	status = "disabled";
204};
205
206&usb_otg {
207	dr_mode = "otg";
208	status = "okay";
209};
210
211&usbphy {
212	/* USB Type-A ports' VBUS is always on */
213	usb0_id_det-gpios = <&pio 0 21 GPIO_ACTIVE_HIGH>; /* PA21 */
214	usb0_vbus-supply = <&reg_usb0_vbus>;
215	status = "okay";
216};
217