| 1 |
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
| 2 |
/* |
| 3 |
* Device Tree Source for the RZ/N2H 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 "r9a09g087m44.dtsi" |
| 13 |
|
| 14 |
/* |
| 15 |
* SD0 can be connected to either eMMC (U33) or SD card slot CN21 |
| 16 |
* Lets by default enable the eMMC, note we need the below SW settings |
| 17 |
* for eMMC. |
| 18 |
* DSW5[1] = ON; DSW5[2] = ON |
| 19 |
* DSW17[5] = OFF; DSW17[6] = ON |
| 20 |
* |
| 21 |
* To enable SD card and disable eMMC on SDHI0 disable the below macro |
| 22 |
* and set the below switch setting: |
| 23 |
* DSW5[1] = OFF; DSW5[2] = ON |
| 24 |
* P22_6 = SD0_WP; DSW15[1] = OFF; DSW15[2] = ON |
| 25 |
* P22_5 = SD0_CD; DSW15[3] = OFF; DSW15[4] = ON |
| 26 |
* P02_6 = SD0_IOVS; DSW17[5] = OFF; DSW17[6] = ON |
| 27 |
* P02_5 = SD0_PWEN; DSW17[7] = OFF; DSW17[8] = ON |
| 28 |
*/ |
| 29 |
#define SD0_EMMC 1 |
| 30 |
#define SD0_SD (!SD0_EMMC) |
| 31 |
|
| 32 |
/* |
| 33 |
* To enable CANFD interface disable both eMMC and SD card on SDHI0 by |
| 34 |
* setting SD0_EMMC and SD0_SD macros to 0 as pins P12_0 and P12_1 |
| 35 |
* will be used for CANFD interface. |
| 36 |
*/ |
| 37 |
#define CANFD_ENABLE (!SD0_EMMC && !SD0_SD) |
| 38 |
|
| 39 |
/* |
| 40 |
* P17_4 = SD1_CD; DSW5[3] = ON; DSW19[1] = OFF; DSW19[2] = ON |
| 41 |
* P08_6 = SD1_IOVS; DSW5[3] = ON |
| 42 |
* To enable proper operation in 1.8V modes, JP21 must have pins 2 and 3 |
| 43 |
* connected by the jumper. This connects SD1 power-supply control IC output |
| 44 |
* back to VCC1833_7. |
| 45 |
*/ |
| 46 |
#define SD1_MICRO_SD 1 |
| 47 |
|
| 48 |
/* |
| 49 |
* USB Pin Configuration: |
| 50 |
* |
| 51 |
* This board is equipped with three USB connectors: Type-A (CN7), Mini-B |
| 52 |
* (CN8), and Micro-AB (CN9). The RZ/N2H SoC has a single USB channel, so |
| 53 |
* either the USB host interface or the USB function interface can be used, |
| 54 |
* but not both simultaneously when using the CN7 and CN8 connectors. |
| 55 |
* |
| 56 |
* By default, the Type-A (CN7) and Mini-B (CN8) connectors are enabled. |
| 57 |
* Configure the switches as follows: |
| 58 |
* - P02_2 - P02_3 (control signals for USB power supply): DSW2[6] = OFF; |
| 59 |
* - P02_2 (used for VBUSEN): DSW14[5] = OFF; DSW14[6] = ON |
| 60 |
* - P02_3 (used for USB_OVRCUR): DSW14[1] = OFF; DSW14[2] = ON |
| 61 |
* - USB_VBUSIN (used for VBUS of CN8): DSW16[1] = OFF; DSW16[2] = ON |
| 62 |
* - USB_VBUSEN (used for USB_HF_VBUSEN): DSW16[3] = OFF; DSW16[4] = ON |
| 63 |
* |
| 64 |
* To enable the Micro-AB (CN9) USB OTG connector, set the following macro |
| 65 |
* to 1 and configure the switches as follows: |
| 66 |
* - P02_2 - P02_3 (control signals for USB power supply): DSW2[6] = OFF; |
| 67 |
* - P02_2 (used for VBUSEN): DSW14[5] = OFF; DSW14[6] = ON |
| 68 |
* - P02_3 (used for USB_OVRCUR): DSW14[1] = OFF; DSW14[2] = ON |
| 69 |
* - USB_VBUSIN (used for VBUS for OTG): DSW16[1] = ON; DSW16[2] = OFF |
| 70 |
* - USB_VBUSEN (used for USB_OTG_VBUSEN): DSW16[3] = ON; DSW16[4] = OFF |
| 71 |
* - USB_EXICEN (used for USB OTG EXICEN): DSW14[3] = OFF; DSW14[4] = ON |
| 72 |
*/ |
| 73 |
#define USB_OTG 0 |
| 74 |
|
| 75 |
#include "rzt2h-n2h-evk-common.dtsi" |
| 76 |
|
| 77 |
/* |
| 78 |
* I2C0 and LED8/9 share the same pins use the below |
| 79 |
* macro to choose (and set approopriate DIP switches). |
| 80 |
*/ |
| 81 |
#define I2C0 1 |
| 82 |
#define LED8 (!I2C0) |
| 83 |
#define LED9 (!I2C0) |
| 84 |
|
| 85 |
/ { |
| 86 |
model = "Renesas RZ/N2H EVK Board based on r9a09g087m44"; |
| 87 |
compatible = "renesas,rzn2h-evk", "renesas,r9a09g087m44", "renesas,r9a09g087"; |
| 88 |
|
| 89 |
keys { |
| 90 |
compatible = "gpio-keys"; |
| 91 |
|
| 92 |
key-1 { |
| 93 |
interrupts-extended = <&pinctrl RZT2H_GPIO(18, 2) IRQ_TYPE_EDGE_FALLING>; |
| 94 |
linux,code = <KEY_1>; |
| 95 |
label = "SW2"; |
| 96 |
wakeup-source; |
| 97 |
debounce-interval = <20>; |
| 98 |
}; |
| 99 |
|
| 100 |
key-2 { |
| 101 |
interrupts-extended = <&pinctrl RZT2H_GPIO(0, 4) IRQ_TYPE_EDGE_FALLING>; |
| 102 |
linux,code = <KEY_2>; |
| 103 |
label = "SW3"; |
| 104 |
wakeup-source; |
| 105 |
debounce-interval = <20>; |
| 106 |
}; |
| 107 |
|
| 108 |
key-3 { |
| 109 |
interrupts-extended = <&pinctrl RZT2H_GPIO(18, 7) IRQ_TYPE_EDGE_FALLING>; |
| 110 |
linux,code = <KEY_3>; |
| 111 |
label = "SW4"; |
| 112 |
wakeup-source; |
| 113 |
debounce-interval = <20>; |
| 114 |
}; |
| 115 |
}; |
| 116 |
|
| 117 |
leds { |
| 118 |
compatible = "gpio-leds"; |
| 119 |
|
| 120 |
led-3 { |
| 121 |
/* DSW18-7: ON, DSW18-8: OFF */ |
| 122 |
gpios = <&pinctrl RZT2H_GPIO(31, 6) GPIO_ACTIVE_HIGH>; |
| 123 |
color = <LED_COLOR_ID_GREEN>; |
| 124 |
function = LED_FUNCTION_DEBUG; |
| 125 |
function-enumerator = <4>; |
| 126 |
}; |
| 127 |
|
| 128 |
led-4 { |
| 129 |
/* DSW18-9: ON, DSW18-10: OFF */ |
| 130 |
gpios = <&pinctrl RZT2H_GPIO(18, 1) GPIO_ACTIVE_HIGH>; |
| 131 |
color = <LED_COLOR_ID_RED>; |
| 132 |
function = LED_FUNCTION_DEBUG; |
| 133 |
function-enumerator = <5>; |
| 134 |
}; |
| 135 |
|
| 136 |
led-5 { |
| 137 |
/* DSW18-1: ON, DSW18-2: OFF */ |
| 138 |
gpios = <&pinctrl RZT2H_GPIO(22, 7) GPIO_ACTIVE_HIGH>; |
| 139 |
color = <LED_COLOR_ID_GREEN>; |
| 140 |
function = LED_FUNCTION_DEBUG; |
| 141 |
function-enumerator = <6>; |
| 142 |
}; |
| 143 |
|
| 144 |
led-6 { |
| 145 |
/* DSW18-3: ON, DSW18-4: OFF */ |
| 146 |
gpios = <&pinctrl RZT2H_GPIO(23, 0) GPIO_ACTIVE_HIGH>; |
| 147 |
color = <LED_COLOR_ID_GREEN>; |
| 148 |
function = LED_FUNCTION_DEBUG; |
| 149 |
function-enumerator = <7>; |
| 150 |
}; |
| 151 |
|
| 152 |
led-7 { |
| 153 |
/* |
| 154 |
* DSW18-5: ON, DSW18-6: OFF |
| 155 |
* DSW19-3: OFF, DSW19-4: ON |
| 156 |
*/ |
| 157 |
gpios = <&pinctrl RZT2H_GPIO(14, 3) GPIO_ACTIVE_HIGH>; |
| 158 |
color = <LED_COLOR_ID_GREEN>; |
| 159 |
function = LED_FUNCTION_DEBUG; |
| 160 |
function-enumerator = <8>; |
| 161 |
}; |
| 162 |
|
| 163 |
#if LED8 |
| 164 |
led-8 { |
| 165 |
/* |
| 166 |
* USER_LED0 |
| 167 |
* DSW15-8: OFF, DSW15-9: OFF, DSW15-10: ON |
| 168 |
*/ |
| 169 |
gpios = <&pinctrl RZT2H_GPIO(14, 6) GPIO_ACTIVE_HIGH>; |
| 170 |
color = <LED_COLOR_ID_GREEN>; |
| 171 |
function = LED_FUNCTION_DEBUG; |
| 172 |
function-enumerator = <0>; |
| 173 |
}; |
| 174 |
#endif |
| 175 |
|
| 176 |
#if LED9 |
| 177 |
led-9 { |
| 178 |
/* |
| 179 |
* USER_LED1 |
| 180 |
* DSW15-5: OFF, DSW15-6: ON |
| 181 |
*/ |
| 182 |
gpios = <&pinctrl RZT2H_GPIO(14, 7) GPIO_ACTIVE_HIGH>; |
| 183 |
color = <LED_COLOR_ID_GREEN>; |
| 184 |
function = LED_FUNCTION_DEBUG; |
| 185 |
function-enumerator = <1>; |
| 186 |
}; |
| 187 |
#endif |
| 188 |
|
| 189 |
led-10 { |
| 190 |
/* |
| 191 |
* USER_LED2 |
| 192 |
* DSW17-3: OFF, DSW17-4: ON |
| 193 |
*/ |
| 194 |
gpios = <&pinctrl RZT2H_GPIO(2, 7) GPIO_ACTIVE_HIGH>; |
| 195 |
color = <LED_COLOR_ID_YELLOW>; |
| 196 |
function = LED_FUNCTION_DEBUG; |
| 197 |
function-enumerator = <2>; |
| 198 |
}; |
| 199 |
|
| 200 |
led-11 { |
| 201 |
/* |
| 202 |
* USER_LED3 |
| 203 |
* DSW17-1: OFF, DSW17-2: ON |
| 204 |
*/ |
| 205 |
gpios = <&pinctrl RZT2H_GPIO(3, 0) GPIO_ACTIVE_HIGH>; |
| 206 |
color = <LED_COLOR_ID_RED>; |
| 207 |
function = LED_FUNCTION_DEBUG; |
| 208 |
function-enumerator = <3>; |
| 209 |
}; |
| 210 |
}; |
| 211 |
}; |
| 212 |
|
| 213 |
&adc2 { |
| 214 |
status = "okay"; |
| 215 |
|
| 216 |
channel@0 { |
| 217 |
reg = <0x0>; |
| 218 |
}; |
| 219 |
|
| 220 |
channel@1 { |
| 221 |
reg = <0x1>; |
| 222 |
}; |
| 223 |
|
| 224 |
channel@2 { |
| 225 |
reg = <0x2>; |
| 226 |
}; |
| 227 |
|
| 228 |
channel@3 { |
| 229 |
reg = <0x3>; |
| 230 |
}; |
| 231 |
|
| 232 |
channel@4 { |
| 233 |
reg = <0x4>; |
| 234 |
}; |
| 235 |
|
| 236 |
channel@5 { |
| 237 |
reg = <0x5>; |
| 238 |
}; |
| 239 |
|
| 240 |
channel@6 { |
| 241 |
reg = <0x6>; |
| 242 |
}; |
| 243 |
|
| 244 |
channel@7 { |
| 245 |
reg = <0x7>; |
| 246 |
}; |
| 247 |
|
| 248 |
channel@8 { |
| 249 |
reg = <0x8>; |
| 250 |
}; |
| 251 |
|
| 252 |
channel@9 { |
| 253 |
reg = <0x9>; |
| 254 |
}; |
| 255 |
|
| 256 |
channel@a { |
| 257 |
reg = <0xa>; |
| 258 |
}; |
| 259 |
|
| 260 |
channel@b { |
| 261 |
reg = <0xb>; |
| 262 |
}; |
| 263 |
|
| 264 |
channel@c { |
| 265 |
reg = <0xc>; |
| 266 |
}; |
| 267 |
|
| 268 |
channel@d { |
| 269 |
reg = <0xd>; |
| 270 |
}; |
| 271 |
|
| 272 |
channel@e { |
| 273 |
reg = <0xe>; |
| 274 |
}; |
| 275 |
}; |
| 276 |
|
| 277 |
#if CANFD_ENABLE |
| 278 |
&canfd { |
| 279 |
pinctrl-0 = <&can1_pins>; |
| 280 |
pinctrl-names = "default"; |
| 281 |
status = "okay"; |
| 282 |
|
| 283 |
channel1 { |
| 284 |
status = "okay"; |
| 285 |
}; |
| 286 |
}; |
| 287 |
#endif |
| 288 |
|
| 289 |
#if I2C0 |
| 290 |
&i2c0 { |
| 291 |
pinctrl-0 = <&i2c0_pins>; |
| 292 |
pinctrl-names = "default"; |
| 293 |
clock-frequency = <400000>; |
| 294 |
status = "okay"; |
| 295 |
}; |
| 296 |
#endif |
| 297 |
|
| 298 |
&i2c1 { |
| 299 |
pinctrl-0 = <&i2c1_pins>; |
| 300 |
pinctrl-names = "default"; |
| 301 |
clock-frequency = <400000>; |
| 302 |
status = "okay"; |
| 303 |
}; |
| 304 |
|
| 305 |
&mdio1_phy { |
| 306 |
/* |
| 307 |
* PHY3 Reset Configuration: |
| 308 |
* |
| 309 |
* DSW12[5] OFF; DSW12[6] ON - use pin P03_2 for GMAC_RESETOUT3# |
| 310 |
*/ |
| 311 |
reset-gpios = <&pinctrl RZT2H_GPIO(3, 2) GPIO_ACTIVE_LOW>; |
| 312 |
}; |
| 313 |
|
| 314 |
&mdio2_phy { |
| 315 |
/* |
| 316 |
* PHY2 Reset Configuration: |
| 317 |
* |
| 318 |
* DSW8[1] ON; DSW8[2] OFF; DSW12[7] OFF; DSW12[8] ON - use pin |
| 319 |
* P03_1 for GMAC_RESETOUT2# |
| 320 |
*/ |
| 321 |
reset-gpios = <&pinctrl RZT2H_GPIO(3, 1) GPIO_ACTIVE_LOW>; |
| 322 |
}; |
| 323 |
|
| 324 |
&pinctrl { |
| 325 |
/* |
| 326 |
* CAN1 Pin Configuration: |
| 327 |
* |
| 328 |
* DSW5[1] ON; DSW5[2] OFF - Use P12_0 and P12_1 for CAN1 interface. |
| 329 |
*/ |
| 330 |
can1_pins: can1-pins { |
| 331 |
pinmux = <RZT2H_PORT_PINMUX(12, 0, 0x19)>, /* CANRX1 */ |
| 332 |
<RZT2H_PORT_PINMUX(12, 1, 0x19)>; /* CANTX1 */ |
| 333 |
}; |
| 334 |
|
| 335 |
/* |
| 336 |
* GMAC2 Pin Configuration: |
| 337 |
* |
| 338 |
* DSW5[6] OFF - connect MDC/MDIO of Ethernet port 2 to GMAC2 |
| 339 |
* DSW5[7] ON - use pins P29_1-P29_7, P30_0-P30_4, P30_7, |
| 340 |
* P31_2, P31_4 and P31_5 are used for Ethernet port 2 |
| 341 |
*/ |
| 342 |
gmac2_pins: gmac2-pins { |
| 343 |
pinmux = <RZT2H_PORT_PINMUX(29, 1, 0xf)>, /* ETH2_TXCLK */ |
| 344 |
<RZT2H_PORT_PINMUX(29, 2, 0xf)>, /* ETH2_TXD0 */ |
| 345 |
<RZT2H_PORT_PINMUX(29, 3, 0xf)>, /* ETH2_TXD1 */ |
| 346 |
<RZT2H_PORT_PINMUX(29, 4, 0xf)>, /* ETH2_TXD2 */ |
| 347 |
<RZT2H_PORT_PINMUX(29, 5, 0xf)>, /* ETH2_TXD3 */ |
| 348 |
<RZT2H_PORT_PINMUX(29, 6, 0xf)>, /* ETH2_TXEN */ |
| 349 |
<RZT2H_PORT_PINMUX(29, 7, 0xf)>, /* ETH2_RXCLK */ |
| 350 |
<RZT2H_PORT_PINMUX(30, 0, 0xf)>, /* ETH2_RXD0 */ |
| 351 |
<RZT2H_PORT_PINMUX(30, 1, 0xf)>, /* ETH2_RXD1 */ |
| 352 |
<RZT2H_PORT_PINMUX(30, 2, 0xf)>, /* ETH2_RXD2 */ |
| 353 |
<RZT2H_PORT_PINMUX(30, 3, 0xf)>, /* ETH2_RXD3 */ |
| 354 |
<RZT2H_PORT_PINMUX(30, 4, 0xf)>, /* ETH2_RXDV */ |
| 355 |
<RZT2H_PORT_PINMUX(31, 2, 0xf)>, /* ETH2_TXER */ |
| 356 |
<RZT2H_PORT_PINMUX(31, 1, 0xf)>, /* ETH2_RXER */ |
| 357 |
<RZT2H_PORT_PINMUX(31, 4, 0xf)>, /* ETH2_CRS */ |
| 358 |
<RZT2H_PORT_PINMUX(31, 5, 0xf)>, /* ETH2_COL */ |
| 359 |
<RZT2H_PORT_PINMUX(30, 5, 0x10)>, /* GMAC2_MDC */ |
| 360 |
<RZT2H_PORT_PINMUX(30, 6, 0x10)>, /* GMAC2_MDIO */ |
| 361 |
<RZT2H_PORT_PINMUX(31, 0, 0x2)>; /* ETH2_REFCLK */ |
| 362 |
|
| 363 |
}; |
| 364 |
|
| 365 |
/* |
| 366 |
* GMAC2 Pin Configuration: |
| 367 |
* |
| 368 |
* DSW5[8] ON - use pins P00_0-P00_2, P33_2-P33_7, P34_0-P34_6 |
| 369 |
* for Ethernet port 3 |
| 370 |
* DSW12[1] OFF; DSW12[2] ON - use pin P00_3 for Ethernet port 3 |
| 371 |
*/ |
| 372 |
gmac1_pins: gmac1-pins { |
| 373 |
pinmux = <RZT2H_PORT_PINMUX(33, 2, 0xf)>, /* ETH3_TXCLK */ |
| 374 |
<RZT2H_PORT_PINMUX(33, 3, 0xf)>, /* ETH3_TXD0 */ |
| 375 |
<RZT2H_PORT_PINMUX(33, 4, 0xf)>, /* ETH3_TXD0 */ |
| 376 |
<RZT2H_PORT_PINMUX(33, 5, 0xf)>, /* ETH3_TXD2 */ |
| 377 |
<RZT2H_PORT_PINMUX(33, 6, 0xf)>, /* ETH3_TXD3 */ |
| 378 |
<RZT2H_PORT_PINMUX(33, 7, 0xf)>, /* ETH3_TXEN */ |
| 379 |
<RZT2H_PORT_PINMUX(34, 0, 0xf)>, /* ETH3_RXCLK */ |
| 380 |
<RZT2H_PORT_PINMUX(34, 1, 0xf)>, /* ETH3_RXD0 */ |
| 381 |
<RZT2H_PORT_PINMUX(34, 2, 0xf)>, /* ETH3_RXD1 */ |
| 382 |
<RZT2H_PORT_PINMUX(34, 3, 0xf)>, /* ETH3_RXD2 */ |
| 383 |
<RZT2H_PORT_PINMUX(34, 4, 0xf)>, /* ETH3_RXD3 */ |
| 384 |
<RZT2H_PORT_PINMUX(34, 5, 0xf)>, /* ETH3_RXDV */ |
| 385 |
<RZT2H_PORT_PINMUX(0, 0, 0xf)>, /* ETH3_TXER */ |
| 386 |
<RZT2H_PORT_PINMUX(0, 1, 0xf)>, /* ETH3_RXER */ |
| 387 |
<RZT2H_PORT_PINMUX(0, 2, 0xf)>, /* ETH3_CRS */ |
| 388 |
<RZT2H_PORT_PINMUX(0, 3, 0xf)>, /* ETH3_COL */ |
| 389 |
<RZT2H_PORT_PINMUX(26, 1, 0x10)>, /* GMAC1_MDC */ |
| 390 |
<RZT2H_PORT_PINMUX(26, 2, 0x10)>, /* GMAC1_MDIO */ |
| 391 |
<RZT2H_PORT_PINMUX(34, 6, 0x2)>; /* ETH3_REFCLK */ |
| 392 |
}; |
| 393 |
|
| 394 |
/* |
| 395 |
* I2C0 Pin Configuration: |
| 396 |
* ------------------------ |
| 397 |
* Signal | Pin | DSW15 |
| 398 |
* -------|---------|-------------- |
| 399 |
* SCL | P14_6 | 8: OFF, 9: ON, 10: OFF |
| 400 |
* SDA | P14_7 | 5: ON, 6: OFF |
| 401 |
*/ |
| 402 |
i2c0_pins: i2c0-pins { |
| 403 |
pinmux = <RZT2H_PORT_PINMUX(14, 6, 0x17)>, |
| 404 |
<RZT2H_PORT_PINMUX(14, 7, 0x17)>; |
| 405 |
}; |
| 406 |
|
| 407 |
/* |
| 408 |
* I2C1 Pin Configuration: |
| 409 |
* ------------------------ |
| 410 |
* Signal | Pin | DSW7 |
| 411 |
* -------|---------|-------------- |
| 412 |
* SCL | P03_3 | 1: ON, 2: OFF |
| 413 |
* SDA | P03_4 | 3: ON, 4: OFF |
| 414 |
*/ |
| 415 |
i2c1_pins: i2c1-pins { |
| 416 |
pinmux = <RZT2H_PORT_PINMUX(3, 3, 0x17)>, |
| 417 |
<RZT2H_PORT_PINMUX(3, 4, 0x17)>; |
| 418 |
}; |
| 419 |
|
| 420 |
#if USB_OTG |
| 421 |
usb-exicen-hog { |
| 422 |
gpio-hog; |
| 423 |
gpios = <RZT2H_GPIO(2, 4) GPIO_ACTIVE_HIGH>; |
| 424 |
output-high; |
| 425 |
line-name = "usb_exicen_a"; |
| 426 |
}; |
| 427 |
#endif |
| 428 |
|
| 429 |
usb_pins: usb-pins { |
| 430 |
pinmux = <RZT2H_PORT_PINMUX(2, 2, 0x13)>, /* VBUSEN */ |
| 431 |
<RZT2H_PORT_PINMUX(2, 3, 0x13)>; /* OVRCUR */ |
| 432 |
}; |
| 433 |
}; |
| 434 |
|