| 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 <dt-bindings/input/input.h> |
| 11 |
|
| 12 |
#include "r9a09g077m44.dtsi" |
| 13 |
|
| 14 |
/* |
| 15 |
* SD0 can be connected to either eMMC (IC49) or SD card slot CN31 |
| 16 |
* Lets by default enable the eMMC, note we need the below SW settings |
| 17 |
* for eMMC. |
| 18 |
* SW2[1] = ON; SW2[2] = ON |
| 19 |
* |
| 20 |
* To enable SD card and disable eMMC on SDHI0 disable the below macro |
| 21 |
* and set the below switch setting: |
| 22 |
* SW2[1] = OFF; SW2[2] = ON |
| 23 |
*/ |
| 24 |
#define SD0_EMMC 1 |
| 25 |
#define SD0_SD (!SD0_EMMC) |
| 26 |
|
| 27 |
/* |
| 28 |
* P17_4 = SD1_CD; SW2[3] = ON |
| 29 |
* P08_5 = SD1_PWEN; SW2[3] = ON |
| 30 |
* P08_6 = SD1_IOVS; SW2[3] = ON; SW5[3] = OFF; SW5[4] = ON |
| 31 |
* To enable proper operation in 1.8V modes, CN77 must have pins 2 and 3 |
| 32 |
* connected by the jumper. This connects SD1 power-supply control IC output |
| 33 |
* back to VCC1833_7. |
| 34 |
*/ |
| 35 |
#define SD1_MICRO_SD 1 |
| 36 |
|
| 37 |
/* |
| 38 |
* USB Pin Configuration: |
| 39 |
* |
| 40 |
* This board is equipped with three USB connectors: Type-A (CN80), Mini-B |
| 41 |
* (CN79), and Micro-AB (CN33). The RZ/T2H SoC has a single USB channel, so |
| 42 |
* either the USB host interface or the USB function interface can be used, |
| 43 |
* but not both simultaneously when using the CN79 and CN80 connectors. |
| 44 |
* |
| 45 |
* By default, the Type-A (CN80) and Mini-B (CN79) connectors are enabled. |
| 46 |
* Configure the switches as follows: |
| 47 |
* - P00_0 - P00_2 (control signals for USB power supply): SW1[5] = ON |
| 48 |
* - USB_VBUSIN (used for USB function): SW7[7] = OFF; SW7[8] = ON |
| 49 |
* - USB_VBUSEN (used for USB_HF_VBUSEN): SW7[9] = OFF; SW7[10] = ON |
| 50 |
* |
| 51 |
* To enable the Micro-AB (CN33) USB OTG connector, set the following macro |
| 52 |
* to 1 and configure the switches as follows: |
| 53 |
* - P00_0 - P00_2 (control signals for USB power supply): SW1[5] = ON |
| 54 |
* - USB_VBUSIN (used for USB OTG): SW7[7] = ON; SW7[8] = OFF |
| 55 |
* - USB_VBUSEN (used for USB_OTG_VBUSEN): SW7[9] = ON; SW7[10] = OFF |
| 56 |
*/ |
| 57 |
#define USB_OTG 0 |
| 58 |
|
| 59 |
#include "rzt2h-n2h-evk-common.dtsi" |
| 60 |
|
| 61 |
/ { |
| 62 |
model = "Renesas RZ/T2H EVK Board based on r9a09g077m44"; |
| 63 |
compatible = "renesas,rzt2h-evk", "renesas,r9a09g077m44", "renesas,r9a09g077"; |
| 64 |
|
| 65 |
keys { |
| 66 |
compatible = "gpio-keys"; |
| 67 |
|
| 68 |
#if (!SD1_MICRO_SD) |
| 69 |
/* SW2-3: OFF */ |
| 70 |
key-1 { |
| 71 |
interrupts-extended = <&pinctrl RZT2H_GPIO(8, 6) IRQ_TYPE_EDGE_FALLING>; |
| 72 |
linux,code = <KEY_1>; |
| 73 |
label = "SW9"; |
| 74 |
wakeup-source; |
| 75 |
debounce-interval = <20>; |
| 76 |
}; |
| 77 |
#endif |
| 78 |
|
| 79 |
key-2 { |
| 80 |
interrupts-extended = <&pinctrl RZT2H_GPIO(0, 3) IRQ_TYPE_EDGE_FALLING>; |
| 81 |
linux,code = <KEY_2>; |
| 82 |
label = "SW10"; |
| 83 |
wakeup-source; |
| 84 |
debounce-interval = <20>; |
| 85 |
}; |
| 86 |
|
| 87 |
key-3 { |
| 88 |
interrupts-extended = <&pinctrl RZT2H_GPIO(8, 7) IRQ_TYPE_EDGE_FALLING>; |
| 89 |
linux,code = <KEY_3>; |
| 90 |
label = "SW11"; |
| 91 |
wakeup-source; |
| 92 |
debounce-interval = <20>; |
| 93 |
}; |
| 94 |
}; |
| 95 |
|
| 96 |
leds { |
| 97 |
compatible = "gpio-leds"; |
| 98 |
|
| 99 |
led-0 { |
| 100 |
/* SW8-9: ON, SW8-10: OFF */ |
| 101 |
gpios = <&pinctrl RZT2H_GPIO(23, 1) GPIO_ACTIVE_HIGH>; |
| 102 |
color = <LED_COLOR_ID_GREEN>; |
| 103 |
function = LED_FUNCTION_DEBUG; |
| 104 |
function-enumerator = <0>; |
| 105 |
}; |
| 106 |
|
| 107 |
led-1 { |
| 108 |
/* SW5-1: OFF, SW5-2: ON */ |
| 109 |
gpios = <&pinctrl RZT2H_GPIO(32, 2) GPIO_ACTIVE_HIGH>; |
| 110 |
color = <LED_COLOR_ID_GREEN>; |
| 111 |
function = LED_FUNCTION_DEBUG; |
| 112 |
function-enumerator = <1>; |
| 113 |
}; |
| 114 |
|
| 115 |
led-2 { |
| 116 |
gpios = <&pinctrl RZT2H_GPIO(6, 7) GPIO_ACTIVE_HIGH>; |
| 117 |
color = <LED_COLOR_ID_YELLOW>; |
| 118 |
function = LED_FUNCTION_DEBUG; |
| 119 |
function-enumerator = <2>; |
| 120 |
}; |
| 121 |
|
| 122 |
#if (!SD1_MICRO_SD) |
| 123 |
led-3 { |
| 124 |
/* SW2-3: OFF */ |
| 125 |
gpios = <&pinctrl RZT2H_GPIO(8, 5) GPIO_ACTIVE_HIGH>; |
| 126 |
color = <LED_COLOR_ID_RED>; |
| 127 |
function = LED_FUNCTION_DEBUG; |
| 128 |
function-enumerator = <3>; |
| 129 |
}; |
| 130 |
#endif |
| 131 |
|
| 132 |
led-4 { |
| 133 |
/* SW8-3: ON, SW8-4: OFF */ |
| 134 |
gpios = <&pinctrl RZT2H_GPIO(18, 0) GPIO_ACTIVE_HIGH>; |
| 135 |
color = <LED_COLOR_ID_GREEN>; |
| 136 |
function = LED_FUNCTION_DEBUG; |
| 137 |
function-enumerator = <4>; |
| 138 |
}; |
| 139 |
|
| 140 |
led-5 { |
| 141 |
/* SW8-1: ON, SW8-2: OFF */ |
| 142 |
gpios = <&pinctrl RZT2H_GPIO(18, 1) GPIO_ACTIVE_HIGH>; |
| 143 |
color = <LED_COLOR_ID_RED>; |
| 144 |
function = LED_FUNCTION_DEBUG; |
| 145 |
function-enumerator = <5>; |
| 146 |
}; |
| 147 |
|
| 148 |
led-6 { |
| 149 |
/* SW5-9: OFF, SW5-10: ON */ |
| 150 |
gpios = <&pinctrl RZT2H_GPIO(22, 7) GPIO_ACTIVE_HIGH>; |
| 151 |
color = <LED_COLOR_ID_GREEN>; |
| 152 |
function = LED_FUNCTION_DEBUG; |
| 153 |
function-enumerator = <6>; |
| 154 |
}; |
| 155 |
|
| 156 |
led-7 { |
| 157 |
/* SW5-7: OFF, SW5-8: ON */ |
| 158 |
gpios = <&pinctrl RZT2H_GPIO(23, 0) GPIO_ACTIVE_HIGH>; |
| 159 |
color = <LED_COLOR_ID_GREEN>; |
| 160 |
function = LED_FUNCTION_DEBUG; |
| 161 |
function-enumerator = <7>; |
| 162 |
}; |
| 163 |
|
| 164 |
led-8 { |
| 165 |
/* SW7-5: OFF, SW7-6: ON */ |
| 166 |
gpios = <&pinctrl RZT2H_GPIO(23, 5) GPIO_ACTIVE_HIGH>; |
| 167 |
color = <LED_COLOR_ID_GREEN>; |
| 168 |
function = LED_FUNCTION_DEBUG; |
| 169 |
function-enumerator = <8>; |
| 170 |
}; |
| 171 |
}; |
| 172 |
}; |
| 173 |
|
| 174 |
&adc2 { |
| 175 |
status = "okay"; |
| 176 |
|
| 177 |
channel@0 { |
| 178 |
reg = <0x0>; |
| 179 |
}; |
| 180 |
|
| 181 |
channel@1 { |
| 182 |
reg = <0x1>; |
| 183 |
}; |
| 184 |
|
| 185 |
channel@2 { |
| 186 |
reg = <0x2>; |
| 187 |
}; |
| 188 |
|
| 189 |
channel@3 { |
| 190 |
reg = <0x3>; |
| 191 |
}; |
| 192 |
|
| 193 |
channel@4 { |
| 194 |
reg = <0x4>; |
| 195 |
}; |
| 196 |
|
| 197 |
channel@5 { |
| 198 |
reg = <0x5>; |
| 199 |
}; |
| 200 |
}; |
| 201 |
|
| 202 |
&canfd { |
| 203 |
pinctrl-0 = <&can0_pins>; |
| 204 |
pinctrl-names = "default"; |
| 205 |
status = "okay"; |
| 206 |
|
| 207 |
channel0 { |
| 208 |
status = "okay"; |
| 209 |
}; |
| 210 |
}; |
| 211 |
|
| 212 |
&i2c0 { |
| 213 |
pinctrl-0 = <&i2c0_pins>; |
| 214 |
pinctrl-names = "default"; |
| 215 |
clock-frequency = <400000>; |
| 216 |
status = "okay"; |
| 217 |
}; |
| 218 |
|
| 219 |
&i2c1 { |
| 220 |
pinctrl-0 = <&i2c1_pins>; |
| 221 |
pinctrl-names = "default"; |
| 222 |
clock-frequency = <400000>; |
| 223 |
status = "okay"; |
| 224 |
}; |
| 225 |
|
| 226 |
&mdio1_phy { |
| 227 |
reset-gpios = <&pinctrl RZT2H_GPIO(32, 3) GPIO_ACTIVE_LOW>; |
| 228 |
}; |
| 229 |
|
| 230 |
&mdio2_phy { |
| 231 |
/* |
| 232 |
* PHY2 Reset Configuration: |
| 233 |
* |
| 234 |
* SW6[1] OFF; SW6[2] ON; SW6[3] OFF - use pin P17_5 for GMAC_RESETOUT2# |
| 235 |
*/ |
| 236 |
reset-gpios = <&pinctrl RZT2H_GPIO(17, 5) GPIO_ACTIVE_LOW>; |
| 237 |
}; |
| 238 |
|
| 239 |
&pinctrl { |
| 240 |
/* |
| 241 |
* CAN0 Pin Configuration: |
| 242 |
* |
| 243 |
* SW7[1] OFF; SW7[2] ON - Use P24_4 as CANTX0. |
| 244 |
* SW7[3] OFF; SW7[4] ON - Use P24_3 as CANRX0. |
| 245 |
*/ |
| 246 |
can0_pins: can0-pins { |
| 247 |
pinmux = <RZT2H_PORT_PINMUX(24, 3, 0x19)>, /* CANRX0 */ |
| 248 |
<RZT2H_PORT_PINMUX(24, 4, 0x19)>; /* CANTX0 */ |
| 249 |
}; |
| 250 |
|
| 251 |
/* |
| 252 |
* GMAC2 Pin Configuration: |
| 253 |
* |
| 254 |
* SW2[6] OFF - connect MDC/MDIO of Ethernet port 2 to GMAC2 |
| 255 |
* SW2[7] ON - use pins P29_1-P29_7, P30_0-P30_4, and P31_2-P31_5 |
| 256 |
* for Ethernet port 2 |
| 257 |
*/ |
| 258 |
gmac2_pins: gmac2-pins { |
| 259 |
pinmux = <RZT2H_PORT_PINMUX(29, 1, 0xf)>, /* ETH2_TXCLK */ |
| 260 |
<RZT2H_PORT_PINMUX(29, 2, 0xf)>, /* ETH2_TXD0 */ |
| 261 |
<RZT2H_PORT_PINMUX(29, 3, 0xf)>, /* ETH2_TXD1 */ |
| 262 |
<RZT2H_PORT_PINMUX(29, 4, 0xf)>, /* ETH2_TXD2 */ |
| 263 |
<RZT2H_PORT_PINMUX(29, 5, 0xf)>, /* ETH2_TXD3 */ |
| 264 |
<RZT2H_PORT_PINMUX(29, 6, 0xf)>, /* ETH2_TXEN */ |
| 265 |
<RZT2H_PORT_PINMUX(29, 7, 0xf)>, /* ETH2_RXCLK */ |
| 266 |
<RZT2H_PORT_PINMUX(30, 0, 0xf)>, /* ETH2_RXD0 */ |
| 267 |
<RZT2H_PORT_PINMUX(30, 1, 0xf)>, /* ETH2_RXD1 */ |
| 268 |
<RZT2H_PORT_PINMUX(30, 2, 0xf)>, /* ETH2_RXD2 */ |
| 269 |
<RZT2H_PORT_PINMUX(30, 3, 0xf)>, /* ETH2_RXD3 */ |
| 270 |
<RZT2H_PORT_PINMUX(30, 4, 0xf)>, /* ETH2_RXDV */ |
| 271 |
<RZT2H_PORT_PINMUX(31, 2, 0xf)>, /* ETH2_TXER */ |
| 272 |
<RZT2H_PORT_PINMUX(31, 3, 0xf)>, /* ETH2_RXER */ |
| 273 |
<RZT2H_PORT_PINMUX(31, 4, 0xf)>, /* ETH2_CRS */ |
| 274 |
<RZT2H_PORT_PINMUX(31, 5, 0xf)>, /* ETH2_COL */ |
| 275 |
<RZT2H_PORT_PINMUX(30, 5, 0x10)>, /* GMAC2_MDC */ |
| 276 |
<RZT2H_PORT_PINMUX(30, 6, 0x10)>, /* GMAC2_MDIO */ |
| 277 |
<RZT2H_PORT_PINMUX(31, 0, 0x2)>; /* ETH2_REFCLK */ |
| 278 |
}; |
| 279 |
|
| 280 |
/* |
| 281 |
* GMAC1 Pin Configuration: |
| 282 |
* |
| 283 |
* SW2[8] ON - use pins P33_2-P33_7, P34_0-P34_5, P34_7 and |
| 284 |
* P35_0-P35_2 for Ethernet port 3 |
| 285 |
*/ |
| 286 |
gmac1_pins: gmac1-pins { |
| 287 |
pinmux = <RZT2H_PORT_PINMUX(33, 2, 0xf)>, /* ETH3_TXCLK */ |
| 288 |
<RZT2H_PORT_PINMUX(33, 3, 0xf)>, /* ETH3_TXD0 */ |
| 289 |
<RZT2H_PORT_PINMUX(33, 4, 0xf)>, /* ETH3_TXD1 */ |
| 290 |
<RZT2H_PORT_PINMUX(33, 5, 0xf)>, /* ETH3_TXD2 */ |
| 291 |
<RZT2H_PORT_PINMUX(33, 6, 0xf)>, /* ETH3_TXD3 */ |
| 292 |
<RZT2H_PORT_PINMUX(33, 7, 0xf)>, /* ETH3_TXEN */ |
| 293 |
<RZT2H_PORT_PINMUX(34, 0, 0xf)>, /* ETH3_RXCLK */ |
| 294 |
<RZT2H_PORT_PINMUX(34, 1, 0xf)>, /* ETH3_RXD0 */ |
| 295 |
<RZT2H_PORT_PINMUX(34, 2, 0xf)>, /* ETH3_RXD1 */ |
| 296 |
<RZT2H_PORT_PINMUX(34, 3, 0xf)>, /* ETH3_RXD2 */ |
| 297 |
<RZT2H_PORT_PINMUX(34, 4, 0xf)>, /* ETH3_RXD3 */ |
| 298 |
<RZT2H_PORT_PINMUX(34, 5, 0xf)>, /* ETH3_RXDV */ |
| 299 |
<RZT2H_PORT_PINMUX(34, 7, 0xf)>, /* ETH3_TXER */ |
| 300 |
<RZT2H_PORT_PINMUX(35, 0, 0xf)>, /* ETH3_RXER */ |
| 301 |
<RZT2H_PORT_PINMUX(35, 1, 0xf)>, /* ETH3_CRS */ |
| 302 |
<RZT2H_PORT_PINMUX(35, 2, 0xf)>, /* ETH3_COL */ |
| 303 |
<RZT2H_PORT_PINMUX(26, 1, 0x10)>, /* GMAC1_MDC */ |
| 304 |
<RZT2H_PORT_PINMUX(26, 2, 0x10)>, /* GMAC1_MDIO */ |
| 305 |
<RZT2H_PORT_PINMUX(34, 6, 0x2)>; /* ETH3_REFCLK */ |
| 306 |
}; |
| 307 |
|
| 308 |
/* |
| 309 |
* I2C0 Pin Configuration: |
| 310 |
* ------------------------ |
| 311 |
* Signal | Pin | SW6 |
| 312 |
* -------|---------|-------------- |
| 313 |
* SCL | P23_3 | 7: ON, 8: OFF |
| 314 |
* SDA | P23_4 | 9: ON, 10: OFF |
| 315 |
*/ |
| 316 |
i2c0_pins: i2c0-pins { |
| 317 |
pinmux = <RZT2H_PORT_PINMUX(23, 3, 0x17)>, |
| 318 |
<RZT2H_PORT_PINMUX(23, 4, 0x17)>; |
| 319 |
}; |
| 320 |
|
| 321 |
i2c1_pins: i2c1-pins { |
| 322 |
pinmux = <RZT2H_PORT_PINMUX(5, 0, 0x17)>, /* SDA */ |
| 323 |
<RZT2H_PORT_PINMUX(4, 7, 0x17)>; /* SCL */ |
| 324 |
}; |
| 325 |
|
| 326 |
#if USB_OTG |
| 327 |
usb-exicen-hog { |
| 328 |
gpio-hog; |
| 329 |
gpios = <RZT2H_GPIO(0, 2) GPIO_ACTIVE_HIGH>; |
| 330 |
output-high; |
| 331 |
line-name = "usb_exicen_a"; |
| 332 |
}; |
| 333 |
#endif |
| 334 |
|
| 335 |
usb_pins: usb-pins { |
| 336 |
pinmux = <RZT2H_PORT_PINMUX(0, 0, 0x13)>, /* VBUSEN */ |
| 337 |
<RZT2H_PORT_PINMUX(0, 1, 0x13)>; /* OVRCUR */ |
| 338 |
}; |
| 339 |
}; |
| 340 |
|