1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2/* 3 * Device Tree Source for the R-Car V4M Gray Hawk Single board 4 * 5 * Copyright (C) 2023 Renesas Electronics Corp. 6 * Copyright (C) 2024 Glider bv 7 */ 8/* 9 * [How to use Sound] 10 * 11 * Because R-Car V4M has only 1 SSI, it cannot handle both Playback/Capture 12 * at the same time. You need to switch the direction which is controlled 13 * by the GP0_01 pin via amixer. 14 * 15 * Playback (CN9500) 16 * > amixer set "MUX" "Playback" // for GP0_01 17 * > amixer set "DAC 1" 85% 18 * > aplay xxx.wav 19 * 20 * Capture (CN9501) 21 * > amixer set "MUX" "Capture" // for GP0_01 22 * > amixer set "Mic 1" 80% 23 * > amixer set "ADC 1" on 24 * > amixer set 'ADC 1' 80% 25 * > arecord xxx hoge.wav 26 */ 27 28/dts-v1/; 29 30#include <dt-bindings/gpio/gpio.h> 31#include <dt-bindings/input/input.h> 32#include <dt-bindings/leds/common.h> 33 34#include "r8a779h0.dtsi" 35 36/ { 37 model = "Renesas Gray Hawk Single board based on r8a779h0"; 38 compatible = "renesas,gray-hawk-single", "renesas,r8a779h0"; 39 40 aliases { 41 i2c0 = &i2c0; 42 i2c1 = &i2c1; 43 i2c2 = &i2c2; 44 i2c3 = &i2c3; 45 serial0 = &hscif0; 46 serial1 = &hscif2; 47 ethernet0 = &avb0; 48 }; 49 50 can_transceiver0: can-phy0 { 51 compatible = "nxp,tjr1443"; 52 #phy-cells = <0>; 53 enable-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; 54 max-bitrate = <5000000>; 55 }; 56 57 chosen { 58 bootargs = "ignore_loglevel rw root=/dev/nfs ip=on"; 59 stdout-path = "serial0:921600n8"; 60 }; 61 62 keys { 63 compatible = "gpio-keys"; 64 65 pinctrl-0 = <&keys_pins>; 66 pinctrl-names = "default"; 67 68 key-1 { 69 gpios = <&gpio5 0 GPIO_ACTIVE_LOW>; 70 linux,code = <KEY_1>; 71 label = "SW47"; 72 wakeup-source; 73 debounce-interval = <20>; 74 }; 75 76 key-2 { 77 gpios = <&gpio5 1 GPIO_ACTIVE_LOW>; 78 linux,code = <KEY_2>; 79 label = "SW48"; 80 wakeup-source; 81 debounce-interval = <20>; 82 }; 83 84 key-3 { 85 gpios = <&gpio5 2 GPIO_ACTIVE_LOW>; 86 linux,code = <KEY_3>; 87 label = "SW49"; 88 wakeup-source; 89 debounce-interval = <20>; 90 }; 91 }; 92 93 leds { 94 compatible = "gpio-leds"; 95 96 led-1 { 97 gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>; 98 color = <LED_COLOR_ID_GREEN>; 99 function = LED_FUNCTION_INDICATOR; 100 function-enumerator = <1>; 101 }; 102 103 led-2 { 104 gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; 105 color = <LED_COLOR_ID_GREEN>; 106 function = LED_FUNCTION_INDICATOR; 107 function-enumerator = <2>; 108 }; 109 110 led-3 { 111 gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>; 112 color = <LED_COLOR_ID_GREEN>; 113 function = LED_FUNCTION_INDICATOR; 114 function-enumerator = <3>; 115 }; 116 }; 117 118 memory@48000000 { 119 device_type = "memory"; 120 /* first 128MB is reserved for secure area. */ 121 reg = <0x0 0x48000000 0x0 0x78000000>; 122 }; 123 124 memory@480000000 { 125 device_type = "memory"; 126 reg = <0x4 0x80000000 0x1 0x80000000>; 127 }; 128 129 reg_1p8v: regulator-1p8v { 130 compatible = "regulator-fixed"; 131 regulator-name = "fixed-1.8V"; 132 regulator-min-microvolt = <1800000>; 133 regulator-max-microvolt = <1800000>; 134 regulator-boot-on; 135 regulator-always-on; 136 }; 137 138 reg_3p3v: regulator-3p3v { 139 compatible = "regulator-fixed"; 140 regulator-name = "fixed-3.3V"; 141 regulator-min-microvolt = <3300000>; 142 regulator-max-microvolt = <3300000>; 143 regulator-boot-on; 144 regulator-always-on; 145 }; 146 147 sound_mux: sound-mux { 148 compatible = "simple-audio-mux"; 149 mux-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; 150 state-labels = "Playback", "Capture"; 151 }; 152 153 sound_card: sound { 154 compatible = "audio-graph-card2"; 155 label = "rcar-sound"; 156 aux-devs = <&sound_mux>; // for GP0_01 157 158 links = <&rsnd_port>; // AK4619 Audio Codec 159 }; 160}; 161 162&audio_clkin { 163 clock-frequency = <24576000>; 164}; 165 166&avb0 { 167 pinctrl-0 = <&avb0_pins>; 168 pinctrl-names = "default"; 169 phy-handle = <&phy0>; 170 tx-internal-delay-ps = <2000>; 171 status = "okay"; 172 173 phy0: ethernet-phy@0 { 174 compatible = "ethernet-phy-id0022.1622", 175 "ethernet-phy-ieee802.3-c22"; 176 rxc-skew-ps = <1500>; 177 reg = <0>; 178 interrupts-extended = <&gpio7 5 IRQ_TYPE_LEVEL_LOW>; 179 reset-gpios = <&gpio7 10 GPIO_ACTIVE_LOW>; 180 }; 181}; 182 183&can_clk { 184 clock-frequency = <40000000>; 185}; 186 187&canfd { 188 pinctrl-0 = <&canfd0_pins>, <&canfd1_pins>, <&can_clk_pins>; 189 pinctrl-names = "default"; 190 status = "okay"; 191 192 channel0 { 193 status = "okay"; 194 phys = <&can_transceiver0>; 195 }; 196 197 channel1 { 198 status = "okay"; 199 }; 200}; 201 202&extal_clk { 203 clock-frequency = <16666666>; 204}; 205 206&extalr_clk { 207 clock-frequency = <32768>; 208}; 209 210&gpio1 { 211 audio-power-hog { 212 gpio-hog; 213 gpios = <8 GPIO_ACTIVE_HIGH>; 214 output-high; 215 line-name = "Audio-Power"; 216 }; 217}; 218 219&hscif0 { 220 pinctrl-0 = <&hscif0_pins>; 221 pinctrl-names = "default"; 222 223 uart-has-rtscts; 224 status = "okay"; 225}; 226 227&hscif2 { 228 pinctrl-0 = <&hscif2_pins>; 229 pinctrl-names = "default"; 230 231 uart-has-rtscts; 232 status = "okay"; 233}; 234 235&i2c0 { 236 pinctrl-0 = <&i2c0_pins>; 237 pinctrl-names = "default"; 238 239 status = "okay"; 240 clock-frequency = <400000>; 241 242 eeprom@50 { 243 compatible = "rohm,br24g01", "atmel,24c01"; 244 label = "cpu-board"; 245 reg = <0x50>; 246 pagesize = <8>; 247 }; 248 249 eeprom@51 { 250 compatible = "rohm,br24g01", "atmel,24c01"; 251 label = "breakout-board"; 252 reg = <0x51>; 253 pagesize = <8>; 254 }; 255 256 eeprom@52 { 257 compatible = "rohm,br24g01", "atmel,24c01"; 258 label = "csi-dsi-sub-board-id"; 259 reg = <0x52>; 260 pagesize = <8>; 261 }; 262 263 eeprom@53 { 264 compatible = "rohm,br24g01", "atmel,24c01"; 265 label = "ethernet-sub-board-id"; 266 reg = <0x53>; 267 pagesize = <8>; 268 }; 269}; 270 271&i2c3 { 272 pinctrl-0 = <&i2c3_pins>; 273 pinctrl-names = "default"; 274 275 status = "okay"; 276 clock-frequency = <400000>; 277 278 codec@10 { 279 compatible = "asahi-kasei,ak4619"; 280 reg = <0x10>; 281 282 clocks = <&rcar_sound>; 283 clock-names = "mclk"; 284 285 #sound-dai-cells = <0>; 286 port { 287 ak4619_endpoint: endpoint { 288 remote-endpoint = <&rsnd_endpoint>; 289 }; 290 }; 291 }; 292}; 293 294&mmc0 { 295 pinctrl-0 = <&mmc_pins>; 296 pinctrl-1 = <&mmc_pins>; 297 pinctrl-names = "default", "state_uhs"; 298 299 vmmc-supply = <®_3p3v>; 300 vqmmc-supply = <®_1p8v>; 301 mmc-hs200-1_8v; 302 mmc-hs400-1_8v; 303 bus-width = <8>; 304 no-sd; 305 no-sdio; 306 non-removable; 307 full-pwr-cycle-in-suspend; 308 status = "okay"; 309}; 310 311&pfc { 312 pinctrl-0 = <&scif_clk_pins>, <&scif_clk2_pins>; 313 pinctrl-names = "default"; 314 315 avb0_pins: avb0 { 316 mux { 317 groups = "avb0_link", "avb0_mdio", "avb0_rgmii", 318 "avb0_txcrefclk"; 319 function = "avb0"; 320 }; 321 322 pins_mdio { 323 groups = "avb0_mdio"; 324 drive-strength = <21>; 325 }; 326 327 pins_mii { 328 groups = "avb0_rgmii"; 329 drive-strength = <21>; 330 }; 331 }; 332 333 can_clk_pins: can-clk { 334 groups = "can_clk"; 335 function = "can_clk"; 336 }; 337 338 canfd0_pins: canfd0 { 339 groups = "canfd0_data"; 340 function = "canfd0"; 341 }; 342 343 canfd1_pins: canfd1 { 344 groups = "canfd1_data"; 345 function = "canfd1"; 346 }; 347 348 hscif0_pins: hscif0 { 349 groups = "hscif0_data", "hscif0_ctrl"; 350 function = "hscif0"; 351 }; 352 353 hscif2_pins: hscif2 { 354 groups = "hscif2_data", "hscif2_ctrl"; 355 function = "hscif2"; 356 }; 357 358 i2c0_pins: i2c0 { 359 groups = "i2c0"; 360 function = "i2c0"; 361 }; 362 363 i2c3_pins: i2c3 { 364 groups = "i2c3"; 365 function = "i2c3"; 366 }; 367 368 keys_pins: keys { 369 pins = "GP_5_0", "GP_5_1", "GP_5_2"; 370 bias-pull-up; 371 }; 372 373 mmc_pins: mmc { 374 groups = "mmc_data8", "mmc_ctrl", "mmc_ds"; 375 function = "mmc"; 376 power-source = <1800>; 377 }; 378 379 qspi0_pins: qspi0 { 380 groups = "qspi0_ctrl", "qspi0_data4"; 381 function = "qspi0"; 382 }; 383 384 scif_clk_pins: scif-clk { 385 groups = "scif_clk"; 386 function = "scif_clk"; 387 }; 388 389 scif_clk2_pins: scif-clk2 { 390 groups = "scif_clk2"; 391 function = "scif_clk2"; 392 }; 393 394 sound_clk_pins: sound_clk { 395 groups = "audio_clkin", "audio_clkout"; 396 function = "audio_clk"; 397 }; 398 399 sound_pins: sound { 400 groups = "ssi_ctrl", "ssi_data"; 401 function = "ssi"; 402 }; 403}; 404 405&rcar_sound { 406 pinctrl-0 = <&sound_clk_pins>, <&sound_pins>; 407 pinctrl-names = "default"; 408 409 status = "okay"; 410 411 /* audio_clkout */ 412 clock-frequency = <12288000>; 413 414 ports { 415 rsnd_port: port { 416 rsnd_endpoint: endpoint { 417 remote-endpoint = <&ak4619_endpoint>; 418 bitclock-master; 419 frame-master; 420 421 /* see above [How to use Sound] */ 422 playback = <&ssi0>; 423 capture = <&ssi0>; 424 }; 425 }; 426 }; 427}; 428 429&rpc { 430 pinctrl-0 = <&qspi0_pins>; 431 pinctrl-names = "default"; 432 433 status = "okay"; 434 435 flash@0 { 436 compatible = "spansion,s25fs512s", "jedec,spi-nor"; 437 reg = <0>; 438 spi-max-frequency = <40000000>; 439 spi-rx-bus-width = <4>; 440 441 partitions { 442 compatible = "fixed-partitions"; 443 #address-cells = <1>; 444 #size-cells = <1>; 445 446 boot@0 { 447 reg = <0x0 0x1200000>; 448 read-only; 449 }; 450 user@1200000 { 451 reg = <0x1200000 0x2e00000>; 452 }; 453 }; 454 }; 455}; 456 457&rwdt { 458 timeout-sec = <60>; 459 status = "okay"; 460}; 461 462&scif_clk { 463 clock-frequency = <24000000>; 464}; 465 466&scif_clk2 { 467 clock-frequency = <24000000>; 468}; 469