1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2
3/dts-v1/;
4#include <dt-bindings/input/input.h>
5#include "rk3328.dtsi"
6
7/ {
8	model = "A95X Z2";
9	compatible = "zkmagic,a95x-z2", "rockchip,rk3318";
10
11	aliases {
12		mmc0 = &sdmmc;
13		mmc1 = &sdio;
14		mmc2 = &emmc;
15	};
16
17	chosen {
18		stdout-path = "serial2:1500000n8";
19	};
20
21	adc-keys {
22		compatible = "adc-keys";
23		io-channels = <&saradc 0>;
24		io-channel-names = "buttons";
25		keyup-threshold-microvolt = <1800000>;
26		poll-interval = <100>;
27
28		recovery {
29			label = "recovery";
30			linux,code = <KEY_VENDOR>;
31			press-threshold-microvolt = <17000>;
32		};
33	};
34
35	ir-receiver {
36		compatible = "gpio-ir-receiver";
37		gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_LOW>;
38		pinctrl-0 = <&ir_int>;
39		pinctrl-names = "default";
40	};
41
42	leds {
43		compatible = "gpio-leds";
44		pinctrl-0 = <&cyx_led_pin>;
45		pinctrl-names = "default";
46
47		cyx_led: led-0 {
48			default-state = "on";
49			gpios = <&gpio2 RK_PC7 GPIO_ACTIVE_LOW>;
50			label = "CYX_LED";
51		};
52	};
53
54	sdio_pwrseq: sdio-pwrseq {
55		compatible = "mmc-pwrseq-simple";
56		pinctrl-0 = <&wifi_enable_h>;
57		pinctrl-names = "default";
58		reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
59	};
60
61	spdif-sound {
62		compatible = "simple-audio-card";
63		simple-audio-card,name = "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		compatible = "linux,spdif-dit";
76		#sound-dai-cells = <0>;
77	};
78
79	/* Power tree */
80	vccio_1v8: vccio-1v8-regulator {
81		compatible = "regulator-fixed";
82		regulator-name = "vccio_1v8";
83		regulator-min-microvolt = <1800000>;
84		regulator-max-microvolt = <1800000>;
85		regulator-always-on;
86	};
87
88	vccio_3v3: vccio-3v3-regulator {
89		compatible = "regulator-fixed";
90		regulator-name = "vccio_3v3";
91		regulator-min-microvolt = <3300000>;
92		regulator-max-microvolt = <3300000>;
93		regulator-always-on;
94	};
95
96	vcc_otg_vbus: otg-vbus-regulator {
97		compatible = "regulator-fixed";
98		gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
99		pinctrl-0 = <&otg_vbus_drv>;
100		pinctrl-names = "default";
101		regulator-name = "vcc_otg_vbus";
102		regulator-min-microvolt = <5000000>;
103		regulator-max-microvolt = <5000000>;
104		enable-active-high;
105	};
106
107	vcc_sd: sdmmc-regulator {
108		compatible = "regulator-fixed";
109		gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>;
110		pinctrl-0 = <&sdmmc0m1_pin>;
111		pinctrl-names = "default";
112		regulator-name = "vcc_sd";
113		regulator-min-microvolt = <3300000>;
114		regulator-max-microvolt = <3300000>;
115		vin-supply = <&vccio_3v3>;
116	};
117
118	vdd_arm: vdd-arm {
119		compatible = "pwm-regulator";
120		pwms = <&pwm0 0 5000 1>;
121		regulator-name = "vdd_arm";
122		regulator-min-microvolt = <950000>;
123		regulator-max-microvolt = <1400000>;
124		regulator-settling-time-up-us = <250>;
125		regulator-always-on;
126		regulator-boot-on;
127	};
128
129	vdd_log: vdd-log {
130		compatible = "pwm-regulator";
131		pwms = <&pwm1 0 5000 1>;
132		regulator-name = "vdd_log";
133		regulator-min-microvolt = <900000>;
134		regulator-max-microvolt = <1300000>;
135		regulator-settling-time-up-us = <250>;
136		regulator-always-on;
137		regulator-boot-on;
138	};
139};
140
141&analog_sound {
142	status = "okay";
143};
144
145&codec {
146	status = "okay";
147};
148
149&cpu0 {
150	cpu-supply = <&vdd_arm>;
151};
152
153&cpu1 {
154	cpu-supply = <&vdd_arm>;
155};
156
157&cpu2 {
158	cpu-supply = <&vdd_arm>;
159};
160
161&cpu3 {
162	cpu-supply = <&vdd_arm>;
163};
164
165&cpu0_opp_table {
166	opp-1200000000 {
167		status = "disabled";
168	};
169
170	opp-1296000000 {
171		status = "disabled";
172	};
173};
174
175&emmc {
176	bus-width = <8>;
177	cap-mmc-highspeed;
178	non-removable;
179	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
180	pinctrl-names = "default";
181	status = "okay";
182};
183
184&gmac2phy {
185	assigned-clock-parents = <&cru SCLK_MAC2PHY_SRC>;
186	assigned-clock-rate = <50000000>;
187	assigned-clocks = <&cru SCLK_MAC2PHY>;
188	clock_in_out = "output";
189	status = "okay";
190};
191
192&gpu {
193	mali-supply = <&vdd_log>;
194};
195
196&hdmi {
197	ddc-i2c-scl-high-time-ns = <9625>;
198	ddc-i2c-scl-low-time-ns = <10000>;
199	status = "okay";
200};
201
202&hdmiphy {
203	status = "okay";
204};
205
206&hdmi_sound {
207	status = "okay";
208};
209
210&i2s0 {
211	status = "okay";
212};
213
214&i2s1 {
215	status = "okay";
216};
217
218&io_domains {
219	pmuio-supply = <&vccio_3v3>;
220	vccio1-supply = <&vccio_3v3>;
221	vccio2-supply = <&vccio_1v8>;
222	vccio3-supply = <&vccio_3v3>;
223	vccio4-supply = <&vccio_1v8>;
224	vccio5-supply = <&vccio_3v3>;
225	vccio6-supply = <&vccio_3v3>;
226	status = "okay";
227};
228
229&pinctrl {
230	ir {
231		ir_int: ir-int {
232			rockchip,pins = <2 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
233		};
234	};
235
236	leds {
237		cyx_led_pin: cyx-led-pin {
238			rockchip,pins = <2 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
239		};
240	};
241
242	pwm0 {
243		pwm0_pin_pull_up: pwm0-pin-pull-up {
244			rockchip,pins = <2 RK_PA4 1 &pcfg_pull_up>;
245		};
246	};
247
248	pwm1 {
249		pwm1_pin_pull_up: pwm1-pin-pull-up {
250			rockchip,pins = <2 RK_PA5 1 &pcfg_pull_up>;
251		};
252	};
253
254	sdio-pwrseq {
255		wifi_enable_h: wifi-enable-h {
256			rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
257		};
258	};
259
260	sdmmc1 {
261		clk_32k_out: clk-32k-out {
262			rockchip,pins = <1 RK_PD4 1 &pcfg_pull_none>;
263		};
264	};
265
266	usb {
267		host_vbus_drv: host-vbus-drv {
268			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
269		};
270
271		otg_vbus_drv: otg-vbus-drv {
272			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
273		};
274	};
275};
276
277&pwm0 {
278	pinctrl-0 = <&pwm0_pin_pull_up>;
279	pinctrl-names = "active";
280	status = "okay";
281};
282
283&pwm1 {
284	pinctrl-0 = <&pwm1_pin_pull_up>;
285	pinctrl-names = "active";
286	status = "okay";
287};
288
289&saradc {
290	vref-supply = <&vccio_1v8>;
291	status = "okay";
292};
293
294&sdio {
295	bus-width = <4>;
296	cap-sd-highspeed;
297	cap-sdio-irq;
298	keep-power-in-suspend;
299	max-frequency = <125000000>;
300	mmc-pwrseq = <&sdio_pwrseq>;
301	non-removable;
302	pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk &clk_32k_out>;
303	pinctrl-names = "default";
304	sd-uhs-sdr104;
305	status = "okay";
306};
307
308&sdmmc {
309	bus-width = <4>;
310	cap-sd-highspeed;
311	pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
312	pinctrl-names = "default";
313	vmmc-supply = <&vcc_sd>;
314	status = "okay";
315};
316
317&spdif {
318	pinctrl-0 = <&spdifm0_tx>;
319	status = "okay";
320};
321
322&soc_crit {
323	temperature = <115000>; /* millicelsius */
324};
325
326&target {
327	temperature = <105000>; /* millicelsius */
328};
329
330&threshold {
331	temperature = <90000>; /* millicelsius */
332};
333
334&tsadc {
335	rockchip,hw-tshut-temp = <120000>;
336	status = "okay";
337};
338
339&u2phy {
340	status = "okay";
341};
342
343&u2phy_host {
344	status = "okay";
345};
346
347&u2phy_otg {
348	phy-supply = <&vcc_otg_vbus>;
349	status = "okay";
350};
351
352&uart0 {
353	pinctrl-0 = <&uart0_xfer &uart0_cts>;
354	status = "okay";
355};
356
357&uart2 {
358	status = "okay";
359};
360
361&usb20_otg {
362	dr_mode = "host";
363	status = "okay";
364};
365
366&usbdrd3 {
367	dr_mode = "host";
368	status = "okay";
369};
370
371&usb_host0_ehci {
372	status = "okay";
373};
374
375&usb_host0_ohci {
376	status = "okay";
377};
378
379&vop {
380	status = "okay";
381};
382
383&vop_mmu {
384	status = "okay";
385};
386