1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2// Copyright (C) 2019 Clément Péron <peron.clem@gmail.com>
3
4/dts-v1/;
5
6#include "sun50i-h6.dtsi"
7
8#include <dt-bindings/gpio/gpio.h>
9
10/ {
11	model = "Beelink GS1";
12	compatible = "azw,beelink-gs1", "allwinner,sun50i-h6";
13
14	aliases {
15		ethernet0 = &emac;
16		serial0 = &uart0;
17	};
18
19	chosen {
20		stdout-path = "serial0:115200n8";
21	};
22
23	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	ext_osc32k: ext_osc32k_clk {
36		#clock-cells = <0>;
37		compatible = "fixed-clock";
38		clock-frequency = <32768>;
39		clock-output-names = "ext_osc32k";
40	};
41
42	leds {
43		compatible = "gpio-leds";
44
45		power {
46			label = "beelink:white:power";
47			gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
48			default-state = "on";
49		};
50	};
51
52	reg_vcc5v: vcc5v {
53		/* board wide 5V supply directly from the DC jack */
54		compatible = "regulator-fixed";
55		regulator-name = "vcc-5v";
56		regulator-min-microvolt = <5000000>;
57		regulator-max-microvolt = <5000000>;
58		regulator-always-on;
59	};
60
61	sound-spdif {
62		compatible = "simple-audio-card";
63		simple-audio-card,name = "sun50i-h6-spdif";
64
65		simple-audio-card,cpu {
66			sound-dai = <&spdif>;
67		};
68
69		simple-audio-card,codec {
70			sound-dai = <&spdif_out>;
71		};
72	};
73
74	spdif_out: spdif-out {
75		#sound-dai-cells = <0>;
76		compatible = "linux,spdif-dit";
77	};
78};
79
80&de {
81	status = "okay";
82};
83
84&dwc3 {
85	status = "okay";
86};
87
88&ehci0 {
89	status = "okay";
90};
91
92&emac {
93	pinctrl-names = "default";
94	pinctrl-0 = <&ext_rgmii_pins>;
95	phy-mode = "rgmii";
96	phy-handle = <&ext_rgmii_phy>;
97	phy-supply = <&reg_aldo2>;
98	status = "okay";
99};
100
101&gpu {
102	mali-supply = <&reg_dcdcc>;
103	status = "okay";
104};
105
106&hdmi {
107	status = "okay";
108};
109
110&hdmi_out {
111	hdmi_out_con: endpoint {
112		remote-endpoint = <&hdmi_con_in>;
113	};
114};
115
116&mdio {
117	ext_rgmii_phy: ethernet-phy@1 {
118		compatible = "ethernet-phy-ieee802.3-c22";
119		reg = <1>;
120	};
121};
122
123&mmc0 {
124	vmmc-supply = <&reg_cldo1>;
125	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
126	bus-width = <4>;
127	status = "okay";
128};
129
130&mmc2 {
131	vmmc-supply = <&reg_cldo1>;
132	vqmmc-supply = <&reg_bldo2>;
133	non-removable;
134	cap-mmc-hw-reset;
135	bus-width = <8>;
136	status = "okay";
137};
138
139&ohci0 {
140	status = "okay";
141};
142
143&pio {
144	vcc-pd-supply = <&reg_cldo1>;
145	vcc-pg-supply = <&reg_aldo1>;
146};
147
148&r_i2c {
149	status = "okay";
150
151	axp805: pmic@36 {
152		compatible = "x-powers,axp805", "x-powers,axp806";
153		reg = <0x36>;
154		interrupt-parent = <&r_intc>;
155		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
156		interrupt-controller;
157		#interrupt-cells = <1>;
158		x-powers,self-working-mode;
159		vina-supply = <&reg_vcc5v>;
160		vinb-supply = <&reg_vcc5v>;
161		vinc-supply = <&reg_vcc5v>;
162		vind-supply = <&reg_vcc5v>;
163		vine-supply = <&reg_vcc5v>;
164		aldoin-supply = <&reg_vcc5v>;
165		bldoin-supply = <&reg_vcc5v>;
166		cldoin-supply = <&reg_vcc5v>;
167
168		regulators {
169			reg_aldo1: aldo1 {
170				regulator-always-on;
171				regulator-min-microvolt = <3300000>;
172				regulator-max-microvolt = <3300000>;
173				regulator-name = "vcc-pl";
174			};
175
176			reg_aldo2: aldo2 {
177				regulator-min-microvolt = <3300000>;
178				regulator-max-microvolt = <3300000>;
179				regulator-name = "vcc-ac200";
180				regulator-enable-ramp-delay = <100000>;
181			};
182
183			reg_aldo3: aldo3 {
184				regulator-always-on;
185				regulator-min-microvolt = <3300000>;
186				regulator-max-microvolt = <3300000>;
187				regulator-name = "vcc25-dram";
188			};
189
190			reg_bldo1: bldo1 {
191				regulator-always-on;
192				regulator-min-microvolt = <1800000>;
193				regulator-max-microvolt = <1800000>;
194				regulator-name = "vcc-bias-pll";
195			};
196
197			reg_bldo2: bldo2 {
198				regulator-always-on;
199				regulator-min-microvolt = <1800000>;
200				regulator-max-microvolt = <1800000>;
201				regulator-name = "vcc-efuse-pcie-hdmi-io";
202			};
203
204			reg_bldo3: bldo3 {
205				regulator-always-on;
206				regulator-min-microvolt = <1800000>;
207				regulator-max-microvolt = <1800000>;
208				regulator-name = "vcc-dcxoio";
209			};
210
211			bldo4 {
212				/* unused */
213			};
214
215			reg_cldo1: cldo1 {
216				regulator-always-on;
217				regulator-min-microvolt = <3300000>;
218				regulator-max-microvolt = <3300000>;
219				regulator-name = "vcc-3v3";
220			};
221
222			reg_cldo2: cldo2 {
223				regulator-min-microvolt = <3300000>;
224				regulator-max-microvolt = <3300000>;
225				regulator-name = "vcc-wifi-1";
226			};
227
228			reg_cldo3: cldo3 {
229				regulator-min-microvolt = <3300000>;
230				regulator-max-microvolt = <3300000>;
231				regulator-name = "vcc-wifi-2";
232			};
233
234			reg_dcdca: dcdca {
235				regulator-always-on;
236				regulator-min-microvolt = <810000>;
237				regulator-max-microvolt = <1080000>;
238				regulator-name = "vdd-cpu";
239			};
240
241			reg_dcdcc: dcdcc {
242				regulator-enable-ramp-delay = <32000>;
243				regulator-min-microvolt = <810000>;
244				regulator-max-microvolt = <1080000>;
245				regulator-name = "vdd-gpu";
246			};
247
248			reg_dcdcd: dcdcd {
249				regulator-always-on;
250				regulator-min-microvolt = <960000>;
251				regulator-max-microvolt = <960000>;
252				regulator-name = "vdd-sys";
253			};
254
255			reg_dcdce: dcdce {
256				regulator-always-on;
257				regulator-min-microvolt = <1200000>;
258				regulator-max-microvolt = <1200000>;
259				regulator-name = "vcc-dram";
260			};
261
262			sw {
263				/* unused */
264			};
265		};
266	};
267};
268
269&r_ir {
270	linux,rc-map-name = "rc-beelink-gs1";
271	status = "okay";
272};
273
274&r_pio {
275	/*
276	 * PL0 and PL1 are used for PMIC I2C
277	 * don't enable the pl-supply else
278	 * it will fail at boot
279	 *
280	 * vcc-pl-supply = <&reg_aldo1>;
281	 */
282	vcc-pm-supply = <&reg_aldo1>;
283};
284
285&rtc {
286	clocks = <&ext_osc32k>;
287};
288
289&spdif {
290	status = "okay";
291};
292
293&uart0 {
294	pinctrl-names = "default";
295	pinctrl-0 = <&uart0_ph_pins>;
296	status = "okay";
297};
298
299&usb2otg {
300	dr_mode = "host";
301	status = "okay";
302};
303
304&usb2phy {
305	usb0_vbus-supply = <&reg_vcc5v>;
306	status = "okay";
307};
308
309&usb3phy {
310	status = "okay";
311};
312