| 1 |
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
| 2 |
/* |
| 3 |
* Common Device Tree Source for the RZ/T2H and RZ/N2H EVK boards. |
| 4 |
* |
| 5 |
* Copyright (C) 2025 Renesas Electronics Corp. |
| 6 |
*/ |
| 7 |
|
| 8 |
#include <dt-bindings/gpio/gpio.h> |
| 9 |
#include <dt-bindings/leds/common.h> |
| 10 |
#include <dt-bindings/net/mscc-phy-vsc8531.h> |
| 11 |
#include <dt-bindings/net/renesas,r9a09g077-pcs-miic.h> |
| 12 |
#include <dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h> |
| 13 |
|
| 14 |
/ { |
| 15 |
aliases { |
| 16 |
ethernet3 = &gmac1; |
| 17 |
ethernet2 = &gmac2; |
| 18 |
i2c0 = &i2c0; |
| 19 |
i2c1 = &i2c1; |
| 20 |
mmc0 = &sdhi0; |
| 21 |
mmc1 = &sdhi1; |
| 22 |
serial0 = &sci0; |
| 23 |
}; |
| 24 |
|
| 25 |
chosen { |
| 26 |
stdout-path = "serial0:115200n8"; |
| 27 |
}; |
| 28 |
|
| 29 |
reg_1p8v: regulator-1p8v { |
| 30 |
compatible = "regulator-fixed"; |
| 31 |
regulator-name = "fixed-1.8V"; |
| 32 |
regulator-min-microvolt = <1800000>; |
| 33 |
regulator-max-microvolt = <1800000>; |
| 34 |
regulator-boot-on; |
| 35 |
regulator-always-on; |
| 36 |
}; |
| 37 |
|
| 38 |
reg_3p3v: regulator-3p3v { |
| 39 |
compatible = "regulator-fixed"; |
| 40 |
regulator-name = "fixed-3.3V"; |
| 41 |
regulator-min-microvolt = <3300000>; |
| 42 |
regulator-max-microvolt = <3300000>; |
| 43 |
regulator-boot-on; |
| 44 |
regulator-always-on; |
| 45 |
}; |
| 46 |
|
| 47 |
#if SD0_SD |
| 48 |
vqmmc_sdhi0: regulator-vqmmc-sdhi0 { |
| 49 |
compatible = "regulator-gpio"; |
| 50 |
regulator-name = "SDHI0 VqmmC"; |
| 51 |
gpios = <&pinctrl RZT2H_GPIO(2, 6) GPIO_ACTIVE_HIGH>; |
| 52 |
regulator-min-microvolt = <1800000>; |
| 53 |
regulator-max-microvolt = <3300000>; |
| 54 |
gpios-states = <0>; |
| 55 |
states = <3300000 0>, <1800000 1>; |
| 56 |
regulator-ramp-delay = <60>; |
| 57 |
}; |
| 58 |
#endif |
| 59 |
|
| 60 |
#if SD1_MICRO_SD |
| 61 |
vccq_sdhi1: regulator-vccq-sdhi1 { |
| 62 |
compatible = "regulator-gpio"; |
| 63 |
regulator-name = "SDHI1 VccQ"; |
| 64 |
regulator-min-microvolt = <1800000>; |
| 65 |
regulator-max-microvolt = <3300000>; |
| 66 |
gpios = <&pinctrl RZT2H_GPIO(8, 6) GPIO_ACTIVE_HIGH>; |
| 67 |
gpios-states = <0>; |
| 68 |
states = <3300000 0>, <1800000 1>; |
| 69 |
}; |
| 70 |
#endif |
| 71 |
}; |
| 72 |
|
| 73 |
/* |
| 74 |
* ADC0 AN000 can be connected to a potentiometer on the board or |
| 75 |
* exposed on ADC header. |
| 76 |
* |
| 77 |
* T2H: |
| 78 |
* SW17[1] = ON, SW17[2] = OFF - Potentiometer |
| 79 |
* SW17[1] = OFF, SW17[2] = ON - CN41 header |
| 80 |
* N2H: |
| 81 |
* DSW6[1] = OFF, DSW6[2] = ON - Potentiometer |
| 82 |
* DSW6[1] = ON, DSW6[2] = OFF - CN3 header |
| 83 |
*/ |
| 84 |
&adc0 { |
| 85 |
status = "okay"; |
| 86 |
|
| 87 |
channel@0 { |
| 88 |
reg = <0x0>; |
| 89 |
}; |
| 90 |
|
| 91 |
channel@1 { |
| 92 |
reg = <0x1>; |
| 93 |
}; |
| 94 |
|
| 95 |
channel@2 { |
| 96 |
reg = <0x2>; |
| 97 |
}; |
| 98 |
|
| 99 |
channel@3 { |
| 100 |
reg = <0x3>; |
| 101 |
}; |
| 102 |
}; |
| 103 |
|
| 104 |
/* |
| 105 |
* ADC1 AN100 can be exposed on ADC header or on mikroBUS connector. |
| 106 |
* |
| 107 |
* T2H: |
| 108 |
* SW18[1] = ON, SW18[2] = OFF - CN42 header |
| 109 |
* SW18[1] = OFF, SW18[2] = ON - mikroBUS |
| 110 |
* N2H: |
| 111 |
* DSW6[3] = ON, DSW6[4] = OFF - CN4 header |
| 112 |
* DSW6[3] = OFF, DSW6[4] = ON - mikroBUS |
| 113 |
* |
| 114 |
* ADC1 AN101 can be exposed on ADC header or on Grove2 connector. |
| 115 |
* |
| 116 |
* T2H: |
| 117 |
* SW18[3] = ON, SW18[4] = OFF - CN42 header |
| 118 |
* SW18[3] = OFF, SW18[4] = ON - Grove2 |
| 119 |
* N2H: |
| 120 |
* DSW6[5] = ON, DSW6[6] = OFF - CN4 header |
| 121 |
* DSW6[5] = OFF, DSW6[6] = ON - Grove2 |
| 122 |
* |
| 123 |
* ADC1 AN102 can be exposed on ADC header or on Grove2 connector. |
| 124 |
* |
| 125 |
* T2H: |
| 126 |
* SW18[5] = ON, SW18[6] = OFF - CN42 header |
| 127 |
* SW18[5] = OFF, SW18[6] = ON - Grove2 |
| 128 |
* N2H: |
| 129 |
* DSW6[7] = ON, DSW6[8] = OFF - CN4 header |
| 130 |
* DSW6[7] = OFF, DSW6[8] = ON - Grove2 |
| 131 |
*/ |
| 132 |
&adc1 { |
| 133 |
status = "okay"; |
| 134 |
|
| 135 |
channel@0 { |
| 136 |
reg = <0x0>; |
| 137 |
}; |
| 138 |
|
| 139 |
channel@1 { |
| 140 |
reg = <0x1>; |
| 141 |
}; |
| 142 |
|
| 143 |
channel@2 { |
| 144 |
reg = <0x2>; |
| 145 |
}; |
| 146 |
|
| 147 |
channel@3 { |
| 148 |
reg = <0x3>; |
| 149 |
}; |
| 150 |
}; |
| 151 |
|
| 152 |
&ehci { |
| 153 |
dr_mode = "otg"; |
| 154 |
status = "okay"; |
| 155 |
}; |
| 156 |
|
| 157 |
ðss { |
| 158 |
status = "okay"; |
| 159 |
|
| 160 |
renesas,miic-switch-portin = <ETHSS_GMAC0_PORT>; |
| 161 |
}; |
| 162 |
|
| 163 |
&extal_clk { |
| 164 |
clock-frequency = <25000000>; |
| 165 |
}; |
| 166 |
|
| 167 |
&gmac1 { |
| 168 |
pinctrl-0 = <&gmac1_pins>; |
| 169 |
pinctrl-names = "default"; |
| 170 |
phy-handle = <&mdio1_phy>; |
| 171 |
phy-mode = "rgmii-id"; |
| 172 |
pcs-handle = <&mii_conv3>; |
| 173 |
status = "okay"; |
| 174 |
}; |
| 175 |
|
| 176 |
&gmac2 { |
| 177 |
pinctrl-0 = <&gmac2_pins>; |
| 178 |
pinctrl-names = "default"; |
| 179 |
phy-handle = <&mdio2_phy>; |
| 180 |
phy-mode = "rgmii-id"; |
| 181 |
pcs-handle = <&mii_conv2>; |
| 182 |
status = "okay"; |
| 183 |
}; |
| 184 |
|
| 185 |
&hsusb { |
| 186 |
dr_mode = "otg"; |
| 187 |
status = "okay"; |
| 188 |
}; |
| 189 |
|
| 190 |
&i2c0 { |
| 191 |
eeprom: eeprom@50 { |
| 192 |
compatible = "renesas,r1ex24016", "atmel,24c16"; |
| 193 |
reg = <0x50>; |
| 194 |
pagesize = <16>; |
| 195 |
}; |
| 196 |
}; |
| 197 |
|
| 198 |
&mdio1 { |
| 199 |
mdio1_phy: ethernet-phy@3 { |
| 200 |
compatible = "ethernet-phy-id0007.0772", "ethernet-phy-ieee802.3-c22"; |
| 201 |
reg = <3>; |
| 202 |
vsc8531,led-0-mode = <VSC8531_ACTIVITY>; |
| 203 |
vsc8531,led-1-mode = <VSC8531_LINK_ACTIVITY>; |
| 204 |
reset-assert-us = <2000>; |
| 205 |
reset-deassert-us = <15000>; |
| 206 |
}; |
| 207 |
}; |
| 208 |
|
| 209 |
&mdio2 { |
| 210 |
mdio2_phy: ethernet-phy@2 { |
| 211 |
compatible = "ethernet-phy-id0007.0772", "ethernet-phy-ieee802.3-c22"; |
| 212 |
reg = <2>; |
| 213 |
vsc8531,led-0-mode = <VSC8531_ACTIVITY>; |
| 214 |
vsc8531,led-1-mode = <VSC8531_LINK_ACTIVITY>; |
| 215 |
reset-assert-us = <2000>; |
| 216 |
reset-deassert-us = <15000>; |
| 217 |
}; |
| 218 |
}; |
| 219 |
|
| 220 |
&mii_conv0 { |
| 221 |
renesas,miic-input = <ETHSS_ETHSW_PORT0>; |
| 222 |
status = "okay"; |
| 223 |
}; |
| 224 |
|
| 225 |
&mii_conv1 { |
| 226 |
renesas,miic-input = <ETHSS_ETHSW_PORT1>; |
| 227 |
status = "okay"; |
| 228 |
}; |
| 229 |
|
| 230 |
&mii_conv2 { |
| 231 |
renesas,miic-input = <ETHSS_GMAC2_PORT>; |
| 232 |
status = "okay"; |
| 233 |
}; |
| 234 |
|
| 235 |
&mii_conv3 { |
| 236 |
renesas,miic-input = <ETHSS_GMAC1_PORT>; |
| 237 |
status = "okay"; |
| 238 |
}; |
| 239 |
|
| 240 |
&ohci { |
| 241 |
dr_mode = "otg"; |
| 242 |
status = "okay"; |
| 243 |
}; |
| 244 |
|
| 245 |
&pinctrl { |
| 246 |
/* |
| 247 |
* SCI0 Pin Configuration: |
| 248 |
* ------------------------ |
| 249 |
* Signal | Pin | RZ/T2H (SW4) | RZ/N2H (DSW9) |
| 250 |
* -----------|---------|--------------|--------------- |
| 251 |
* SCI0_RXD | P27_4 | 5: ON, 6: OFF| 1: ON, 2: OFF |
| 252 |
* SCI0_TXD | P27_5 | 7: ON, 8: OFF| 3: ON, 4: OFF |
| 253 |
*/ |
| 254 |
sci0_pins: sci0-pins { |
| 255 |
pinmux = <RZT2H_PORT_PINMUX(27, 4, 0x14)>, |
| 256 |
<RZT2H_PORT_PINMUX(27, 5, 0x14)>; |
| 257 |
}; |
| 258 |
|
| 259 |
#if SD0_EMMC |
| 260 |
sdhi0-emmc-iovs-hog { |
| 261 |
gpio-hog; |
| 262 |
gpios = <RZT2H_GPIO(2, 6) GPIO_ACTIVE_HIGH>; |
| 263 |
output-high; |
| 264 |
line-name = "SD0_IOVS"; |
| 265 |
}; |
| 266 |
#endif |
| 267 |
|
| 268 |
sdhi0_emmc_pins: sd0-emmc-group { |
| 269 |
data-pins { |
| 270 |
pinmux = <RZT2H_PORT_PINMUX(12, 2, 0x29)>, /* SD0_DATA0 */ |
| 271 |
<RZT2H_PORT_PINMUX(12, 3, 0x29)>, /* SD0_DATA1 */ |
| 272 |
<RZT2H_PORT_PINMUX(12, 4, 0x29)>, /* SD0_DATA2 */ |
| 273 |
<RZT2H_PORT_PINMUX(12, 5, 0x29)>, /* SD0_DATA3 */ |
| 274 |
<RZT2H_PORT_PINMUX(12, 6, 0x29)>, /* SD0_DATA4 */ |
| 275 |
<RZT2H_PORT_PINMUX(12, 7, 0x29)>, /* SD0_DATA5 */ |
| 276 |
<RZT2H_PORT_PINMUX(13, 0, 0x29)>, /* SD0_DATA6 */ |
| 277 |
<RZT2H_PORT_PINMUX(13, 1, 0x29)>; /* SD0_DATA7 */ |
| 278 |
}; |
| 279 |
|
| 280 |
ctrl-pins { |
| 281 |
pinmux = <RZT2H_PORT_PINMUX(12, 0, 0x29)>, /* SD0_CLK */ |
| 282 |
<RZT2H_PORT_PINMUX(12, 1, 0x29)>, /* SD0_CMD */ |
| 283 |
<RZT2H_PORT_PINMUX(13, 2, 0x29)>; /* SD0_RST# */ |
| 284 |
}; |
| 285 |
}; |
| 286 |
|
| 287 |
#if SD0_SD |
| 288 |
sdhi0-pwen-hog { |
| 289 |
gpio-hog; |
| 290 |
gpios = <RZT2H_GPIO(2, 5) GPIO_ACTIVE_HIGH>; |
| 291 |
output-high; |
| 292 |
line-name = "SD0_PWEN"; |
| 293 |
}; |
| 294 |
#endif |
| 295 |
|
| 296 |
sdhi0_sd_pins: sd0-sd-group { |
| 297 |
data-pins { |
| 298 |
pinmux = <RZT2H_PORT_PINMUX(12, 2, 0x29)>, /* SD0_DATA0 */ |
| 299 |
<RZT2H_PORT_PINMUX(12, 3, 0x29)>, /* SD0_DATA1 */ |
| 300 |
<RZT2H_PORT_PINMUX(12, 4, 0x29)>, /* SD0_DATA2 */ |
| 301 |
<RZT2H_PORT_PINMUX(12, 5, 0x29)>; /* SD0_DATA3 */ |
| 302 |
}; |
| 303 |
|
| 304 |
ctrl-pins { |
| 305 |
pinmux = <RZT2H_PORT_PINMUX(12, 0, 0x29)>, /* SD0_CLK */ |
| 306 |
<RZT2H_PORT_PINMUX(12, 1, 0x29)>, /* SD0_CMD */ |
| 307 |
<RZT2H_PORT_PINMUX(22, 5, 0x29)>; /* SD0_CD */ |
| 308 |
}; |
| 309 |
}; |
| 310 |
|
| 311 |
#if SD1_MICRO_SD |
| 312 |
sdhi1-pwen-hog { |
| 313 |
gpio-hog; |
| 314 |
gpios = <RZT2H_GPIO(8, 5) GPIO_ACTIVE_HIGH>; |
| 315 |
output-high; |
| 316 |
line-name = "SD1_PWEN"; |
| 317 |
}; |
| 318 |
#endif |
| 319 |
|
| 320 |
sdhi1_pins: sd1-group { |
| 321 |
data-pins { |
| 322 |
pinmux = <RZT2H_PORT_PINMUX(16, 7, 0x29)>, /* SD1_DATA0 */ |
| 323 |
<RZT2H_PORT_PINMUX(17, 0, 0x29)>, /* SD1_DATA1 */ |
| 324 |
<RZT2H_PORT_PINMUX(17, 1, 0x29)>, /* SD1_DATA2 */ |
| 325 |
<RZT2H_PORT_PINMUX(17, 2, 0x29)>; /* SD1_DATA3 */ |
| 326 |
}; |
| 327 |
|
| 328 |
ctrl-pins { |
| 329 |
pinmux = <RZT2H_PORT_PINMUX(16, 5, 0x29)>, /* SD1_CLK */ |
| 330 |
<RZT2H_PORT_PINMUX(16, 6, 0x29)>, /* SD1_CMD */ |
| 331 |
<RZT2H_PORT_PINMUX(17, 4, 0x29)>; /* SD1_CD */ |
| 332 |
}; |
| 333 |
}; |
| 334 |
}; |
| 335 |
|
| 336 |
&sci0 { |
| 337 |
pinctrl-0 = <&sci0_pins>; |
| 338 |
pinctrl-names = "default"; |
| 339 |
status = "okay"; |
| 340 |
}; |
| 341 |
|
| 342 |
#if SD0_EMMC |
| 343 |
&sdhi0 { |
| 344 |
pinctrl-0 = <&sdhi0_emmc_pins>; |
| 345 |
pinctrl-1 = <&sdhi0_emmc_pins>; |
| 346 |
pinctrl-names = "default", "state_uhs"; |
| 347 |
vmmc-supply = <®_3p3v>; |
| 348 |
vqmmc-supply = <®_1p8v>; |
| 349 |
bus-width = <8>; |
| 350 |
non-removable; |
| 351 |
mmc-hs200-1_8v; |
| 352 |
fixed-emmc-driver-type = <1>; |
| 353 |
status = "okay"; |
| 354 |
}; |
| 355 |
#endif |
| 356 |
|
| 357 |
#if SD0_SD |
| 358 |
&sdhi0 { |
| 359 |
pinctrl-0 = <&sdhi0_sd_pins>; |
| 360 |
pinctrl-1 = <&sdhi0_sd_pins>; |
| 361 |
pinctrl-names = "default", "state_uhs"; |
| 362 |
vmmc-supply = <®_3p3v>; |
| 363 |
vqmmc-supply = <&vqmmc_sdhi0>; |
| 364 |
wp-gpios = <&pinctrl RZT2H_GPIO(22, 6) GPIO_ACTIVE_HIGH>; |
| 365 |
bus-width = <4>; |
| 366 |
sd-uhs-sdr50; |
| 367 |
sd-uhs-sdr104; |
| 368 |
status = "okay"; |
| 369 |
}; |
| 370 |
#endif |
| 371 |
|
| 372 |
#if SD1_MICRO_SD |
| 373 |
&sdhi1 { |
| 374 |
pinctrl-0 = <&sdhi1_pins>; |
| 375 |
pinctrl-1 = <&sdhi1_pins>; |
| 376 |
pinctrl-names = "default", "state_uhs"; |
| 377 |
vmmc-supply = <®_3p3v>; |
| 378 |
vqmmc-supply = <&vccq_sdhi1>; |
| 379 |
bus-width = <4>; |
| 380 |
sd-uhs-sdr50; |
| 381 |
sd-uhs-sdr104; |
| 382 |
status = "okay"; |
| 383 |
}; |
| 384 |
#endif |
| 385 |
|
| 386 |
&usb2_phy { |
| 387 |
pinctrl-0 = <&usb_pins>; |
| 388 |
pinctrl-names = "default"; |
| 389 |
|
| 390 |
status = "okay"; |
| 391 |
}; |
| 392 |
|
| 393 |
&wdt2 { |
| 394 |
status = "okay"; |
| 395 |
timeout-sec = <60>; |
| 396 |
}; |
| 397 |
|