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