xref: /linux/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts (revision f259f446f5198d98e13756d2cd531812a0ad3064)
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&pwm_ab {
260	status = "okay";
261	pinctrl-0 = <&pwm_a_pins>;
262	pinctrl-names = "default";
263};
264
265&pwm_ao_ab {
266	status = "okay";
267	pinctrl-0 = <&pwm_ao_a_pins>, <&pwm_ao_b_pins>;
268	pinctrl-names = "default";
269};
270
271&pwm_ao_cd {
272	status = "okay";
273	pinctrl-0 = <&pwm_ao_c_d_pins>, <&pwm_ao_d_pins>;
274	pinctrl-names = "default";
275};
276
277&pwm_ao_ef {
278	status = "okay";
279	pinctrl-0 = <&pwm_ao_e_pins>, <&pwm_ao_f_pins>;
280	pinctrl-names = "default";
281};
282
283&pwm_ao_gh {
284	status = "okay";
285	pinctrl-0 = <&pwm_ao_g_e_pins>;
286	pinctrl-names = "default";
287};
288
289/* SDIO */
290&sd_emmc_a {
291	status = "okay";
292	pinctrl-0 = <&sdio_pins>;
293	pinctrl-1 = <&sdio_clk_gate_pins>;
294	pinctrl-names = "default", "clk-gate";
295	#address-cells = <1>;
296	#size-cells = <0>;
297
298	bus-width = <4>;
299	cap-sd-highspeed;
300	sd-uhs-sdr12;
301	sd-uhs-sdr25;
302	sd-uhs-sdr50;
303	sd-uhs-sdr104;
304	cap-sdio-irq;
305	max-frequency = <200000000>;
306	non-removable;
307	disable-wp;
308	no-mmc;
309	no-sd;
310
311	power-domains = <&pwrc PWRC_T7_SDIO_A_ID>;
312
313	keep-power-in-suspend;
314
315	mmc-pwrseq = <&sdio_pwrseq>;
316
317	vmmc-supply = <&vddao_3v3>;
318	vqmmc-supply = <&vddao_1v8>;
319
320	brcmf: wifi@1 {
321		reg = <1>;
322		compatible = "brcm,bcm43752-fmac", "brcm,bcm4329-fmac";
323	};
324};
325
326/* SD card */
327&sd_emmc_b {
328	status = "okay";
329	pinctrl-0 = <&sdcard_pins>;
330	pinctrl-1 = <&sdcard_clk_gate_pins>;
331	pinctrl-names = "default", "clk-gate";
332
333	bus-width = <4>;
334	cap-sd-highspeed;
335	sd-uhs-sdr12;
336	sd-uhs-sdr25;
337	sd-uhs-sdr50;
338	sd-uhs-sdr104;
339	max-frequency = <200000000>;
340	disable-wp;
341	no-sdio;
342	no-mmc;
343
344	power-domains = <&pwrc PWRC_T7_SDIO_B_ID>;
345
346	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
347	vmmc-supply = <&sd_3v3>;
348	vqmmc-supply = <&vddio_c>;
349};
350
351/* eMMC */
352&sd_emmc_c {
353	status = "okay";
354	pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
355	pinctrl-1 = <&emmc_clk_gate_pins>;
356	pinctrl-names = "default", "clk-gate";
357
358	bus-width = <8>;
359	cap-mmc-highspeed;
360	mmc-ddr-1_8v;
361	mmc-hs200-1_8v;
362	max-frequency = <200000000>;
363	disable-wp;
364	non-removable;
365	no-sdio;
366	no-sd;
367
368	power-domains = <&pwrc PWRC_T7_EMMC_ID>;
369
370	vmmc-supply = <&vddio_3v3>;
371	vqmmc-supply = <&vddio_1v8>;
372};
373
374&uart_a {
375	status = "okay";
376	clocks = <&xtal>, <&clkc_periphs CLKID_SYS_UART_A>, <&xtal>;
377	clock-names = "xtal", "pclk", "baud";
378};
379