xref: /linux/scripts/dtc/include-prefixes/arm64/renesas/rzg2l-smarc-som.dtsi (revision c81bd70f47cef36f88074d119e6e49cf92707fdb)
1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2/*
3 * Device Tree Source for the RZ/G2L SMARC SOM common parts
4 *
5 * Copyright (C) 2021 Renesas Electronics Corp.
6 */
7
8#include <dt-bindings/gpio/gpio.h>
9#include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
10
11/* SW1[2] should be at position 2/OFF to enable 64 GB eMMC */
12#define EMMC	1
13
14/*
15 * To enable uSD card on CN3,
16 * SW1[2] should be at position 3/ON.
17 * Disable eMMC by setting "#define EMMC	0" above.
18 */
19#define SDHI	(!EMMC)
20
21/ {
22	aliases {
23		ethernet0 = &eth0;
24		ethernet1 = &eth1;
25	};
26
27	chosen {
28		bootargs = "ignore_loglevel rw root=/dev/nfs ip=on";
29	};
30
31	memory@48000000 {
32		device_type = "memory";
33		/* first 128MB is reserved for secure area. */
34		reg = <0x0 0x48000000 0x0 0x78000000>;
35	};
36
37	reg_1p8v: regulator0 {
38		compatible = "regulator-fixed";
39		regulator-name = "fixed-1.8V";
40		regulator-min-microvolt = <1800000>;
41		regulator-max-microvolt = <1800000>;
42		regulator-boot-on;
43		regulator-always-on;
44	};
45
46	reg_3p3v: regulator1 {
47		compatible = "regulator-fixed";
48		regulator-name = "fixed-3.3V";
49		regulator-min-microvolt = <3300000>;
50		regulator-max-microvolt = <3300000>;
51		regulator-boot-on;
52		regulator-always-on;
53	};
54
55	vccq_sdhi0: regulator-vccq-sdhi0 {
56		compatible = "regulator-gpio";
57
58		regulator-name = "SDHI0 VccQ";
59		regulator-min-microvolt = <1800000>;
60		regulator-max-microvolt = <3300000>;
61		states = <3300000 1>, <1800000 0>;
62		regulator-boot-on;
63		gpios = <&pinctrl RZG2L_GPIO(39, 0) GPIO_ACTIVE_HIGH>;
64		regulator-always-on;
65	};
66};
67
68&adc {
69	pinctrl-0 = <&adc_pins>;
70	pinctrl-names = "default";
71	status = "okay";
72
73	/delete-node/ channel@6;
74	/delete-node/ channel@7;
75};
76
77&eth0 {
78	pinctrl-0 = <&eth0_pins>;
79	pinctrl-names = "default";
80	phy-handle = <&phy0>;
81	phy-mode = "rgmii-id";
82	status = "okay";
83
84	phy0: ethernet-phy@7 {
85		compatible = "ethernet-phy-id0022.1640",
86			     "ethernet-phy-ieee802.3-c22";
87		reg = <7>;
88		rxc-skew-psec = <2400>;
89		txc-skew-psec = <2400>;
90		rxdv-skew-psec = <0>;
91		txdv-skew-psec = <0>;
92		rxd0-skew-psec = <0>;
93		rxd1-skew-psec = <0>;
94		rxd2-skew-psec = <0>;
95		rxd3-skew-psec = <0>;
96		txd0-skew-psec = <0>;
97		txd1-skew-psec = <0>;
98		txd2-skew-psec = <0>;
99		txd3-skew-psec = <0>;
100	};
101};
102
103&eth1 {
104	pinctrl-0 = <&eth1_pins>;
105	pinctrl-names = "default";
106	phy-handle = <&phy1>;
107	phy-mode = "rgmii-id";
108	status = "okay";
109
110	phy1: ethernet-phy@7 {
111		compatible = "ethernet-phy-id0022.1640",
112			     "ethernet-phy-ieee802.3-c22";
113		reg = <7>;
114		rxc-skew-psec = <2400>;
115		txc-skew-psec = <2400>;
116		rxdv-skew-psec = <0>;
117		txdv-skew-psec = <0>;
118		rxd0-skew-psec = <0>;
119		rxd1-skew-psec = <0>;
120		rxd2-skew-psec = <0>;
121		rxd3-skew-psec = <0>;
122		txd0-skew-psec = <0>;
123		txd1-skew-psec = <0>;
124		txd2-skew-psec = <0>;
125		txd3-skew-psec = <0>;
126	};
127};
128
129&extal_clk {
130	clock-frequency = <24000000>;
131};
132
133&ostm1 {
134	status = "okay";
135};
136
137&ostm2 {
138	status = "okay";
139};
140
141&pinctrl {
142	adc_pins: adc {
143		pinmux = <RZG2L_PORT_PINMUX(9, 0, 2)>; /* ADC_TRG */
144	};
145
146	eth0_pins: eth0 {
147		pinmux = <RZG2L_PORT_PINMUX(28, 1, 1)>, /* ET0_LINKSTA */
148			 <RZG2L_PORT_PINMUX(27, 1, 1)>, /* ET0_MDC */
149			 <RZG2L_PORT_PINMUX(28, 0, 1)>, /* ET0_MDIO */
150			 <RZG2L_PORT_PINMUX(20, 0, 1)>, /* ET0_TXC */
151			 <RZG2L_PORT_PINMUX(20, 1, 1)>, /* ET0_TX_CTL */
152			 <RZG2L_PORT_PINMUX(20, 2, 1)>, /* ET0_TXD0 */
153			 <RZG2L_PORT_PINMUX(21, 0, 1)>, /* ET0_TXD1 */
154			 <RZG2L_PORT_PINMUX(21, 1, 1)>, /* ET0_TXD2 */
155			 <RZG2L_PORT_PINMUX(22, 0, 1)>, /* ET0_TXD3 */
156			 <RZG2L_PORT_PINMUX(24, 0, 1)>, /* ET0_RXC */
157			 <RZG2L_PORT_PINMUX(24, 1, 1)>, /* ET0_RX_CTL */
158			 <RZG2L_PORT_PINMUX(25, 0, 1)>, /* ET0_RXD0 */
159			 <RZG2L_PORT_PINMUX(25, 1, 1)>, /* ET0_RXD1 */
160			 <RZG2L_PORT_PINMUX(26, 0, 1)>, /* ET0_RXD2 */
161			 <RZG2L_PORT_PINMUX(26, 1, 1)>; /* ET0_RXD3 */
162	};
163
164	eth1_pins: eth1 {
165		pinmux = <RZG2L_PORT_PINMUX(37, 2, 1)>, /* ET1_LINKSTA */
166			 <RZG2L_PORT_PINMUX(37, 0, 1)>, /* ET1_MDC */
167			 <RZG2L_PORT_PINMUX(37, 1, 1)>, /* ET1_MDIO */
168			 <RZG2L_PORT_PINMUX(29, 0, 1)>, /* ET1_TXC */
169			 <RZG2L_PORT_PINMUX(29, 1, 1)>, /* ET1_TX_CTL */
170			 <RZG2L_PORT_PINMUX(30, 0, 1)>, /* ET1_TXD0 */
171			 <RZG2L_PORT_PINMUX(30, 1, 1)>, /* ET1_TXD1 */
172			 <RZG2L_PORT_PINMUX(31, 0, 1)>, /* ET1_TXD2 */
173			 <RZG2L_PORT_PINMUX(31, 1, 1)>, /* ET1_TXD3 */
174			 <RZG2L_PORT_PINMUX(33, 1, 1)>, /* ET1_RXC */
175			 <RZG2L_PORT_PINMUX(34, 0, 1)>, /* ET1_RX_CTL */
176			 <RZG2L_PORT_PINMUX(34, 1, 1)>, /* ET1_RXD0 */
177			 <RZG2L_PORT_PINMUX(35, 0, 1)>, /* ET1_RXD1 */
178			 <RZG2L_PORT_PINMUX(35, 1, 1)>, /* ET1_RXD2 */
179			 <RZG2L_PORT_PINMUX(36, 0, 1)>; /* ET1_RXD3 */
180	};
181
182	gpio-sd0-pwr-en-hog {
183		gpio-hog;
184		gpios = <RZG2L_GPIO(4, 1) GPIO_ACTIVE_HIGH>;
185		output-high;
186		line-name = "gpio_sd0_pwr_en";
187	};
188
189	qspi0_pins: qspi0 {
190		qspi0-data {
191			pins = "QSPI0_IO0", "QSPI0_IO1", "QSPI0_IO2", "QSPI0_IO3";
192			power-source = <1800>;
193		};
194
195		qspi0-ctrl {
196			pins = "QSPI0_SPCLK", "QSPI0_SSL", "QSPI_RESET#";
197			power-source = <1800>;
198		};
199	};
200
201	/*
202	 * SD0 device selection is XOR between GPIO_SD0_DEV_SEL and SW1[2]
203	 * The below switch logic can be used to select the device between
204	 * eMMC and microSD, after setting GPIO_SD0_DEV_SEL to high in DT.
205	 * SW1[2] should be at position 2/OFF to enable 64 GB eMMC
206	 * SW1[2] should be at position 3/ON to enable uSD card CN3
207	 */
208	sd0-dev-sel-hog {
209		gpio-hog;
210		gpios = <RZG2L_GPIO(41, 1) GPIO_ACTIVE_HIGH>;
211		output-high;
212		line-name = "sd0_dev_sel";
213	};
214
215	sdhi0_emmc_pins: sd0emmc {
216		sd0_emmc_data {
217			pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3",
218			       "SD0_DATA4", "SD0_DATA5", "SD0_DATA6", "SD0_DATA7";
219			power-source = <1800>;
220		};
221
222		sd0_emmc_ctrl {
223			pins = "SD0_CLK", "SD0_CMD";
224			power-source = <1800>;
225		};
226
227		sd0_emmc_rst {
228			pins = "SD0_RST#";
229			power-source = <1800>;
230		};
231	};
232
233	sdhi0_pins: sd0 {
234		sd0_data {
235			pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3";
236			power-source = <3300>;
237		};
238
239		sd0_ctrl {
240			pins = "SD0_CLK", "SD0_CMD";
241			power-source = <3300>;
242		};
243
244		sd0_mux {
245			pinmux = <RZG2L_PORT_PINMUX(47, 0, 2)>; /* SD0_CD */
246		};
247	};
248
249	sdhi0_pins_uhs: sd0_uhs {
250		sd0_data_uhs {
251			pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3";
252			power-source = <1800>;
253		};
254
255		sd0_ctrl_uhs {
256			pins = "SD0_CLK", "SD0_CMD";
257			power-source = <1800>;
258		};
259
260		sd0_mux_uhs {
261			pinmux = <RZG2L_PORT_PINMUX(47, 0, 2)>; /* SD0_CD */
262		};
263	};
264};
265
266&sbc {
267	pinctrl-0 = <&qspi0_pins>;
268	pinctrl-names = "default";
269	status = "okay";
270
271	flash@0 {
272		compatible = "micron,mt25qu512a", "jedec,spi-nor";
273		reg = <0>;
274		m25p,fast-read;
275		spi-max-frequency = <50000000>;
276		spi-rx-bus-width = <4>;
277
278		partitions {
279			compatible = "fixed-partitions";
280			#address-cells = <1>;
281			#size-cells = <1>;
282
283			boot@0 {
284				reg = <0x00000000 0x2000000>;
285				read-only;
286			};
287			user@2000000 {
288				reg = <0x2000000 0x2000000>;
289			};
290		};
291	};
292};
293
294#if SDHI
295&sdhi0 {
296	pinctrl-0 = <&sdhi0_pins>;
297	pinctrl-1 = <&sdhi0_pins_uhs>;
298	pinctrl-names = "default", "state_uhs";
299
300	vmmc-supply = <&reg_3p3v>;
301	vqmmc-supply = <&vccq_sdhi0>;
302	bus-width = <4>;
303	sd-uhs-sdr50;
304	sd-uhs-sdr104;
305	status = "okay";
306};
307#endif
308
309#if EMMC
310&sdhi0 {
311	pinctrl-0 = <&sdhi0_emmc_pins>;
312	pinctrl-1 = <&sdhi0_emmc_pins>;
313	pinctrl-names = "default", "state_uhs";
314
315	vmmc-supply = <&reg_3p3v>;
316	vqmmc-supply = <&reg_1p8v>;
317	bus-width = <8>;
318	mmc-hs200-1_8v;
319	non-removable;
320	fixed-emmc-driver-type = <1>;
321	status = "okay";
322};
323#endif
324