1// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
2/*
3 * Copyright 2020-2021 TQ-Systems GmbH
4 */
5
6#include "imx8mn.dtsi"
7
8/ {
9	model = "TQ-Systems i.MX8MN TQMa8MxNL";
10	compatible = "tq,imx8mn-tqma8mqnl", "fsl,imx8mn";
11
12	memory@40000000 {
13		device_type = "memory";
14		/*  our minimum RAM config will be 1024 MiB */
15		reg = <0x00000000 0x40000000 0 0x40000000>;
16	};
17
18	/* e-MMC IO, needed for HS modes */
19	reg_vcc1v8: regulator-vcc1v8 {
20		compatible = "regulator-fixed";
21		regulator-name = "TQMA8MXNL_VCC1V8";
22		regulator-min-microvolt = <1800000>;
23		regulator-max-microvolt = <1800000>;
24	};
25
26	reg_vcc3v3: regulator-vcc3v3 {
27		compatible = "regulator-fixed";
28		regulator-name = "TQMA8MXNL_VCC3V3";
29		regulator-min-microvolt = <3300000>;
30		regulator-max-microvolt = <3300000>;
31	};
32
33	reserved-memory {
34		#address-cells = <2>;
35		#size-cells = <2>;
36		ranges;
37
38		/* global autoconfigured region for contiguous allocations */
39		linux,cma {
40			compatible = "shared-dma-pool";
41			reusable;
42			/* 640 MiB */
43			size = <0 0x28000000>;
44			/*  1024 - 128 MiB, our minimum RAM config will be 1024 MiB */
45			alloc-ranges = <0 0x40000000 0 0x78000000>;
46			linux,cma-default;
47		};
48	};
49};
50
51&A53_0 {
52	cpu-supply = <&buck2_reg>;
53};
54
55&flexspi {
56	pinctrl-names = "default";
57	pinctrl-0 = <&pinctrl_flexspi>;
58	status = "okay";
59
60	flash0: flash@0 {
61		compatible = "jedec,spi-nor";
62		reg = <0>;
63		#address-cells = <1>;
64		#size-cells = <1>;
65		spi-max-frequency = <84000000>;
66		spi-tx-bus-width = <1>;
67		spi-rx-bus-width = <4>;
68	};
69};
70
71&i2c1 {
72	clock-frequency = <100000>;
73	pinctrl-names = "default", "gpio";
74	pinctrl-0 = <&pinctrl_i2c1>;
75	pinctrl-1 = <&pinctrl_i2c1_gpio>;
76	scl-gpios = <&gpio5 14 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
77	sda-gpios = <&gpio5 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
78	status = "okay";
79
80	sensor0: temperature-sensor@1b {
81		compatible = "nxp,se97b", "jedec,jc-42.4-temp";
82		reg = <0x1b>;
83	};
84
85	pca9450: pmic@25 {
86		compatible = "nxp,pca9450a";
87		reg = <0x25>;
88
89		/* PMIC PCA9450 PMIC_nINT GPIO1_IO08 */
90		pinctrl-0 = <&pinctrl_pmic>;
91		pinctrl-names = "default";
92		interrupt-parent = <&gpio1>;
93		interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
94
95		regulators {
96			/* V_0V85_SOC: 0.85 .. 0.95 */
97			buck1_reg: BUCK1 {
98				regulator-name = "BUCK1";
99				regulator-min-microvolt = <850000>;
100				regulator-max-microvolt = <950000>;
101				regulator-boot-on;
102				regulator-always-on;
103				regulator-ramp-delay = <3125>;
104			};
105
106			/* VDD_ARM */
107			buck2_reg: BUCK2 {
108				regulator-name = "BUCK2";
109				regulator-min-microvolt = <850000>;
110				regulator-max-microvolt = <1000000>;
111				regulator-boot-on;
112				regulator-always-on;
113				nxp,dvs-run-voltage = <950000>;
114				nxp,dvs-standby-voltage = <850000>;
115				regulator-ramp-delay = <3125>;
116			};
117
118			/* V_0V85_GPU / DRAM: shall be equal to BUCK1 for i.MX8MN */
119			buck3_reg: BUCK3 {
120				regulator-name = "BUCK3";
121				regulator-min-microvolt = <850000>;
122				regulator-max-microvolt = <950000>;
123				regulator-boot-on;
124				regulator-always-on;
125				regulator-ramp-delay = <3125>;
126			};
127
128			/* VCC3V3 -> VMMC, ... must not be changed */
129			buck4_reg: BUCK4 {
130				regulator-name = "BUCK4";
131				regulator-min-microvolt = <3300000>;
132				regulator-max-microvolt = <3300000>;
133				regulator-boot-on;
134				regulator-always-on;
135			};
136
137			/* V_1V8 -> VQMMC, SPI-NOR, ... must not be changed */
138			buck5_reg: BUCK5 {
139				regulator-name = "BUCK5";
140				regulator-min-microvolt = <1800000>;
141				regulator-max-microvolt = <1800000>;
142				regulator-boot-on;
143				regulator-always-on;
144			};
145
146			/* V_1V1 -> RAM, ... must not be changed */
147			buck6_reg: BUCK6 {
148				regulator-name = "BUCK6";
149				regulator-min-microvolt = <1100000>;
150				regulator-max-microvolt = <1100000>;
151				regulator-boot-on;
152				regulator-always-on;
153			};
154
155			/* V_1V8_SNVS */
156			ldo1_reg: LDO1 {
157				regulator-name = "LDO1";
158				regulator-min-microvolt = <1800000>;
159				regulator-max-microvolt = <1800000>;
160				regulator-boot-on;
161				regulator-always-on;
162			};
163
164			/* V_0V8_SNVS */
165			ldo2_reg: LDO2 {
166				regulator-name = "LDO2";
167				regulator-min-microvolt = <800000>;
168				regulator-max-microvolt = <850000>;
169				regulator-boot-on;
170				regulator-always-on;
171			};
172
173			/* V_1V8_ANA */
174			ldo3_reg: LDO3 {
175				regulator-name = "LDO3";
176				regulator-min-microvolt = <1800000>;
177				regulator-max-microvolt = <1800000>;
178				regulator-boot-on;
179				regulator-always-on;
180			};
181
182			/* V_0V9_MIPI */
183			ldo4_reg: LDO4 {
184				regulator-name = "LDO4";
185				regulator-min-microvolt = <900000>;
186				regulator-max-microvolt = <900000>;
187				regulator-boot-on;
188				regulator-always-on;
189			};
190
191			/* VCC SD IO - switched using SD2 VSELECT */
192			ldo5_reg: LDO5 {
193				regulator-name = "LDO5";
194				regulator-min-microvolt = <1800000>;
195				regulator-max-microvolt = <3300000>;
196			};
197		};
198	};
199
200	pcf85063: rtc@51 {
201		compatible = "nxp,pcf85063a";
202		reg = <0x51>;
203		quartz-load-femtofarads = <7000>;
204	};
205
206	eeprom1: eeprom@53 {
207		compatible = "nxp,se97b", "atmel,24c02";
208		read-only;
209		reg = <0x53>;
210		pagesize = <16>;
211		vcc-supply = <&reg_vcc3v3>;
212	};
213
214	eeprom0: eeprom@57 {
215		compatible = "atmel,24c64";
216		reg = <0x57>;
217		pagesize = <32>;
218		vcc-supply = <&reg_vcc3v3>;
219	};
220};
221
222&usdhc3 {
223	pinctrl-names = "default", "state_100mhz", "state_200mhz";
224	pinctrl-0 = <&pinctrl_usdhc3>;
225	pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
226	pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
227	bus-width = <8>;
228	non-removable;
229	no-sd;
230	no-sdio;
231	vmmc-supply = <&reg_vcc3v3>;
232	vqmmc-supply = <&reg_vcc1v8>;
233	status = "okay";
234};
235
236/*
237 * Attention:
238 * wdog reset is routed to PMIC, PMIC must be preconfigured to force POR
239 * without LDO for SNVS. GPIO1_IO02 must not be used as GPIO.
240 */
241&wdog1 {
242	pinctrl-names = "default";
243	pinctrl-0 = <&pinctrl_wdog>;
244	fsl,ext-reset-output;
245	status = "okay";
246};
247
248&iomuxc {
249	pinctrl_flexspi: flexspigrp {
250		fsl,pins = <MX8MN_IOMUXC_NAND_ALE_QSPI_A_SCLK		0x84>,
251			   <MX8MN_IOMUXC_NAND_CE0_B_QSPI_A_SS0_B	0x84>,
252			   <MX8MN_IOMUXC_NAND_DATA00_QSPI_A_DATA0	0x84>,
253			   <MX8MN_IOMUXC_NAND_DATA01_QSPI_A_DATA1	0x84>,
254			   <MX8MN_IOMUXC_NAND_DATA02_QSPI_A_DATA2	0x84>,
255			   <MX8MN_IOMUXC_NAND_DATA03_QSPI_A_DATA3	0x84>;
256	};
257
258	pinctrl_i2c1: i2c1grp {
259		fsl,pins = <MX8MN_IOMUXC_I2C1_SCL_I2C1_SCL		0x400001c4>,
260			   <MX8MN_IOMUXC_I2C1_SDA_I2C1_SDA		0x400001c4>;
261	};
262
263	pinctrl_i2c1_gpio: i2c1gpiogrp {
264		fsl,pins = <MX8MN_IOMUXC_I2C1_SCL_GPIO5_IO14	0x400001c4>,
265			   <MX8MN_IOMUXC_I2C1_SDA_GPIO5_IO15	0x400001c4>;
266	};
267
268	pinctrl_pmic: pmicgrp {
269		fsl,pins = <MX8MN_IOMUXC_GPIO1_IO08_GPIO1_IO8	0x84>;
270	};
271
272	pinctrl_reg_usdhc2_vmmc: regusdhc2vmmcgrp {
273		fsl,pins = <MX8MN_IOMUXC_SD2_RESET_B_GPIO2_IO19		0x84>;
274	};
275
276	pinctrl_usdhc3: usdhc3grp {
277		fsl,pins = <MX8MN_IOMUXC_NAND_WE_B_USDHC3_CLK		0x1d4>,
278			   <MX8MN_IOMUXC_NAND_WP_B_USDHC3_CMD		0x1d2>,
279			   <MX8MN_IOMUXC_NAND_DATA04_USDHC3_DATA0	0x1d4>,
280			   <MX8MN_IOMUXC_NAND_DATA05_USDHC3_DATA1	0x1d4>,
281			   <MX8MN_IOMUXC_NAND_DATA06_USDHC3_DATA2	0x1d4>,
282			   <MX8MN_IOMUXC_NAND_DATA07_USDHC3_DATA3	0x1d4>,
283			   <MX8MN_IOMUXC_NAND_RE_B_USDHC3_DATA4		0x1d4>,
284			   <MX8MN_IOMUXC_NAND_CE2_B_USDHC3_DATA5	0x1d4>,
285			   <MX8MN_IOMUXC_NAND_CE3_B_USDHC3_DATA6	0x1d4>,
286			   <MX8MN_IOMUXC_NAND_CLE_USDHC3_DATA7		0x1d4>,
287			   <MX8MN_IOMUXC_NAND_CE1_B_USDHC3_STROBE	0x84>,
288			   <MX8MN_IOMUXC_NAND_READY_B_USDHC3_RESET_B	0x84>;
289	};
290
291	pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp {
292		fsl,pins = <MX8MN_IOMUXC_NAND_WE_B_USDHC3_CLK		0x1d2>,
293			   <MX8MN_IOMUXC_NAND_WP_B_USDHC3_CMD		0x1d2>,
294			   <MX8MN_IOMUXC_NAND_DATA04_USDHC3_DATA0	0x1d4>,
295			   <MX8MN_IOMUXC_NAND_DATA05_USDHC3_DATA1	0x1d4>,
296			   <MX8MN_IOMUXC_NAND_DATA06_USDHC3_DATA2	0x1d4>,
297			   <MX8MN_IOMUXC_NAND_DATA07_USDHC3_DATA3	0x1d4>,
298			   <MX8MN_IOMUXC_NAND_RE_B_USDHC3_DATA4		0x1d4>,
299			   <MX8MN_IOMUXC_NAND_CE2_B_USDHC3_DATA5	0x1d4>,
300			   <MX8MN_IOMUXC_NAND_CE3_B_USDHC3_DATA6	0x1d4>,
301			   <MX8MN_IOMUXC_NAND_CLE_USDHC3_DATA7		0x1d4>,
302			   <MX8MN_IOMUXC_NAND_CE1_B_USDHC3_STROBE	0x84>,
303			   <MX8MN_IOMUXC_NAND_READY_B_USDHC3_RESET_B	0x84>;
304	};
305
306	pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp {
307		fsl,pins = <MX8MN_IOMUXC_NAND_WE_B_USDHC3_CLK		0x1d6>,
308			   <MX8MN_IOMUXC_NAND_WP_B_USDHC3_CMD		0x1d2>,
309			   <MX8MN_IOMUXC_NAND_DATA04_USDHC3_DATA0	0x1d4>,
310			   <MX8MN_IOMUXC_NAND_DATA05_USDHC3_DATA1	0x1d4>,
311			   <MX8MN_IOMUXC_NAND_DATA06_USDHC3_DATA2	0x1d4>,
312			   <MX8MN_IOMUXC_NAND_DATA07_USDHC3_DATA3	0x1d4>,
313			   <MX8MN_IOMUXC_NAND_RE_B_USDHC3_DATA4		0x1d4>,
314			   <MX8MN_IOMUXC_NAND_CE2_B_USDHC3_DATA5	0x1d4>,
315			   <MX8MN_IOMUXC_NAND_CE3_B_USDHC3_DATA6	0x1d4>,
316			   <MX8MN_IOMUXC_NAND_CLE_USDHC3_DATA7		0x1d4>,
317			   <MX8MN_IOMUXC_NAND_CE1_B_USDHC3_STROBE	0x84>,
318			   <MX8MN_IOMUXC_NAND_READY_B_USDHC3_RESET_B	0x84>;
319	};
320
321	pinctrl_wdog: wdoggrp {
322		fsl,pins = <MX8MN_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x84>;
323	};
324};
325