xref: /linux/arch/arm64/boot/dts/renesas/r9a09g077m44-rzt2h-evk.dts (revision 4f38da1f027ea2c9f01bb71daa7a299c191b6940)
1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2/*
3 * Device Tree Source for the RZ/T2H EVK board
4 *
5 * Copyright (C) 2025 Renesas Electronics Corp.
6 */
7
8/dts-v1/;
9
10#include "r9a09g077m44.dtsi"
11
12/*
13 * SD0 can be connected to either eMMC (IC49) or SD card slot CN31
14 * Lets by default enable the eMMC, note we need the below SW settings
15 * for eMMC.
16 * SW2[1] = ON; SW2[2] = ON
17 *
18 * To enable SD card and disable eMMC on SDHI0 disable the below macro
19 * and set the below switch setting:
20 * SW2[1] = OFF; SW2[2] = ON
21 */
22#define SD0_EMMC	1
23#define SD0_SD		(!SD0_EMMC)
24
25/*
26 * P17_4 = SD1_CD; SW2[3] = ON
27 * P08_5 = SD1_PWEN; SW2[3] = ON
28 * P08_6 = SD1_IOVS; SW2[3] = ON; SW5[3] = OFF; SW5[4] = ON
29 */
30#define SD1_MICRO_SD	1
31
32/*
33 * USB Pin Configuration:
34 *
35 * This board is equipped with three USB connectors: Type-A (CN80), Mini-B
36 * (CN79), and Micro-AB (CN33). The RZ/T2H SoC has a single USB channel, so
37 * either the USB host interface or the USB function interface can be used,
38 * but not both simultaneously when using the CN79 and CN80 connectors.
39 *
40 * By default, the Type-A (CN80) and Mini-B (CN79) connectors are enabled.
41 * Configure the switches as follows:
42 *   - P00_0 - P00_2 (control signals for USB power supply): SW1[5] = ON
43 *   - USB_VBUSIN (used for USB function): SW7[7] = OFF; SW7[8] = ON
44 *   - USB_VBUSEN (used for USB_HF_VBUSEN): SW7[9] = OFF; SW7[10] = ON
45 *
46 * To enable the Micro-AB (CN33) USB OTG connector, set the following macro
47 * to 1 and configure the switches as follows:
48 *   - P00_0 - P00_2 (control signals for USB power supply): SW1[5] = ON
49 *   - USB_VBUSIN (used for USB OTG): SW7[7] = ON; SW7[8] = OFF
50 *   - USB_VBUSEN (used for USB_OTG_VBUSEN): SW7[9] = ON; SW7[10] = OFF
51 */
52#define USB_OTG		0
53
54#include "rzt2h-n2h-evk-common.dtsi"
55
56/ {
57	model = "Renesas RZ/T2H EVK Board based on r9a09g077m44";
58	compatible = "renesas,rzt2h-evk", "renesas,r9a09g077m44", "renesas,r9a09g077";
59
60	leds {
61		compatible = "gpio-leds";
62
63		led-0 {
64			/* SW8-9: ON, SW8-10: OFF */
65			gpios = <&pinctrl RZT2H_GPIO(23, 1) GPIO_ACTIVE_HIGH>;
66			color = <LED_COLOR_ID_GREEN>;
67			function = LED_FUNCTION_DEBUG;
68			function-enumerator = <0>;
69		};
70
71		led-1 {
72			/* SW5-1: OFF, SW5-2: ON */
73			gpios = <&pinctrl RZT2H_GPIO(32, 2) GPIO_ACTIVE_HIGH>;
74			color = <LED_COLOR_ID_GREEN>;
75			function = LED_FUNCTION_DEBUG;
76			function-enumerator = <1>;
77		};
78
79		led-2 {
80			gpios = <&pinctrl RZT2H_GPIO(6, 7) GPIO_ACTIVE_HIGH>;
81			color = <LED_COLOR_ID_YELLOW>;
82			function = LED_FUNCTION_DEBUG;
83			function-enumerator = <2>;
84		};
85
86#if (!SD1_MICRO_SD)
87		led-3 {
88			/* SW2-3: OFF */
89			gpios = <&pinctrl RZT2H_GPIO(8, 5) GPIO_ACTIVE_HIGH>;
90			color = <LED_COLOR_ID_RED>;
91			function = LED_FUNCTION_DEBUG;
92			function-enumerator = <3>;
93		};
94#endif
95
96		led-4 {
97			/* SW8-3: ON, SW8-4: OFF */
98			gpios = <&pinctrl RZT2H_GPIO(18, 0) GPIO_ACTIVE_HIGH>;
99			color = <LED_COLOR_ID_GREEN>;
100			function = LED_FUNCTION_DEBUG;
101			function-enumerator = <4>;
102		};
103
104		led-5 {
105			/* SW8-1: ON, SW8-2: OFF */
106			gpios = <&pinctrl RZT2H_GPIO(18, 1) GPIO_ACTIVE_HIGH>;
107			color = <LED_COLOR_ID_RED>;
108			function = LED_FUNCTION_DEBUG;
109			function-enumerator = <5>;
110		};
111
112		led-6 {
113			/* SW5-9: OFF, SW5-10: ON */
114			gpios = <&pinctrl RZT2H_GPIO(22, 7) GPIO_ACTIVE_HIGH>;
115			color = <LED_COLOR_ID_GREEN>;
116			function = LED_FUNCTION_DEBUG;
117			function-enumerator = <6>;
118		};
119
120		led-7 {
121			/* SW5-7: OFF, SW5-8: ON */
122			gpios = <&pinctrl RZT2H_GPIO(23, 0) GPIO_ACTIVE_HIGH>;
123			color = <LED_COLOR_ID_GREEN>;
124			function = LED_FUNCTION_DEBUG;
125			function-enumerator = <7>;
126		};
127
128		led-8 {
129			/* SW7-5: OFF, SW7-6: ON */
130			gpios = <&pinctrl RZT2H_GPIO(23, 5) GPIO_ACTIVE_HIGH>;
131			color = <LED_COLOR_ID_GREEN>;
132			function = LED_FUNCTION_DEBUG;
133			function-enumerator = <8>;
134		};
135	};
136};
137
138&i2c0 {
139	pinctrl-0 = <&i2c0_pins>;
140	pinctrl-names = "default";
141	clock-frequency = <400000>;
142	status = "okay";
143};
144
145&i2c1 {
146	pinctrl-0 = <&i2c1_pins>;
147	pinctrl-names = "default";
148	clock-frequency = <400000>;
149	status = "okay";
150};
151
152&pinctrl {
153	/*
154	 * I2C0 Pin Configuration:
155	 * ------------------------
156	 * Signal | Pin     | SW6
157	 * -------|---------|--------------
158	 * SCL    | P23_3   | 7: ON, 8: OFF
159	 * SDA    | P23_4   | 9: ON, 10: OFF
160	 */
161	i2c0_pins: i2c0-pins {
162		pinmux = <RZT2H_PORT_PINMUX(23, 3, 0x17)>,
163			 <RZT2H_PORT_PINMUX(23, 4, 0x17)>;
164	};
165
166	i2c1_pins: i2c1-pins {
167		pinmux = <RZT2H_PORT_PINMUX(5, 0, 0x17)>, /* SDA */
168			 <RZT2H_PORT_PINMUX(4, 7, 0x17)>; /* SCL */
169	};
170
171#if USB_OTG
172	usb-exicen-hog {
173		gpio-hog;
174		gpios = <RZT2H_GPIO(0, 2) GPIO_ACTIVE_HIGH>;
175		output-high;
176		line-name = "usb_exicen_a";
177	};
178#endif
179
180	usb_pins: usb-pins {
181		pinmux = <RZT2H_PORT_PINMUX(0, 0, 0x13)>, /* VBUSEN */
182			 <RZT2H_PORT_PINMUX(0, 1, 0x13)>; /* OVRCUR */
183	};
184};
185