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 33#include "r8a779h0.dtsi" 34 35/ { 36 model = "Renesas Gray Hawk Single board based on r8a779h0"; 37 compatible = "renesas,gray-hawk-single", "renesas,r8a779h0"; 38 39 aliases { 40 i2c0 = &i2c0; 41 i2c1 = &i2c1; 42 i2c2 = &i2c2; 43 i2c3 = &i2c3; 44 serial0 = &hscif0; 45 serial1 = &hscif2; 46 ethernet0 = &avb0; 47 }; 48 49 chosen { 50 bootargs = "ignore_loglevel rw root=/dev/nfs ip=on"; 51 stdout-path = "serial0:921600n8"; 52 }; 53 54 keys { 55 compatible = "gpio-keys"; 56 57 pinctrl-0 = <&keys_pins>; 58 pinctrl-names = "default"; 59 60 key-1 { 61 gpios = <&gpio5 0 GPIO_ACTIVE_LOW>; 62 linux,code = <KEY_1>; 63 label = "SW47"; 64 wakeup-source; 65 debounce-interval = <20>; 66 }; 67 68 key-2 { 69 gpios = <&gpio5 1 GPIO_ACTIVE_LOW>; 70 linux,code = <KEY_2>; 71 label = "SW48"; 72 wakeup-source; 73 debounce-interval = <20>; 74 }; 75 76 key-3 { 77 gpios = <&gpio5 2 GPIO_ACTIVE_LOW>; 78 linux,code = <KEY_3>; 79 label = "SW49"; 80 wakeup-source; 81 debounce-interval = <20>; 82 }; 83 }; 84 85 memory@48000000 { 86 device_type = "memory"; 87 /* first 128MB is reserved for secure area. */ 88 reg = <0x0 0x48000000 0x0 0x78000000>; 89 }; 90 91 memory@480000000 { 92 device_type = "memory"; 93 reg = <0x4 0x80000000 0x1 0x80000000>; 94 }; 95 96 reg_1p8v: regulator-1p8v { 97 compatible = "regulator-fixed"; 98 regulator-name = "fixed-1.8V"; 99 regulator-min-microvolt = <1800000>; 100 regulator-max-microvolt = <1800000>; 101 regulator-boot-on; 102 regulator-always-on; 103 }; 104 105 reg_3p3v: regulator-3p3v { 106 compatible = "regulator-fixed"; 107 regulator-name = "fixed-3.3V"; 108 regulator-min-microvolt = <3300000>; 109 regulator-max-microvolt = <3300000>; 110 regulator-boot-on; 111 regulator-always-on; 112 }; 113 114 sound_mux: sound-mux { 115 compatible = "simple-audio-mux"; 116 mux-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; 117 state-labels = "Playback", "Capture"; 118 }; 119 120 sound_card: sound { 121 compatible = "audio-graph-card2"; 122 label = "rcar-sound"; 123 aux-devs = <&sound_mux>; // for GP0_01 124 125 links = <&rsnd_port>; // AK4619 Audio Codec 126 }; 127}; 128 129&audio_clkin { 130 clock-frequency = <24576000>; 131}; 132 133&avb0 { 134 pinctrl-0 = <&avb0_pins>; 135 pinctrl-names = "default"; 136 phy-handle = <&phy0>; 137 tx-internal-delay-ps = <2000>; 138 status = "okay"; 139 140 phy0: ethernet-phy@0 { 141 compatible = "ethernet-phy-id0022.1622", 142 "ethernet-phy-ieee802.3-c22"; 143 rxc-skew-ps = <1500>; 144 reg = <0>; 145 interrupt-parent = <&gpio7>; 146 interrupts = <5 IRQ_TYPE_LEVEL_LOW>; 147 reset-gpios = <&gpio7 10 GPIO_ACTIVE_LOW>; 148 }; 149}; 150 151&extal_clk { 152 clock-frequency = <16666666>; 153}; 154 155&extalr_clk { 156 clock-frequency = <32768>; 157}; 158 159&gpio1 { 160 audio-power-hog { 161 gpio-hog; 162 gpios = <8 GPIO_ACTIVE_HIGH>; 163 output-high; 164 line-name = "Audio-Power"; 165 }; 166}; 167 168&hscif0 { 169 pinctrl-0 = <&hscif0_pins>; 170 pinctrl-names = "default"; 171 172 uart-has-rtscts; 173 status = "okay"; 174}; 175 176&hscif2 { 177 pinctrl-0 = <&hscif2_pins>; 178 pinctrl-names = "default"; 179 180 uart-has-rtscts; 181 status = "okay"; 182}; 183 184&i2c0 { 185 pinctrl-0 = <&i2c0_pins>; 186 pinctrl-names = "default"; 187 188 status = "okay"; 189 clock-frequency = <400000>; 190 191 eeprom@50 { 192 compatible = "rohm,br24g01", "atmel,24c01"; 193 label = "cpu-board"; 194 reg = <0x50>; 195 pagesize = <8>; 196 }; 197 198 eeprom@51 { 199 compatible = "rohm,br24g01", "atmel,24c01"; 200 label = "breakout-board"; 201 reg = <0x51>; 202 pagesize = <8>; 203 }; 204 205 eeprom@52 { 206 compatible = "rohm,br24g01", "atmel,24c01"; 207 label = "csi-dsi-sub-board-id"; 208 reg = <0x52>; 209 pagesize = <8>; 210 }; 211 212 eeprom@53 { 213 compatible = "rohm,br24g01", "atmel,24c01"; 214 label = "ethernet-sub-board-id"; 215 reg = <0x53>; 216 pagesize = <8>; 217 }; 218}; 219 220&i2c3 { 221 pinctrl-0 = <&i2c3_pins>; 222 pinctrl-names = "default"; 223 224 status = "okay"; 225 clock-frequency = <400000>; 226 227 codec@10 { 228 compatible = "asahi-kasei,ak4619"; 229 reg = <0x10>; 230 231 clocks = <&rcar_sound>; 232 clock-names = "mclk"; 233 234 #sound-dai-cells = <0>; 235 port { 236 ak4619_endpoint: endpoint { 237 remote-endpoint = <&rsnd_endpoint>; 238 }; 239 }; 240 }; 241}; 242 243&mmc0 { 244 pinctrl-0 = <&mmc_pins>; 245 pinctrl-1 = <&mmc_pins>; 246 pinctrl-names = "default", "state_uhs"; 247 248 vmmc-supply = <®_3p3v>; 249 vqmmc-supply = <®_1p8v>; 250 mmc-hs200-1_8v; 251 mmc-hs400-1_8v; 252 bus-width = <8>; 253 no-sd; 254 no-sdio; 255 non-removable; 256 full-pwr-cycle-in-suspend; 257 status = "okay"; 258}; 259 260&pfc { 261 pinctrl-0 = <&scif_clk_pins>, <&scif_clk2_pins>; 262 pinctrl-names = "default"; 263 264 avb0_pins: avb0 { 265 mux { 266 groups = "avb0_link", "avb0_mdio", "avb0_rgmii", 267 "avb0_txcrefclk"; 268 function = "avb0"; 269 }; 270 271 pins_mdio { 272 groups = "avb0_mdio"; 273 drive-strength = <21>; 274 }; 275 276 pins_mii { 277 groups = "avb0_rgmii"; 278 drive-strength = <21>; 279 }; 280 }; 281 282 hscif0_pins: hscif0 { 283 groups = "hscif0_data", "hscif0_ctrl"; 284 function = "hscif0"; 285 }; 286 287 hscif2_pins: hscif2 { 288 groups = "hscif2_data", "hscif2_ctrl"; 289 function = "hscif2"; 290 }; 291 292 i2c0_pins: i2c0 { 293 groups = "i2c0"; 294 function = "i2c0"; 295 }; 296 297 i2c3_pins: i2c3 { 298 groups = "i2c3"; 299 function = "i2c3"; 300 }; 301 302 keys_pins: keys { 303 pins = "GP_5_0", "GP_5_1", "GP_5_2"; 304 bias-pull-up; 305 }; 306 307 mmc_pins: mmc { 308 groups = "mmc_data8", "mmc_ctrl", "mmc_ds"; 309 function = "mmc"; 310 power-source = <1800>; 311 }; 312 313 qspi0_pins: qspi0 { 314 groups = "qspi0_ctrl", "qspi0_data4"; 315 function = "qspi0"; 316 }; 317 318 scif_clk_pins: scif-clk { 319 groups = "scif_clk"; 320 function = "scif_clk"; 321 }; 322 323 scif_clk2_pins: scif-clk2 { 324 groups = "scif_clk2"; 325 function = "scif_clk2"; 326 }; 327 328 sound_clk_pins: sound_clk { 329 groups = "audio_clkin", "audio_clkout"; 330 function = "audio_clk"; 331 }; 332 333 sound_pins: sound { 334 groups = "ssi_ctrl", "ssi_data"; 335 function = "ssi"; 336 }; 337}; 338 339&rcar_sound { 340 pinctrl-0 = <&sound_clk_pins>, <&sound_pins>; 341 pinctrl-names = "default"; 342 343 status = "okay"; 344 345 /* audio_clkout */ 346 clock-frequency = <12288000>; 347 348 ports { 349 rsnd_port: port { 350 rsnd_endpoint: endpoint { 351 remote-endpoint = <&ak4619_endpoint>; 352 bitclock-master; 353 frame-master; 354 355 /* see above [How to use Sound] */ 356 playback = <&ssi0>; 357 capture = <&ssi0>; 358 }; 359 }; 360 }; 361}; 362 363&rpc { 364 pinctrl-0 = <&qspi0_pins>; 365 pinctrl-names = "default"; 366 367 status = "okay"; 368 369 flash@0 { 370 compatible = "spansion,s25fs512s", "jedec,spi-nor"; 371 reg = <0>; 372 spi-max-frequency = <40000000>; 373 spi-rx-bus-width = <4>; 374 375 partitions { 376 compatible = "fixed-partitions"; 377 #address-cells = <1>; 378 #size-cells = <1>; 379 380 boot@0 { 381 reg = <0x0 0x1200000>; 382 read-only; 383 }; 384 user@1200000 { 385 reg = <0x1200000 0x2e00000>; 386 }; 387 }; 388 }; 389}; 390 391&rwdt { 392 timeout-sec = <60>; 393 status = "okay"; 394}; 395 396&scif_clk { 397 clock-frequency = <24000000>; 398}; 399 400&scif_clk2 { 401 clock-frequency = <24000000>; 402}; 403