1// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
2// Copyright (c) 2017-2019 Arm Ltd.
3
4/dts-v1/;
5#include "rk3328.dtsi"
6
7/ {
8	model = "Beelink A1";
9	compatible = "azw,beelink-a1", "rockchip,rk3328";
10
11	/*
12	 * UART pins, as viewed with bottom of case removed:
13	 *
14	 *           Front
15	 *        /-------
16	 *  L    / o <- Gnd
17	 *  e   / o <-- Rx
18	 *  f  / o <--- Tx
19	 *  t / o <---- +3.3v
20	 *    |
21	 */
22	chosen {
23		stdout-path = "serial2:1500000n8";
24	};
25
26	gmac_clkin: external-gmac-clock {
27		compatible = "fixed-clock";
28		clock-frequency = <125000000>;
29		clock-output-names = "gmac_clkin";
30		#clock-cells = <0>;
31	};
32
33	vcc_host_5v: usb3-current-switch {
34		compatible = "regulator-fixed";
35		enable-active-high;
36		gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
37		pinctrl-names = "default";
38		pinctrl-0 = <&usb30_host_drv>;
39		regulator-name = "vcc_host_5v";
40		vin-supply = <&vcc_sys>;
41	};
42
43	vcc_sys: vcc-sys {
44		compatible = "regulator-fixed";
45		regulator-name = "vcc_sys";
46		regulator-min-microvolt = <5000000>;
47		regulator-max-microvolt = <5000000>;
48	};
49
50	ir-receiver {
51		compatible = "gpio-ir-receiver";
52		gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_HIGH>;
53	};
54};
55
56&analog_sound {
57	simple-audio-card,name = "Analog A/V";
58	status = "okay";
59};
60
61&codec {
62	status = "okay";
63};
64
65&cpu0 {
66	cpu-supply = <&vdd_arm>;
67};
68
69&cpu1 {
70	cpu-supply = <&vdd_arm>;
71};
72
73&cpu2 {
74	cpu-supply = <&vdd_arm>;
75};
76
77&cpu3 {
78	cpu-supply = <&vdd_arm>;
79};
80
81&emmc {
82	bus-width = <8>;
83	cap-mmc-highspeed;
84	mmc-ddr-1_8v;
85	mmc-hs200-1_8v;
86	no-sd;
87	no-sdio;
88	non-removable;
89	pinctrl-names = "default";
90	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
91	vmmc-supply = <&vcc_io>;
92	vqmmc-supply = <&vcc18_emmc>;
93	status = "okay";
94};
95
96&gmac2io {
97	assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
98	assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
99	clock_in_out = "input";
100	phy-handle = <&rtl8211f>;
101	phy-mode = "rgmii";
102	phy-supply = <&vcc_io>;
103	pinctrl-names = "default";
104	pinctrl-0 = <&rgmiim1_pins>;
105	snps,aal;
106	snps,pbl = <0x4>;
107	tx_delay = <0x26>;
108	rx_delay = <0x11>;
109	status = "okay";
110
111	mdio {
112		compatible = "snps,dwmac-mdio";
113		#address-cells = <1>;
114		#size-cells = <0>;
115
116		rtl8211f: phy@0 {
117			reg = <0>;
118			reset-assert-us = <10000>;
119			reset-deassert-us = <30000>;
120			reset-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_LOW>;
121		};
122	};
123};
124
125&gpu {
126	mali-supply = <&vdd_logic>;
127};
128
129&hdmi {
130	status = "okay";
131};
132
133&hdmiphy {
134	status = "okay";
135};
136
137&hdmi_sound {
138	status = "okay";
139};
140
141&i2c1 {
142	clock-frequency = <1000000>;
143	i2c-scl-falling-time-ns = <5>;
144	i2c-scl-rising-time-ns = <83>;
145	status = "okay";
146
147	pmic@18 {
148		compatible = "rockchip,rk805";
149		reg = <0x18>;
150		interrupt-parent = <&gpio2>;
151		interrupts = <RK_PA6 IRQ_TYPE_LEVEL_LOW>;
152		pinctrl-names = "default";
153		pinctrl-0 = <&pmic_int_l>;
154		rockchip,system-power-controller;
155		wakeup-source;
156
157		vcc1-supply = <&vcc_sys>;
158		vcc2-supply = <&vcc_sys>;
159		vcc3-supply = <&vcc_sys>;
160		vcc4-supply = <&vcc_sys>;
161		vcc5-supply = <&vcc_io>;
162		vcc6-supply = <&vcc_io>;
163
164		regulators {
165			vdd_logic: DCDC_REG1 {
166				regulator-name = "vdd_logic";
167				regulator-min-microvolt = <700000>;
168				regulator-max-microvolt = <1350000>;
169				regulator-always-on;
170				regulator-boot-on;
171				regulator-state-mem {
172					regulator-on-in-suspend;
173					regulator-suspend-microvolt = <1000000>;
174				};
175			};
176
177			vdd_arm: DCDC_REG2 {
178				regulator-name = "vdd_arm";
179				regulator-min-microvolt = <700000>;
180				regulator-max-microvolt = <1350000>;
181				regulator-always-on;
182				regulator-boot-on;
183				regulator-state-mem {
184					regulator-on-in-suspend;
185					regulator-suspend-microvolt = <950000>;
186				};
187			};
188
189			vcc_ddr: DCDC_REG3 {
190				regulator-name = "vcc_ddr";
191				regulator-always-on;
192				regulator-boot-on;
193				regulator-state-mem {
194					regulator-on-in-suspend;
195				};
196			};
197
198			vcc_io: DCDC_REG4 {
199				regulator-name = "vcc_io";
200				regulator-min-microvolt = <3300000>;
201				regulator-max-microvolt = <3300000>;
202				regulator-always-on;
203				regulator-boot-on;
204				regulator-state-mem {
205					regulator-on-in-suspend;
206					regulator-suspend-microvolt = <3300000>;
207				};
208			};
209
210			vdd_18: LDO_REG1 {
211				regulator-name = "vdd_18";
212				regulator-min-microvolt = <1800000>;
213				regulator-max-microvolt = <1800000>;
214				regulator-always-on;
215				regulator-boot-on;
216				regulator-state-mem {
217					regulator-on-in-suspend;
218					regulator-suspend-microvolt = <1800000>;
219				};
220			};
221
222			vcc18_emmc: LDO_REG2 {
223				regulator-name = "vcc_18emmc";
224				regulator-min-microvolt = <1800000>;
225				regulator-max-microvolt = <1800000>;
226				regulator-always-on;
227				regulator-boot-on;
228				regulator-state-mem {
229					regulator-on-in-suspend;
230					regulator-suspend-microvolt = <1800000>;
231				};
232			};
233
234			vdd_11: LDO_REG3 {
235				regulator-name = "vdd_11";
236				regulator-min-microvolt = <1100000>;
237				regulator-max-microvolt = <1100000>;
238				regulator-always-on;
239				regulator-boot-on;
240				regulator-state-mem {
241					regulator-on-in-suspend;
242					regulator-suspend-microvolt = <1100000>;
243				};
244			};
245		};
246	};
247};
248
249&i2s0 {
250	status = "okay";
251};
252
253&i2s1 {
254	status = "okay";
255};
256
257&io_domains {
258	vccio1-supply = <&vcc_io>;
259	vccio2-supply = <&vcc18_emmc>;
260	vccio3-supply = <&vcc_io>;
261	vccio4-supply = <&vdd_18>;
262	vccio5-supply = <&vcc_io>;
263	vccio6-supply = <&vdd_18>;
264	pmuio-supply = <&vcc_io>;
265	status = "okay";
266};
267
268&pinctrl {
269	pmic {
270		pmic_int_l: pmic-int-l {
271			rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
272		};
273	};
274
275	usb3 {
276		usb30_host_drv: usb30-host-drv {
277			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
278		};
279	};
280
281	wifi {
282		bt_dis: bt-dis {
283			rockchip,pins = <2 RK_PC5 RK_FUNC_GPIO &pcfg_output_low>;
284		};
285
286		bt_wake_host: bt-wake-host {
287			rockchip,pins = <2 RK_PC0 RK_FUNC_GPIO &pcfg_pull_up>;
288		};
289
290		chip_en: chip-en {
291			rockchip,pins = <2 RK_PC3 RK_FUNC_GPIO &pcfg_output_low>;
292		};
293
294		host_wake_bt: host-wake-bt {
295			rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_output_high>;
296		};
297
298		wl_dis: wl-dis {
299			rockchip,pins = <3 RK_PB0 RK_FUNC_GPIO &pcfg_output_low>;
300		};
301
302		wl_wake_host: wl-wake-host {
303			rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
304		};
305	};
306};
307
308&sdmmc {
309	bus-width = <4>;
310	cap-mmc-highspeed;
311	cap-sd-highspeed;
312	disable-wp;
313	pinctrl-names = "default";
314	pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
315	vmmc-supply = <&vcc_io>;
316	vqmmc-supply = <&vcc_io>;
317	status = "okay";
318};
319
320&tsadc {
321	rockchip,hw-tshut-mode = <0>;
322	rockchip,hw-tshut-polarity = <0>;
323	status = "okay";
324};
325
326&uart2 {
327	status = "okay";
328};
329
330&u2phy {
331	status = "okay";
332};
333
334&u2phy_host {
335	status = "okay";
336};
337
338&u2phy_otg {
339	status = "okay";
340};
341
342&usb20_otg {
343	dr_mode = "host";
344	status = "okay";
345};
346
347&usb_host0_ehci {
348	pinctrl-names = "default";
349	pinctrl-0 = <&bt_dis &bt_wake_host &chip_en &host_wake_bt &wl_dis &wl_wake_host>;
350	status = "okay";
351};
352
353&vop {
354	status = "okay";
355};
356
357&vop_mmu {
358	status = "okay";
359};
360