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 "r9a09g087m44.dtsi" 11 12/* 13 * SD0 can be connected to either eMMC (U33) or SD card slot CN21 14 * Lets by default enable the eMMC, note we need the below SW settings 15 * for eMMC. 16 * DSW5[1] = ON; DSW5[2] = ON 17 * DSW17[5] = OFF; DSW17[6] = ON 18 * 19 * To enable SD card and disable eMMC on SDHI0 disable the below macro 20 * and set the below switch setting: 21 * DSW5[1] = OFF; DSW5[2] = ON 22 * P22_6 = SD0_WP; DSW15[1] = OFF; DSW15[2] = ON 23 * P22_5 = SD0_CD; DSW15[3] = OFF; DSW15[4] = ON 24 * P02_6 = SD0_IOVS; DSW17[5] = OFF; DSW17[6] = ON 25 * P02_5 = SD0_PWEN; DSW17[7] = OFF; DSW17[8] = ON 26 */ 27#define SD0_EMMC 1 28#define SD0_SD (!SD0_EMMC) 29 30/* 31 * P17_4 = SD1_CD; DSW5[3] = ON; DSW19[1] = OFF; DSW19[2] = ON 32 * P08_6 = SD1_IOVS; DSW5[3] = ON 33 */ 34#define SD1_MICRO_SD 1 35 36/* 37 * USB Pin Configuration: 38 * 39 * This board is equipped with three USB connectors: Type-A (CN7), Mini-B 40 * (CN8), and Micro-AB (CN9). The RZ/N2H SoC has a single USB channel, so 41 * either the USB host interface or the USB function interface can be used, 42 * but not both simultaneously when using the CN7 and CN8 connectors. 43 * 44 * By default, the Type-A (CN7) and Mini-B (CN8) connectors are enabled. 45 * Configure the switches as follows: 46 * - P02_2 - P02_3 (control signals for USB power supply): DSW2[6] = OFF; 47 * - P02_2 (used for VBUSEN): DSW14[5] = OFF; DSW14[6] = ON 48 * - P02_3 (used for USB_OVRCUR): DSW14[1] = OFF; DSW14[2] = ON 49 * - USB_VBUSIN (used for VBUS of CN8): DSW16[1] = OFF; DSW16[2] = ON 50 * - USB_VBUSEN (used for USB_HF_VBUSEN): DSW16[3] = OFF; DSW16[4] = ON 51 * 52 * To enable the Micro-AB (CN9) USB OTG connector, set the following macro 53 * to 1 and configure the switches as follows: 54 * - P02_2 - P02_3 (control signals for USB power supply): DSW2[6] = OFF; 55 * - P02_2 (used for VBUSEN): DSW14[5] = OFF; DSW14[6] = ON 56 * - P02_3 (used for USB_OVRCUR): DSW14[1] = OFF; DSW14[2] = ON 57 * - USB_VBUSIN (used for VBUS for OTG): DSW16[1] = ON; DSW16[2] = OFF 58 * - USB_VBUSEN (used for USB_OTG_VBUSEN): DSW16[3] = ON; DSW16[4] = OFF 59 * - USB_EXICEN (used for USB OTG EXICEN): DSW14[3] = OFF; DSW14[4] = ON 60 */ 61#define USB_OTG 0 62 63#include "rzt2h-n2h-evk-common.dtsi" 64 65/* 66 * I2C0 and LED8/9 share the same pins use the below 67 * macro to choose (and set approopriate DIP switches). 68 */ 69#define I2C0 1 70#define LED8 (!I2C0) 71#define LED9 (!I2C0) 72 73/ { 74 model = "Renesas RZ/N2H EVK Board based on r9a09g087m44"; 75 compatible = "renesas,rzn2h-evk", "renesas,r9a09g087m44", "renesas,r9a09g087"; 76 77 leds { 78 compatible = "gpio-leds"; 79 80 led-3 { 81 /* DSW18-7: ON, DSW18-8: OFF */ 82 gpios = <&pinctrl RZT2H_GPIO(31, 6) GPIO_ACTIVE_HIGH>; 83 color = <LED_COLOR_ID_GREEN>; 84 function = LED_FUNCTION_DEBUG; 85 function-enumerator = <4>; 86 }; 87 88 led-4 { 89 /* DSW18-9: ON, DSW18-10: OFF */ 90 gpios = <&pinctrl RZT2H_GPIO(18, 1) GPIO_ACTIVE_HIGH>; 91 color = <LED_COLOR_ID_RED>; 92 function = LED_FUNCTION_DEBUG; 93 function-enumerator = <5>; 94 }; 95 96 led-5 { 97 /* DSW18-1: ON, DSW18-2: OFF */ 98 gpios = <&pinctrl RZT2H_GPIO(22, 7) GPIO_ACTIVE_HIGH>; 99 color = <LED_COLOR_ID_GREEN>; 100 function = LED_FUNCTION_DEBUG; 101 function-enumerator = <6>; 102 }; 103 104 led-6 { 105 /* DSW18-3: ON, DSW18-4: OFF */ 106 gpios = <&pinctrl RZT2H_GPIO(23, 0) GPIO_ACTIVE_HIGH>; 107 color = <LED_COLOR_ID_GREEN>; 108 function = LED_FUNCTION_DEBUG; 109 function-enumerator = <7>; 110 }; 111 112 led-7 { 113 /* 114 * DSW18-5: ON, DSW18-6: OFF 115 * DSW19-3: OFF, DSW19-4: ON 116 */ 117 gpios = <&pinctrl RZT2H_GPIO(14, 3) GPIO_ACTIVE_HIGH>; 118 color = <LED_COLOR_ID_GREEN>; 119 function = LED_FUNCTION_DEBUG; 120 function-enumerator = <8>; 121 }; 122 123#if LED8 124 led-8 { 125 /* 126 * USER_LED0 127 * DSW15-8: OFF, DSW15-9: OFF, DSW15-10: ON 128 */ 129 gpios = <&pinctrl RZT2H_GPIO(14, 6) GPIO_ACTIVE_HIGH>; 130 color = <LED_COLOR_ID_GREEN>; 131 function = LED_FUNCTION_DEBUG; 132 function-enumerator = <0>; 133 }; 134#endif 135 136#if LED9 137 led-9 { 138 /* 139 * USER_LED1 140 * DSW15-5: OFF, DSW15-6: ON 141 */ 142 gpios = <&pinctrl RZT2H_GPIO(14, 7) GPIO_ACTIVE_HIGH>; 143 color = <LED_COLOR_ID_GREEN>; 144 function = LED_FUNCTION_DEBUG; 145 function-enumerator = <1>; 146 }; 147#endif 148 149 led-10 { 150 /* 151 * USER_LED2 152 * DSW17-3: OFF, DSW17-4: ON 153 */ 154 gpios = <&pinctrl RZT2H_GPIO(2, 7) GPIO_ACTIVE_HIGH>; 155 color = <LED_COLOR_ID_YELLOW>; 156 function = LED_FUNCTION_DEBUG; 157 function-enumerator = <2>; 158 }; 159 160 led-11 { 161 /* 162 * USER_LED3 163 * DSW17-1: OFF, DSW17-2: ON 164 */ 165 gpios = <&pinctrl RZT2H_GPIO(3, 0) GPIO_ACTIVE_HIGH>; 166 color = <LED_COLOR_ID_RED>; 167 function = LED_FUNCTION_DEBUG; 168 function-enumerator = <3>; 169 }; 170 }; 171}; 172 173#if I2C0 174&i2c0 { 175 pinctrl-0 = <&i2c0_pins>; 176 pinctrl-names = "default"; 177 clock-frequency = <400000>; 178 status = "okay"; 179}; 180#endif 181 182&i2c1 { 183 pinctrl-0 = <&i2c1_pins>; 184 pinctrl-names = "default"; 185 clock-frequency = <400000>; 186 status = "okay"; 187}; 188 189&pinctrl { 190 /* 191 * I2C0 Pin Configuration: 192 * ------------------------ 193 * Signal | Pin | DSW15 194 * -------|---------|-------------- 195 * SCL | P14_6 | 8: OFF, 9: ON, 10: OFF 196 * SDA | P14_7 | 5: ON, 6: OFF 197 */ 198 i2c0_pins: i2c0-pins { 199 pinmux = <RZT2H_PORT_PINMUX(14, 6, 0x17)>, 200 <RZT2H_PORT_PINMUX(14, 7, 0x17)>; 201 }; 202 203 /* 204 * I2C1 Pin Configuration: 205 * ------------------------ 206 * Signal | Pin | DSW7 207 * -------|---------|-------------- 208 * SCL | P03_3 | 1: ON, 2: OFF 209 * SDA | P03_4 | 3: ON, 4: OFF 210 */ 211 i2c1_pins: i2c1-pins { 212 pinmux = <RZT2H_PORT_PINMUX(3, 3, 0x17)>, 213 <RZT2H_PORT_PINMUX(3, 4, 0x17)>; 214 }; 215 216#if USB_OTG 217 usb-exicen-hog { 218 gpio-hog; 219 gpios = <RZT2H_GPIO(2, 4) GPIO_ACTIVE_HIGH>; 220 output-high; 221 line-name = "usb_exicen_a"; 222 }; 223#endif 224 225 usb_pins: usb-pins { 226 pinmux = <RZT2H_PORT_PINMUX(2, 2, 0x13)>, /* VBUSEN */ 227 <RZT2H_PORT_PINMUX(2, 3, 0x13)>; /* OVRCUR */ 228 }; 229}; 230