xref: /openbmc/linux/arch/arm64/boot/dts/mediatek/mt8365-evk.dts (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
16ff94537SFabien Parent// SPDX-License-Identifier: GPL-2.0
26ff94537SFabien Parent/*
36ff94537SFabien Parent * Copyright (c) 2021-2022 BayLibre, SAS.
46ff94537SFabien Parent * Authors:
56ff94537SFabien Parent * Fabien Parent <fparent@baylibre.com>
66ff94537SFabien Parent * Bernhard Rosenkränzer <bero@baylibre.com>
76ff94537SFabien Parent */
86ff94537SFabien Parent
96ff94537SFabien Parent/dts-v1/;
106ff94537SFabien Parent
116ff94537SFabien Parent#include <dt-bindings/gpio/gpio.h>
126ff94537SFabien Parent#include <dt-bindings/input/input.h>
136ff94537SFabien Parent#include <dt-bindings/pinctrl/mt8365-pinfunc.h>
146ff94537SFabien Parent#include "mt8365.dtsi"
156ff94537SFabien Parent#include "mt6357.dtsi"
166ff94537SFabien Parent
176ff94537SFabien Parent/ {
186ff94537SFabien Parent	model = "MediaTek MT8365 Open Platform EVK";
196ff94537SFabien Parent	compatible = "mediatek,mt8365-evk", "mediatek,mt8365";
206ff94537SFabien Parent
216ff94537SFabien Parent	aliases {
226ff94537SFabien Parent		serial0 = &uart0;
236ff94537SFabien Parent	};
246ff94537SFabien Parent
256ff94537SFabien Parent	chosen {
266ff94537SFabien Parent		stdout-path = "serial0:921600n8";
276ff94537SFabien Parent	};
286ff94537SFabien Parent
296ff94537SFabien Parent	firmware {
306ff94537SFabien Parent		optee {
316ff94537SFabien Parent			compatible = "linaro,optee-tz";
326ff94537SFabien Parent			method = "smc";
336ff94537SFabien Parent		};
346ff94537SFabien Parent	};
356ff94537SFabien Parent
366ff94537SFabien Parent	gpio-keys {
376ff94537SFabien Parent		compatible = "gpio-keys";
386ff94537SFabien Parent		pinctrl-names = "default";
396ff94537SFabien Parent		pinctrl-0 = <&gpio_keys>;
406ff94537SFabien Parent
416ff94537SFabien Parent		key-volume-up {
426ff94537SFabien Parent			gpios = <&pio 24 GPIO_ACTIVE_LOW>;
436ff94537SFabien Parent			label = "volume_up";
446ff94537SFabien Parent			linux,code = <KEY_VOLUMEUP>;
456ff94537SFabien Parent			wakeup-source;
466ff94537SFabien Parent			debounce-interval = <15>;
476ff94537SFabien Parent		};
486ff94537SFabien Parent	};
496ff94537SFabien Parent
506ff94537SFabien Parent	memory@40000000 {
516ff94537SFabien Parent		device_type = "memory";
526ff94537SFabien Parent		reg = <0 0x40000000 0 0xc0000000>;
536ff94537SFabien Parent	};
546ff94537SFabien Parent
556ff94537SFabien Parent	usb_otg_vbus: regulator-0 {
566ff94537SFabien Parent		compatible = "regulator-fixed";
576ff94537SFabien Parent		regulator-name = "otg_vbus";
586ff94537SFabien Parent		regulator-min-microvolt = <5000000>;
596ff94537SFabien Parent		regulator-max-microvolt = <5000000>;
606ff94537SFabien Parent		gpio = <&pio 16 GPIO_ACTIVE_HIGH>;
616ff94537SFabien Parent		enable-active-high;
626ff94537SFabien Parent	};
636ff94537SFabien Parent
646ff94537SFabien Parent	reserved-memory {
656ff94537SFabien Parent		#address-cells = <2>;
666ff94537SFabien Parent		#size-cells = <2>;
676ff94537SFabien Parent		ranges;
68*2d98d0d2SAlexandre Bailon
696ff94537SFabien Parent		/* 192 KiB reserved for ARM Trusted Firmware (BL31) */
706ff94537SFabien Parent		bl31_secmon_reserved: secmon@43000000 {
71*2d98d0d2SAlexandre Bailon			no-map;
726ff94537SFabien Parent			reg = <0 0x43000000 0 0x30000>;
736ff94537SFabien Parent		};
746ff94537SFabien Parent
756ff94537SFabien Parent		/* 12 MiB reserved for OP-TEE (BL32)
766ff94537SFabien Parent		 * +-----------------------+ 0x43e0_0000
776ff94537SFabien Parent		 * |      SHMEM 2MiB       |
786ff94537SFabien Parent		 * +-----------------------+ 0x43c0_0000
796ff94537SFabien Parent		 * |        | TA_RAM  8MiB |
806ff94537SFabien Parent		 * + TZDRAM +--------------+ 0x4340_0000
816ff94537SFabien Parent		 * |        | TEE_RAM 2MiB |
826ff94537SFabien Parent		 * +-----------------------+ 0x4320_0000
836ff94537SFabien Parent		 */
846ff94537SFabien Parent		optee_reserved: optee@43200000 {
856ff94537SFabien Parent			no-map;
866ff94537SFabien Parent			reg = <0 0x43200000 0 0x00c00000>;
876ff94537SFabien Parent		};
886ff94537SFabien Parent	};
896ff94537SFabien Parent};
90988eff65SAlexandre Mergnat
91988eff65SAlexandre Mergnat&cpu0 {
92988eff65SAlexandre Mergnat	proc-supply = <&mt6357_vproc_reg>;
93988eff65SAlexandre Mergnat	sram-supply = <&mt6357_vsram_proc_reg>;
94988eff65SAlexandre Mergnat};
95988eff65SAlexandre Mergnat
96988eff65SAlexandre Mergnat&cpu1 {
976ff94537SFabien Parent	proc-supply = <&mt6357_vproc_reg>;
986ff94537SFabien Parent	sram-supply = <&mt6357_vsram_proc_reg>;
996ff94537SFabien Parent};
1006ff94537SFabien Parent
1016ff94537SFabien Parent&cpu2 {
1026ff94537SFabien Parent	proc-supply = <&mt6357_vproc_reg>;
1036ff94537SFabien Parent	sram-supply = <&mt6357_vsram_proc_reg>;
1046ff94537SFabien Parent};
1056ff94537SFabien Parent
106988eff65SAlexandre Mergnat&cpu3 {
107988eff65SAlexandre Mergnat	proc-supply = <&mt6357_vproc_reg>;
108988eff65SAlexandre Mergnat	sram-supply = <&mt6357_vsram_proc_reg>;
109988eff65SAlexandre Mergnat};
110988eff65SAlexandre Mergnat
111988eff65SAlexandre Mergnat&ethernet {
112988eff65SAlexandre Mergnat	pinctrl-0 = <&ethernet_pins>;
113988eff65SAlexandre Mergnat	pinctrl-names = "default";
1146ff94537SFabien Parent	phy-handle = <&eth_phy>;
1156ff94537SFabien Parent	phy-mode = "rmii";
1166ff94537SFabien Parent	/*
1176ff94537SFabien Parent	 * Ethernet and HDMI (DSI0) are sharing pins.
1186ff94537SFabien Parent	 * Only one can be enabled at a time and require the physical switch
1196ff94537SFabien Parent	 * SW2101 to be set on LAN position
1206ff94537SFabien Parent	 * mt6357_vibr_reg and mt6357_vsim2_reg are needed to supply ethernet
1216ff94537SFabien Parent	 */
1226ff94537SFabien Parent	status = "disabled";
1236ff94537SFabien Parent
1246ff94537SFabien Parent	mdio {
1256ff94537SFabien Parent		#address-cells = <1>;
1266ff94537SFabien Parent		#size-cells = <0>;
1276ff94537SFabien Parent
1286ff94537SFabien Parent		eth_phy: ethernet-phy@0 {
1296ff94537SFabien Parent			reg = <0>;
1306ff94537SFabien Parent		};
1316ff94537SFabien Parent	};
1326ff94537SFabien Parent};
1336ff94537SFabien Parent
1346ff94537SFabien Parent&i2c0 {
1356ff94537SFabien Parent	clock-frequency = <100000>;
1366ff94537SFabien Parent	pinctrl-0 = <&i2c0_pins>;
1376ff94537SFabien Parent	pinctrl-names = "default";
1386ff94537SFabien Parent	status = "okay";
1396ff94537SFabien Parent};
1406ff94537SFabien Parent
1416ff94537SFabien Parent&mmc0 {
1426ff94537SFabien Parent	assigned-clock-parents = <&topckgen CLK_TOP_MSDCPLL>;
1436ff94537SFabien Parent	assigned-clocks = <&topckgen CLK_TOP_MSDC50_0_SEL>;
1446ff94537SFabien Parent	bus-width = <8>;
1456ff94537SFabien Parent	cap-mmc-highspeed;
1466ff94537SFabien Parent	cap-mmc-hw-reset;
1476ff94537SFabien Parent	hs400-ds-delay = <0x12012>;
1486ff94537SFabien Parent	max-frequency = <200000000>;
1496ff94537SFabien Parent	mmc-hs200-1_8v;
1506ff94537SFabien Parent	mmc-hs400-1_8v;
1516ff94537SFabien Parent	no-sd;
1526ff94537SFabien Parent	no-sdio;
1536ff94537SFabien Parent	non-removable;
1546ff94537SFabien Parent	pinctrl-0 = <&mmc0_default_pins>;
1556ff94537SFabien Parent	pinctrl-1 = <&mmc0_uhs_pins>;
1566ff94537SFabien Parent	pinctrl-names = "default", "state_uhs";
1576ff94537SFabien Parent	vmmc-supply = <&mt6357_vemc_reg>;
1586ff94537SFabien Parent	vqmmc-supply = <&mt6357_vio18_reg>;
1596ff94537SFabien Parent	status = "okay";
1606ff94537SFabien Parent};
1616ff94537SFabien Parent
1626ff94537SFabien Parent&mmc1 {
1636ff94537SFabien Parent	bus-width = <4>;
1646ff94537SFabien Parent	cap-sd-highspeed;
1656ff94537SFabien Parent	cd-gpios = <&pio 76 GPIO_ACTIVE_LOW>;
1666ff94537SFabien Parent	max-frequency = <200000000>;
1676ff94537SFabien Parent	pinctrl-0 = <&mmc1_default_pins>;
1686ff94537SFabien Parent	pinctrl-1 = <&mmc1_uhs_pins>;
1696ff94537SFabien Parent	pinctrl-names = "default", "state_uhs";
1706ff94537SFabien Parent	sd-uhs-sdr104;
1716ff94537SFabien Parent	sd-uhs-sdr50;
1726ff94537SFabien Parent	vmmc-supply = <&mt6357_vmch_reg>;
1736ff94537SFabien Parent	vqmmc-supply = <&mt6357_vmc_reg>;
1746ff94537SFabien Parent	status = "okay";
1756ff94537SFabien Parent};
1766ff94537SFabien Parent
1776ff94537SFabien Parent&mt6357_pmic {
1786ff94537SFabien Parent	interrupts-extended = <&pio 145 IRQ_TYPE_LEVEL_HIGH>;
1796ff94537SFabien Parent	interrupt-controller;
1806ff94537SFabien Parent	#interrupt-cells = <2>;
1816ff94537SFabien Parent};
1826ff94537SFabien Parent
1836ff94537SFabien Parent&pio {
184	ethernet_pins: ethernet-pins {
185		phy_reset_pins {
186			pinmux = <MT8365_PIN_133_TDM_TX_DATA1__FUNC_GPIO133>;
187		};
188
189		rmii_pins {
190			pinmux = <MT8365_PIN_0_GPIO0__FUNC_EXT_TXD0>,
191				 <MT8365_PIN_1_GPIO1__FUNC_EXT_TXD1>,
192				 <MT8365_PIN_2_GPIO2__FUNC_EXT_TXD2>,
193				 <MT8365_PIN_3_GPIO3__FUNC_EXT_TXD3>,
194				 <MT8365_PIN_4_GPIO4__FUNC_EXT_TXC>,
195				 <MT8365_PIN_5_GPIO5__FUNC_EXT_RXER>,
196				 <MT8365_PIN_6_GPIO6__FUNC_EXT_RXC>,
197				 <MT8365_PIN_7_GPIO7__FUNC_EXT_RXDV>,
198				 <MT8365_PIN_8_GPIO8__FUNC_EXT_RXD0>,
199				 <MT8365_PIN_9_GPIO9__FUNC_EXT_RXD1>,
200				 <MT8365_PIN_10_GPIO10__FUNC_EXT_RXD2>,
201				 <MT8365_PIN_11_GPIO11__FUNC_EXT_RXD3>,
202				 <MT8365_PIN_12_GPIO12__FUNC_EXT_TXEN>,
203				 <MT8365_PIN_13_GPIO13__FUNC_EXT_COL>,
204				 <MT8365_PIN_14_GPIO14__FUNC_EXT_MDIO>,
205				 <MT8365_PIN_15_GPIO15__FUNC_EXT_MDC>;
206		};
207	};
208
209	gpio_keys: gpio-keys-pins {
210		pins {
211			pinmux = <MT8365_PIN_24_KPCOL0__FUNC_KPCOL0>;
212			bias-pull-up;
213			input-enable;
214		};
215	};
216
217	i2c0_pins: i2c0-pins {
218		pins {
219			pinmux = <MT8365_PIN_57_SDA0__FUNC_SDA0_0>,
220				 <MT8365_PIN_58_SCL0__FUNC_SCL0_0>;
221			bias-pull-up;
222		};
223	};
224
225	mmc0_default_pins: mmc0-default-pins {
226		clk-pins {
227			pinmux = <MT8365_PIN_99_MSDC0_CLK__FUNC_MSDC0_CLK>;
228			bias-pull-down;
229		};
230
231		cmd-dat-pins {
232			pinmux = <MT8365_PIN_103_MSDC0_DAT0__FUNC_MSDC0_DAT0>,
233				 <MT8365_PIN_102_MSDC0_DAT1__FUNC_MSDC0_DAT1>,
234				 <MT8365_PIN_101_MSDC0_DAT2__FUNC_MSDC0_DAT2>,
235				 <MT8365_PIN_100_MSDC0_DAT3__FUNC_MSDC0_DAT3>,
236				 <MT8365_PIN_96_MSDC0_DAT4__FUNC_MSDC0_DAT4>,
237				 <MT8365_PIN_95_MSDC0_DAT5__FUNC_MSDC0_DAT5>,
238				 <MT8365_PIN_94_MSDC0_DAT6__FUNC_MSDC0_DAT6>,
239				 <MT8365_PIN_93_MSDC0_DAT7__FUNC_MSDC0_DAT7>,
240				 <MT8365_PIN_98_MSDC0_CMD__FUNC_MSDC0_CMD>;
241			input-enable;
242			bias-pull-up;
243		};
244
245		rst-pins {
246			pinmux = <MT8365_PIN_97_MSDC0_RSTB__FUNC_MSDC0_RSTB>;
247			bias-pull-up;
248		};
249	};
250
251	mmc0_uhs_pins: mmc0-uhs-pins {
252		clk-pins {
253			pinmux = <MT8365_PIN_99_MSDC0_CLK__FUNC_MSDC0_CLK>;
254			drive-strength = <MTK_DRIVE_10mA>;
255			bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
256		};
257
258		cmd-dat-pins {
259			pinmux = <MT8365_PIN_103_MSDC0_DAT0__FUNC_MSDC0_DAT0>,
260				 <MT8365_PIN_102_MSDC0_DAT1__FUNC_MSDC0_DAT1>,
261				 <MT8365_PIN_101_MSDC0_DAT2__FUNC_MSDC0_DAT2>,
262				 <MT8365_PIN_100_MSDC0_DAT3__FUNC_MSDC0_DAT3>,
263				 <MT8365_PIN_96_MSDC0_DAT4__FUNC_MSDC0_DAT4>,
264				 <MT8365_PIN_95_MSDC0_DAT5__FUNC_MSDC0_DAT5>,
265				 <MT8365_PIN_94_MSDC0_DAT6__FUNC_MSDC0_DAT6>,
266				 <MT8365_PIN_93_MSDC0_DAT7__FUNC_MSDC0_DAT7>,
267				 <MT8365_PIN_98_MSDC0_CMD__FUNC_MSDC0_CMD>;
268			input-enable;
269			drive-strength = <MTK_DRIVE_10mA>;
270			bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
271		};
272
273		ds-pins {
274			pinmux = <MT8365_PIN_104_MSDC0_DSL__FUNC_MSDC0_DSL>;
275			drive-strength = <MTK_DRIVE_10mA>;
276			bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
277		};
278
279		rst-pins {
280			pinmux = <MT8365_PIN_97_MSDC0_RSTB__FUNC_MSDC0_RSTB>;
281			drive-strength = <MTK_DRIVE_10mA>;
282			bias-pull-up;
283		};
284	};
285
286	mmc1_default_pins: mmc1-default-pins {
287		cd-pins {
288			pinmux = <MT8365_PIN_76_CMDAT8__FUNC_GPIO76>;
289			bias-pull-up;
290		};
291
292		clk-pins {
293			pinmux = <MT8365_PIN_88_MSDC1_CLK__FUNC_MSDC1_CLK>;
294			bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
295		};
296
297		cmd-dat-pins {
298			pinmux = <MT8365_PIN_89_MSDC1_DAT0__FUNC_MSDC1_DAT0>,
299				 <MT8365_PIN_90_MSDC1_DAT1__FUNC_MSDC1_DAT1>,
300				 <MT8365_PIN_91_MSDC1_DAT2__FUNC_MSDC1_DAT2>,
301				 <MT8365_PIN_92_MSDC1_DAT3__FUNC_MSDC1_DAT3>,
302				 <MT8365_PIN_87_MSDC1_CMD__FUNC_MSDC1_CMD>;
303			input-enable;
304			bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
305		};
306	};
307
308	mmc1_uhs_pins: mmc1-uhs-pins {
309		clk-pins {
310			pinmux = <MT8365_PIN_88_MSDC1_CLK__FUNC_MSDC1_CLK>;
311			drive-strength = <MTK_DRIVE_8mA>;
312			bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
313		};
314
315		cmd-dat-pins {
316			pinmux = <MT8365_PIN_89_MSDC1_DAT0__FUNC_MSDC1_DAT0>,
317				 <MT8365_PIN_90_MSDC1_DAT1__FUNC_MSDC1_DAT1>,
318				 <MT8365_PIN_91_MSDC1_DAT2__FUNC_MSDC1_DAT2>,
319				 <MT8365_PIN_92_MSDC1_DAT3__FUNC_MSDC1_DAT3>,
320				 <MT8365_PIN_87_MSDC1_CMD__FUNC_MSDC1_CMD>;
321			input-enable;
322			drive-strength = <MTK_DRIVE_6mA>;
323			bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
324		};
325	};
326
327	uart0_pins: uart0-pins {
328		pins {
329			pinmux = <MT8365_PIN_35_URXD0__FUNC_URXD0>,
330				 <MT8365_PIN_36_UTXD0__FUNC_UTXD0>;
331		};
332	};
333
334	uart1_pins: uart1-pins {
335		pins {
336			pinmux = <MT8365_PIN_37_URXD1__FUNC_URXD1>,
337				 <MT8365_PIN_38_UTXD1__FUNC_UTXD1>;
338		};
339	};
340
341	uart2_pins: uart2-pins {
342		pins {
343			pinmux = <MT8365_PIN_39_URXD2__FUNC_URXD2>,
344				 <MT8365_PIN_40_UTXD2__FUNC_UTXD2>;
345		};
346	};
347
348	usb_pins: usb-pins {
349		id-pins {
350			pinmux = <MT8365_PIN_17_GPIO17__FUNC_GPIO17>;
351			input-enable;
352			bias-pull-up;
353		};
354
355		usb0-vbus-pins {
356			pinmux = <MT8365_PIN_16_GPIO16__FUNC_USB_DRVVBUS>;
357			output-high;
358		};
359
360		usb1-vbus-pins {
361			pinmux = <MT8365_PIN_18_GPIO18__FUNC_GPIO18>;
362			output-high;
363		};
364	};
365
366	pwm_pins: pwm-pins {
367		pins {
368			pinmux = <MT8365_PIN_19_DISP_PWM__FUNC_PWM_A>,
369				 <MT8365_PIN_116_I2S_BCK__FUNC_PWM_C>;
370		};
371	};
372};
373
374&pwm {
375	pinctrl-0 = <&pwm_pins>;
376	pinctrl-names = "default";
377	status = "okay";
378};
379
380&ssusb {
381	dr_mode = "otg";
382	maximum-speed = "high-speed";
383	pinctrl-0 = <&usb_pins>;
384	pinctrl-names = "default";
385	usb-role-switch;
386	vusb33-supply = <&mt6357_vusb33_reg>;
387	status = "okay";
388
389	connector {
390		compatible = "gpio-usb-b-connector", "usb-b-connector";
391		id-gpios = <&pio 17 GPIO_ACTIVE_HIGH>;
392		type = "micro";
393		vbus-supply = <&usb_otg_vbus>;
394	};
395};
396
397&usb_host {
398	vusb33-supply = <&mt6357_vusb33_reg>;
399	status = "okay";
400};
401
402&uart0 {
403	pinctrl-0 = <&uart0_pins>;
404	pinctrl-names = "default";
405	status = "okay";
406};
407
408&uart1 {
409	pinctrl-0 = <&uart1_pins>;
410	pinctrl-names = "default";
411	status = "okay";
412};
413
414&uart2 {
415	pinctrl-0 = <&uart2_pins>;
416	pinctrl-names = "default";
417	status = "okay";
418};
419