xref: /linux/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts (revision 7b9a0e857b427cdda5a08b662dbea7321e6bb470)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2022 Wesion, Inc. All rights reserved.
4 */
5
6/dts-v1/;
7
8#include "amlogic-t7.dtsi"
9#include <dt-bindings/gpio/amlogic,t7-periphs-pinctrl.h>
10#include <dt-bindings/gpio/gpio.h>
11
12/ {
13	model = "Khadas VIM4";
14	compatible = "khadas,vim4", "amlogic,a311d2", "amlogic,t7";
15
16	aliases {
17		serial0 = &uart_a;
18		mmc0 = &sd_emmc_c;
19		mmc1 = &sd_emmc_b;
20		mmc2 = &sd_emmc_a;
21	};
22
23	memory@0 {
24		device_type = "memory";
25		reg = <0x0 0x0 0x0 0xE0000000
26			0x1 0x0 0x0 0xE0000000
27			0x2 0x0 0x0 0x40000000>; /* 8 GB */
28	};
29
30	reserved-memory {
31		#address-cells = <2>;
32		#size-cells = <2>;
33		ranges;
34
35		/* 3 MiB reserved for ARM Trusted Firmware (BL31) */
36		secmon_reserved: secmon@5000000 {
37			reg = <0x0 0x05000000 0x0 0x300000>;
38			no-map;
39		};
40
41		/* 32 MiB reserved for ARM Trusted Firmware (BL32) */
42		secmon_reserved_bl32: secmon@5300000 {
43			reg = <0x0 0x05300000 0x0 0x2000000>;
44			no-map;
45		};
46	};
47
48	dc_in: regulator-dc-in {
49		compatible = "regulator-fixed";
50		regulator-name = "DC_IN";
51		regulator-min-microvolt = <5000000>;
52		regulator-max-microvolt = <5000000>;
53		regulator-always-on;
54	};
55
56	pwm-leds {
57		compatible = "pwm-leds";
58
59		status {
60			linux,default-trigger="heartbeat";
61			max-brightness = <255>;
62			pwms = <&pwm_ao_cd 0 30040 0>;
63		};
64	};
65
66	sd_3v3: regulator-sdcard-3v3 {
67		compatible = "regulator-fixed";
68		regulator-name = "SD_3V3";
69		regulator-min-microvolt = <3300000>;
70		regulator-max-microvolt = <3300000>;
71		vin-supply = <&vddao_3v3>;
72		gpio = <&gpio GPIOD_11 GPIO_ACTIVE_LOW>;
73		regulator-boot-on;
74	};
75
76	sdio_pwrseq: sdio-pwrseq {
77		compatible = "mmc-pwrseq-simple";
78		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
79		post-power-on-delay-ms = <500>;
80		power-off-delay-us = <200000>;
81		clocks = <&wifi32k>;
82		clock-names = "ext_clock";
83	};
84
85	vcc5v: regulator-vcc-5v {
86		compatible = "regulator-fixed";
87		regulator-name = "VCC5V";
88		regulator-min-microvolt = <5000000>;
89		regulator-max-microvolt = <5000000>;
90		vin-supply = <&dc_in>;
91
92		gpio = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH>;
93		enable-active-high;
94	};
95
96	vcc5v0_usb: regulator-vcc-usb {
97		compatible = "regulator-fixed";
98		regulator-name = "VCC5V0_USB";
99		regulator-min-microvolt = <5000000>;
100		regulator-max-microvolt = <5000000>;
101		vin-supply = <&vcc5v>;
102
103		gpio = <&gpio GPIOY_5 GPIO_ACTIVE_HIGH>;
104		enable-active-high;
105	};
106
107	vdd_ddr: regulator-vddddr {
108		/*
109		 * SY8003ADFC Regulator.
110		 */
111		compatible = "pwm-regulator";
112		regulator-name = "VDDDDR";
113		regulator-min-microvolt = <690000>;
114		regulator-max-microvolt = <890000>;
115		pwm-supply = <&dc_in>;
116		pwms = <&pwm_ao_gh 0 1500 0>;
117		pwm-dutycycle-range = <100 0>;
118		regulator-boot-on;
119		regulator-always-on;
120	};
121
122	vdd_ee: regulator-vddee {
123		/*
124		 * MP8756GD Regulator.
125		 */
126		compatible = "pwm-regulator";
127		regulator-name = "VDDEE";
128		regulator-min-microvolt = <700000>;
129		regulator-max-microvolt = <922000>;
130		pwm-supply = <&dc_in>;
131		pwms = <&pwm_ao_ab 0 1500 0>;
132		pwm-dutycycle-range = <100 0>;
133		regulator-boot-on;
134		regulator-always-on;
135	};
136
137	vdd_gpu: regulator-vddgpu {
138		/*
139		 * SY8003ADFC Regulator.
140		 */
141		compatible = "pwm-regulator";
142		regulator-name = "VDDGPU";
143		regulator-min-microvolt = <700000>;
144		regulator-max-microvolt = <922000>;
145		pwm-supply = <&dc_in>;
146		pwms = <&pwm_ao_ef 0 1500 0>;
147		pwm-dutycycle-range = <100 0>;
148		regulator-boot-on;
149		regulator-always-on;
150	};
151
152	vdd_npu: regulator-vddnpu {
153		/*
154		 * SY8003ADFC Regulator.
155		 */
156		compatible = "pwm-regulator";
157		regulator-name = "VDDNPU";
158		regulator-min-microvolt = <733000>;
159		regulator-max-microvolt = <933000>;
160		pwm-supply = <&dc_in>;
161		pwms = <&pwm_ao_ef 1 1500 0>;
162		pwm-dutycycle-range = <100 0>;
163		regulator-boot-on;
164		regulator-always-on;
165	};
166
167	vddao_1v8: regulator-vddao-1v8 {
168		compatible = "regulator-fixed";
169		regulator-name = "VDDAO_1V8";
170		regulator-min-microvolt = <1800000>;
171		regulator-max-microvolt = <1800000>;
172		vin-supply = <&vddao_3v3>;
173		regulator-always-on;
174	};
175
176	vddao_3v3: regulator-vddao-3v3 {
177		compatible = "regulator-fixed";
178		regulator-name = "VDDAO_3V3";
179		regulator-min-microvolt = <3300000>;
180		regulator-max-microvolt = <3300000>;
181		vin-supply = <&dc_in>;
182		regulator-always-on;
183	};
184
185	vddcpu_a: regulator-vddcpu-a {
186		/*
187		 * MP8756GD Regulator.
188		 */
189		compatible = "pwm-regulator";
190		regulator-name = "VDDCPU_A";
191		regulator-min-microvolt = <689000>;
192		regulator-max-microvolt = <1049000>;
193		pwm-supply = <&dc_in>;
194		pwms = <&pwm_ao_cd 1 1500 0>;
195		pwm-dutycycle-range = <100 0>;
196		regulator-boot-on;
197		regulator-always-on;
198	};
199
200	vddcpu_b: regulator-vddcpu-b {
201		/*
202		 * MP8756GD Regulator.
203		 */
204		compatible = "pwm-regulator";
205		regulator-name = "VDDCPU_B";
206		regulator-min-microvolt = <689000>;
207		regulator-max-microvolt = <1049000>;
208		pwm-supply = <&dc_in>;
209		pwms = <&pwm_ao_ab 1 1500 0>;
210		pwm-dutycycle-range = <100 0>;
211		regulator-boot-on;
212		regulator-always-on;
213	};
214
215	vddio_1v8: regulator-vddio-1v8 {
216		compatible = "regulator-fixed";
217		regulator-name = "VDDIO_1V8";
218		regulator-min-microvolt = <1800000>;
219		regulator-max-microvolt = <1800000>;
220		vin-supply = <&vddio_3v3>;
221		regulator-always-on;
222	};
223
224	vddio_3v3: regulator-vddio-3v3 {
225		compatible = "regulator-fixed";
226		regulator-name = "VDDIO_3V3";
227		regulator-min-microvolt = <3300000>;
228		regulator-max-microvolt = <3300000>;
229		vin-supply = <&vddao_3v3>;
230		regulator-always-on;
231	};
232
233	vddio_c: regulator-gpio-c {
234		compatible = "regulator-gpio";
235		regulator-name = "VDDIO_C";
236		regulator-min-microvolt = <1800000>;
237		regulator-max-microvolt = <3300000>;
238		vin-supply = <&vddio_3v3>;
239		gpios = <&gpio GPIOD_9 GPIO_ACTIVE_HIGH>;
240		states = <1800000 1
241			  3300000 0>;
242	};
243
244	wifi32k: wifi32k {
245		compatible = "pwm-clock";
246		#clock-cells = <0>;
247		clock-frequency = <32768>;
248			pwms = <&pwm_ab 0 30518 0>;
249	};
250
251	xtal: xtal-clk {
252		compatible = "fixed-clock";
253		clock-frequency = <24000000>;
254		clock-output-names = "xtal";
255		#clock-cells = <0>;
256	};
257};
258
259&i2c_m_ao_a {
260	status = "okay";
261	pinctrl-0 = <&i2c0_ao_d_pins>;
262	pinctrl-names = "default";
263
264	khadas_mcu: system-controller@18 {
265		compatible = "khadas,vim4-mcu";
266		reg = <0x18>;
267		fan-supply = <&vcc5v>;
268		#cooling-cells = <2>;
269	};
270};
271
272&pwm_ab {
273	status = "okay";
274	pinctrl-0 = <&pwm_a_pins>;
275	pinctrl-names = "default";
276};
277
278&pwm_ao_ab {
279	status = "okay";
280	pinctrl-0 = <&pwm_ao_a_pins>, <&pwm_ao_b_pins>;
281	pinctrl-names = "default";
282};
283
284&pwm_ao_cd {
285	status = "okay";
286	pinctrl-0 = <&pwm_ao_c_d_pins>, <&pwm_ao_d_pins>;
287	pinctrl-names = "default";
288};
289
290&pwm_ao_ef {
291	status = "okay";
292	pinctrl-0 = <&pwm_ao_e_pins>, <&pwm_ao_f_pins>;
293	pinctrl-names = "default";
294};
295
296&pwm_ao_gh {
297	status = "okay";
298	pinctrl-0 = <&pwm_ao_g_e_pins>;
299	pinctrl-names = "default";
300};
301
302/* SDIO */
303&sd_emmc_a {
304	status = "okay";
305	pinctrl-0 = <&sdio_pins>;
306	pinctrl-1 = <&sdio_clk_gate_pins>;
307	pinctrl-names = "default", "clk-gate";
308	#address-cells = <1>;
309	#size-cells = <0>;
310
311	bus-width = <4>;
312	cap-sd-highspeed;
313	sd-uhs-sdr12;
314	sd-uhs-sdr25;
315	sd-uhs-sdr50;
316	sd-uhs-sdr104;
317	cap-sdio-irq;
318	max-frequency = <200000000>;
319	non-removable;
320	disable-wp;
321	no-mmc;
322	no-sd;
323
324	power-domains = <&pwrc PWRC_T7_SDIO_A_ID>;
325
326	keep-power-in-suspend;
327
328	mmc-pwrseq = <&sdio_pwrseq>;
329
330	vmmc-supply = <&vddao_3v3>;
331	vqmmc-supply = <&vddao_1v8>;
332
333	brcmf: wifi@1 {
334		reg = <1>;
335		compatible = "brcm,bcm43752-fmac", "brcm,bcm4329-fmac";
336	};
337};
338
339/* SD card */
340&sd_emmc_b {
341	status = "okay";
342	pinctrl-0 = <&sdcard_pins>;
343	pinctrl-1 = <&sdcard_clk_gate_pins>;
344	pinctrl-names = "default", "clk-gate";
345
346	bus-width = <4>;
347	cap-sd-highspeed;
348	sd-uhs-sdr12;
349	sd-uhs-sdr25;
350	sd-uhs-sdr50;
351	sd-uhs-sdr104;
352	max-frequency = <200000000>;
353	disable-wp;
354	no-sdio;
355	no-mmc;
356
357	power-domains = <&pwrc PWRC_T7_SDIO_B_ID>;
358
359	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
360	vmmc-supply = <&sd_3v3>;
361	vqmmc-supply = <&vddio_c>;
362};
363
364/* eMMC */
365&sd_emmc_c {
366	status = "okay";
367	pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
368	pinctrl-1 = <&emmc_clk_gate_pins>;
369	pinctrl-names = "default", "clk-gate";
370
371	bus-width = <8>;
372	cap-mmc-highspeed;
373	mmc-ddr-1_8v;
374	mmc-hs200-1_8v;
375	max-frequency = <200000000>;
376	disable-wp;
377	non-removable;
378	no-sdio;
379	no-sd;
380
381	power-domains = <&pwrc PWRC_T7_EMMC_ID>;
382
383	vmmc-supply = <&vddio_3v3>;
384	vqmmc-supply = <&vddio_1v8>;
385};
386
387&uart_a {
388	status = "okay";
389	clocks = <&xtal>, <&clkc_periphs CLKID_SYS_UART_A>, <&xtal>;
390	clock-names = "xtal", "pclk", "baud";
391};
392