155c68261SLad Prabhakar// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 255c68261SLad Prabhakar/* 3f91c4c74SBiju Das * Device Tree Source for the RZ/{G2L,V2L} SMARC SOM common parts 455c68261SLad Prabhakar * 555c68261SLad Prabhakar * Copyright (C) 2021 Renesas Electronics Corp. 655c68261SLad Prabhakar */ 755c68261SLad Prabhakar 8a60a311cSBiju Das#include <dt-bindings/gpio/gpio.h> 9ffd88241SLad Prabhakar#include <dt-bindings/interrupt-controller/irqc-rzg2l.h> 1003f7d78eSLad Prabhakar#include <dt-bindings/pinctrl/rzg2l-pinctrl.h> 1103f7d78eSLad Prabhakar 12a60a311cSBiju Das/* SW1[2] should be at position 2/OFF to enable 64 GB eMMC */ 13a60a311cSBiju Das#define EMMC 1 14a60a311cSBiju Das 15a60a311cSBiju Das/* 16a60a311cSBiju Das * To enable uSD card on CN3, 17a60a311cSBiju Das * SW1[2] should be at position 3/ON. 18a60a311cSBiju Das * Disable eMMC by setting "#define EMMC 0" above. 19a60a311cSBiju Das */ 20a60a311cSBiju Das#define SDHI (!EMMC) 21a60a311cSBiju Das 2255c68261SLad Prabhakar/ { 23361b0dcbSBiju Das aliases { 24361b0dcbSBiju Das ethernet0 = ð0; 25361b0dcbSBiju Das ethernet1 = ð1; 26361b0dcbSBiju Das }; 27361b0dcbSBiju Das 28361b0dcbSBiju Das chosen { 29361b0dcbSBiju Das bootargs = "ignore_loglevel rw root=/dev/nfs ip=on"; 30361b0dcbSBiju Das }; 31361b0dcbSBiju Das 3255c68261SLad Prabhakar memory@48000000 { 3355c68261SLad Prabhakar device_type = "memory"; 3455c68261SLad Prabhakar /* first 128MB is reserved for secure area. */ 3555c68261SLad Prabhakar reg = <0x0 0x48000000 0x0 0x78000000>; 3655c68261SLad Prabhakar }; 37a60a311cSBiju Das 385cf12ac9SGeert Uytterhoeven reg_1p8v: regulator-1p8v { 39a60a311cSBiju Das compatible = "regulator-fixed"; 40a60a311cSBiju Das regulator-name = "fixed-1.8V"; 41a60a311cSBiju Das regulator-min-microvolt = <1800000>; 42a60a311cSBiju Das regulator-max-microvolt = <1800000>; 43a60a311cSBiju Das regulator-boot-on; 44a60a311cSBiju Das regulator-always-on; 45a60a311cSBiju Das }; 46a60a311cSBiju Das 475cf12ac9SGeert Uytterhoeven reg_3p3v: regulator-3p3v { 48a60a311cSBiju Das compatible = "regulator-fixed"; 49a60a311cSBiju Das regulator-name = "fixed-3.3V"; 50a60a311cSBiju Das regulator-min-microvolt = <3300000>; 51a60a311cSBiju Das regulator-max-microvolt = <3300000>; 52a60a311cSBiju Das regulator-boot-on; 53a60a311cSBiju Das regulator-always-on; 54a60a311cSBiju Das }; 55a60a311cSBiju Das 56d563f4baSBiju Das reg_1p1v: regulator-vdd-core { 57d563f4baSBiju Das compatible = "regulator-fixed"; 58d563f4baSBiju Das regulator-name = "fixed-1.1V"; 59d563f4baSBiju Das regulator-min-microvolt = <1100000>; 60d563f4baSBiju Das regulator-max-microvolt = <1100000>; 61d563f4baSBiju Das regulator-boot-on; 62d563f4baSBiju Das regulator-always-on; 63d563f4baSBiju Das }; 64d563f4baSBiju Das 65a60a311cSBiju Das vccq_sdhi0: regulator-vccq-sdhi0 { 66a60a311cSBiju Das compatible = "regulator-gpio"; 67a60a311cSBiju Das 68a60a311cSBiju Das regulator-name = "SDHI0 VccQ"; 69a60a311cSBiju Das regulator-min-microvolt = <1800000>; 70a60a311cSBiju Das regulator-max-microvolt = <3300000>; 71a60a311cSBiju Das states = <3300000 1>, <1800000 0>; 72a60a311cSBiju Das regulator-boot-on; 73a60a311cSBiju Das gpios = <&pinctrl RZG2L_GPIO(39, 0) GPIO_ACTIVE_HIGH>; 74a60a311cSBiju Das regulator-always-on; 75a60a311cSBiju Das }; 76*fdf19e44SBiju Das 77*fdf19e44SBiju Das /* 32.768kHz crystal */ 78*fdf19e44SBiju Das x2: x2-clock { 79*fdf19e44SBiju Das compatible = "fixed-clock"; 80*fdf19e44SBiju Das #clock-cells = <0>; 81*fdf19e44SBiju Das clock-frequency = <32768>; 82*fdf19e44SBiju Das }; 8355c68261SLad Prabhakar}; 8455c68261SLad Prabhakar 8503f7d78eSLad Prabhakar&adc { 8603f7d78eSLad Prabhakar pinctrl-0 = <&adc_pins>; 8703f7d78eSLad Prabhakar pinctrl-names = "default"; 8803f7d78eSLad Prabhakar status = "okay"; 8903f7d78eSLad Prabhakar 9003f7d78eSLad Prabhakar /delete-node/ channel@6; 9103f7d78eSLad Prabhakar /delete-node/ channel@7; 9203f7d78eSLad Prabhakar}; 9303f7d78eSLad Prabhakar 94361b0dcbSBiju Dasð0 { 95361b0dcbSBiju Das pinctrl-0 = <ð0_pins>; 96361b0dcbSBiju Das pinctrl-names = "default"; 97361b0dcbSBiju Das phy-handle = <&phy0>; 98361b0dcbSBiju Das phy-mode = "rgmii-id"; 99361b0dcbSBiju Das status = "okay"; 100361b0dcbSBiju Das 101361b0dcbSBiju Das phy0: ethernet-phy@7 { 102361b0dcbSBiju Das compatible = "ethernet-phy-id0022.1640", 103361b0dcbSBiju Das "ethernet-phy-ieee802.3-c22"; 104361b0dcbSBiju Das reg = <7>; 105ffd88241SLad Prabhakar interrupt-parent = <&irqc>; 106ffd88241SLad Prabhakar interrupts = <RZG2L_IRQ2 IRQ_TYPE_LEVEL_LOW>; 107361b0dcbSBiju Das rxc-skew-psec = <2400>; 108361b0dcbSBiju Das txc-skew-psec = <2400>; 109361b0dcbSBiju Das rxdv-skew-psec = <0>; 110db673457SChris Paterson txen-skew-psec = <0>; 111361b0dcbSBiju Das rxd0-skew-psec = <0>; 112361b0dcbSBiju Das rxd1-skew-psec = <0>; 113361b0dcbSBiju Das rxd2-skew-psec = <0>; 114361b0dcbSBiju Das rxd3-skew-psec = <0>; 115361b0dcbSBiju Das txd0-skew-psec = <0>; 116361b0dcbSBiju Das txd1-skew-psec = <0>; 117361b0dcbSBiju Das txd2-skew-psec = <0>; 118361b0dcbSBiju Das txd3-skew-psec = <0>; 119361b0dcbSBiju Das }; 120361b0dcbSBiju Das}; 121361b0dcbSBiju Das 122361b0dcbSBiju Dasð1 { 123361b0dcbSBiju Das pinctrl-0 = <ð1_pins>; 124361b0dcbSBiju Das pinctrl-names = "default"; 125361b0dcbSBiju Das phy-handle = <&phy1>; 126361b0dcbSBiju Das phy-mode = "rgmii-id"; 127361b0dcbSBiju Das status = "okay"; 128361b0dcbSBiju Das 129361b0dcbSBiju Das phy1: ethernet-phy@7 { 130361b0dcbSBiju Das compatible = "ethernet-phy-id0022.1640", 131361b0dcbSBiju Das "ethernet-phy-ieee802.3-c22"; 132361b0dcbSBiju Das reg = <7>; 133ffd88241SLad Prabhakar interrupt-parent = <&irqc>; 134ffd88241SLad Prabhakar interrupts = <RZG2L_IRQ3 IRQ_TYPE_LEVEL_LOW>; 135361b0dcbSBiju Das rxc-skew-psec = <2400>; 136361b0dcbSBiju Das txc-skew-psec = <2400>; 137361b0dcbSBiju Das rxdv-skew-psec = <0>; 138db673457SChris Paterson txen-skew-psec = <0>; 139361b0dcbSBiju Das rxd0-skew-psec = <0>; 140361b0dcbSBiju Das rxd1-skew-psec = <0>; 141361b0dcbSBiju Das rxd2-skew-psec = <0>; 142361b0dcbSBiju Das rxd3-skew-psec = <0>; 143361b0dcbSBiju Das txd0-skew-psec = <0>; 144361b0dcbSBiju Das txd1-skew-psec = <0>; 145361b0dcbSBiju Das txd2-skew-psec = <0>; 146361b0dcbSBiju Das txd3-skew-psec = <0>; 147361b0dcbSBiju Das }; 148361b0dcbSBiju Das}; 149361b0dcbSBiju Das 15055c68261SLad Prabhakar&extal_clk { 15155c68261SLad Prabhakar clock-frequency = <24000000>; 15255c68261SLad Prabhakar}; 15303f7d78eSLad Prabhakar 154d563f4baSBiju Das&gpu { 155d563f4baSBiju Das mali-supply = <®_1p1v>; 156d563f4baSBiju Das}; 157d563f4baSBiju Das 158*fdf19e44SBiju Das&i2c3 { 159*fdf19e44SBiju Das raa215300: pmic@12 { 160*fdf19e44SBiju Das compatible = "renesas,raa215300"; 161*fdf19e44SBiju Das reg = <0x12>, <0x6f>; 162*fdf19e44SBiju Das reg-names = "main", "rtc"; 163*fdf19e44SBiju Das 164*fdf19e44SBiju Das clocks = <&x2>; 165*fdf19e44SBiju Das clock-names = "xin"; 166*fdf19e44SBiju Das }; 167*fdf19e44SBiju Das}; 168*fdf19e44SBiju Das 16900d071e2SBiju Das&ostm1 { 17000d071e2SBiju Das status = "okay"; 17100d071e2SBiju Das}; 17200d071e2SBiju Das 17300d071e2SBiju Das&ostm2 { 17400d071e2SBiju Das status = "okay"; 17500d071e2SBiju Das}; 17600d071e2SBiju Das 17703f7d78eSLad Prabhakar&pinctrl { 17803f7d78eSLad Prabhakar adc_pins: adc { 17903f7d78eSLad Prabhakar pinmux = <RZG2L_PORT_PINMUX(9, 0, 2)>; /* ADC_TRG */ 18003f7d78eSLad Prabhakar }; 181a60a311cSBiju Das 182361b0dcbSBiju Das eth0_pins: eth0 { 183361b0dcbSBiju Das pinmux = <RZG2L_PORT_PINMUX(28, 1, 1)>, /* ET0_LINKSTA */ 184361b0dcbSBiju Das <RZG2L_PORT_PINMUX(27, 1, 1)>, /* ET0_MDC */ 185361b0dcbSBiju Das <RZG2L_PORT_PINMUX(28, 0, 1)>, /* ET0_MDIO */ 186361b0dcbSBiju Das <RZG2L_PORT_PINMUX(20, 0, 1)>, /* ET0_TXC */ 187361b0dcbSBiju Das <RZG2L_PORT_PINMUX(20, 1, 1)>, /* ET0_TX_CTL */ 188361b0dcbSBiju Das <RZG2L_PORT_PINMUX(20, 2, 1)>, /* ET0_TXD0 */ 189361b0dcbSBiju Das <RZG2L_PORT_PINMUX(21, 0, 1)>, /* ET0_TXD1 */ 190361b0dcbSBiju Das <RZG2L_PORT_PINMUX(21, 1, 1)>, /* ET0_TXD2 */ 191361b0dcbSBiju Das <RZG2L_PORT_PINMUX(22, 0, 1)>, /* ET0_TXD3 */ 192361b0dcbSBiju Das <RZG2L_PORT_PINMUX(24, 0, 1)>, /* ET0_RXC */ 193361b0dcbSBiju Das <RZG2L_PORT_PINMUX(24, 1, 1)>, /* ET0_RX_CTL */ 194361b0dcbSBiju Das <RZG2L_PORT_PINMUX(25, 0, 1)>, /* ET0_RXD0 */ 195361b0dcbSBiju Das <RZG2L_PORT_PINMUX(25, 1, 1)>, /* ET0_RXD1 */ 196361b0dcbSBiju Das <RZG2L_PORT_PINMUX(26, 0, 1)>, /* ET0_RXD2 */ 197ffd88241SLad Prabhakar <RZG2L_PORT_PINMUX(26, 1, 1)>, /* ET0_RXD3 */ 198ffd88241SLad Prabhakar <RZG2L_PORT_PINMUX(1, 0, 1)>; /* IRQ2 */ 199361b0dcbSBiju Das }; 200361b0dcbSBiju Das 201361b0dcbSBiju Das eth1_pins: eth1 { 202361b0dcbSBiju Das pinmux = <RZG2L_PORT_PINMUX(37, 2, 1)>, /* ET1_LINKSTA */ 203361b0dcbSBiju Das <RZG2L_PORT_PINMUX(37, 0, 1)>, /* ET1_MDC */ 204361b0dcbSBiju Das <RZG2L_PORT_PINMUX(37, 1, 1)>, /* ET1_MDIO */ 205361b0dcbSBiju Das <RZG2L_PORT_PINMUX(29, 0, 1)>, /* ET1_TXC */ 206361b0dcbSBiju Das <RZG2L_PORT_PINMUX(29, 1, 1)>, /* ET1_TX_CTL */ 207361b0dcbSBiju Das <RZG2L_PORT_PINMUX(30, 0, 1)>, /* ET1_TXD0 */ 208361b0dcbSBiju Das <RZG2L_PORT_PINMUX(30, 1, 1)>, /* ET1_TXD1 */ 209361b0dcbSBiju Das <RZG2L_PORT_PINMUX(31, 0, 1)>, /* ET1_TXD2 */ 210361b0dcbSBiju Das <RZG2L_PORT_PINMUX(31, 1, 1)>, /* ET1_TXD3 */ 211361b0dcbSBiju Das <RZG2L_PORT_PINMUX(33, 1, 1)>, /* ET1_RXC */ 212361b0dcbSBiju Das <RZG2L_PORT_PINMUX(34, 0, 1)>, /* ET1_RX_CTL */ 213361b0dcbSBiju Das <RZG2L_PORT_PINMUX(34, 1, 1)>, /* ET1_RXD0 */ 214361b0dcbSBiju Das <RZG2L_PORT_PINMUX(35, 0, 1)>, /* ET1_RXD1 */ 215361b0dcbSBiju Das <RZG2L_PORT_PINMUX(35, 1, 1)>, /* ET1_RXD2 */ 216ffd88241SLad Prabhakar <RZG2L_PORT_PINMUX(36, 0, 1)>, /* ET1_RXD3 */ 217ffd88241SLad Prabhakar <RZG2L_PORT_PINMUX(1, 1, 1)>; /* IRQ3 */ 218361b0dcbSBiju Das }; 219361b0dcbSBiju Das 220a60a311cSBiju Das gpio-sd0-pwr-en-hog { 221a60a311cSBiju Das gpio-hog; 222a60a311cSBiju Das gpios = <RZG2L_GPIO(4, 1) GPIO_ACTIVE_HIGH>; 223a60a311cSBiju Das output-high; 224a60a311cSBiju Das line-name = "gpio_sd0_pwr_en"; 22503f7d78eSLad Prabhakar }; 226a60a311cSBiju Das 227c81bd70fSLad Prabhakar qspi0_pins: qspi0 { 228c81bd70fSLad Prabhakar qspi0-data { 229c81bd70fSLad Prabhakar pins = "QSPI0_IO0", "QSPI0_IO1", "QSPI0_IO2", "QSPI0_IO3"; 230c81bd70fSLad Prabhakar power-source = <1800>; 231c81bd70fSLad Prabhakar }; 232c81bd70fSLad Prabhakar 233c81bd70fSLad Prabhakar qspi0-ctrl { 234c81bd70fSLad Prabhakar pins = "QSPI0_SPCLK", "QSPI0_SSL", "QSPI_RESET#"; 235c81bd70fSLad Prabhakar power-source = <1800>; 236c81bd70fSLad Prabhakar }; 237c81bd70fSLad Prabhakar }; 238c81bd70fSLad Prabhakar 239a60a311cSBiju Das /* 240a60a311cSBiju Das * SD0 device selection is XOR between GPIO_SD0_DEV_SEL and SW1[2] 241a60a311cSBiju Das * The below switch logic can be used to select the device between 242a60a311cSBiju Das * eMMC and microSD, after setting GPIO_SD0_DEV_SEL to high in DT. 243a60a311cSBiju Das * SW1[2] should be at position 2/OFF to enable 64 GB eMMC 244a60a311cSBiju Das * SW1[2] should be at position 3/ON to enable uSD card CN3 245a60a311cSBiju Das */ 246a60a311cSBiju Das sd0-dev-sel-hog { 247a60a311cSBiju Das gpio-hog; 248a60a311cSBiju Das gpios = <RZG2L_GPIO(41, 1) GPIO_ACTIVE_HIGH>; 249a60a311cSBiju Das output-high; 250a60a311cSBiju Das line-name = "sd0_dev_sel"; 251a60a311cSBiju Das }; 252a60a311cSBiju Das 253a60a311cSBiju Das sdhi0_emmc_pins: sd0emmc { 254a60a311cSBiju Das sd0_emmc_data { 255a60a311cSBiju Das pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3", 256a60a311cSBiju Das "SD0_DATA4", "SD0_DATA5", "SD0_DATA6", "SD0_DATA7"; 257a60a311cSBiju Das power-source = <1800>; 258a60a311cSBiju Das }; 259a60a311cSBiju Das 260a60a311cSBiju Das sd0_emmc_ctrl { 261a60a311cSBiju Das pins = "SD0_CLK", "SD0_CMD"; 262a60a311cSBiju Das power-source = <1800>; 263a60a311cSBiju Das }; 264a60a311cSBiju Das 265a60a311cSBiju Das sd0_emmc_rst { 266a60a311cSBiju Das pins = "SD0_RST#"; 267a60a311cSBiju Das power-source = <1800>; 268a60a311cSBiju Das }; 269a60a311cSBiju Das }; 270a60a311cSBiju Das 271a60a311cSBiju Das sdhi0_pins: sd0 { 272a60a311cSBiju Das sd0_data { 273a60a311cSBiju Das pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3"; 274a60a311cSBiju Das power-source = <3300>; 275a60a311cSBiju Das }; 276a60a311cSBiju Das 277a60a311cSBiju Das sd0_ctrl { 278a60a311cSBiju Das pins = "SD0_CLK", "SD0_CMD"; 279a60a311cSBiju Das power-source = <3300>; 280a60a311cSBiju Das }; 281a60a311cSBiju Das 282a60a311cSBiju Das sd0_mux { 283a60a311cSBiju Das pinmux = <RZG2L_PORT_PINMUX(47, 0, 2)>; /* SD0_CD */ 284a60a311cSBiju Das }; 285a60a311cSBiju Das }; 286a60a311cSBiju Das 287a60a311cSBiju Das sdhi0_pins_uhs: sd0_uhs { 288a60a311cSBiju Das sd0_data_uhs { 289a60a311cSBiju Das pins = "SD0_DATA0", "SD0_DATA1", "SD0_DATA2", "SD0_DATA3"; 290a60a311cSBiju Das power-source = <1800>; 291a60a311cSBiju Das }; 292a60a311cSBiju Das 293a60a311cSBiju Das sd0_ctrl_uhs { 294a60a311cSBiju Das pins = "SD0_CLK", "SD0_CMD"; 295a60a311cSBiju Das power-source = <1800>; 296a60a311cSBiju Das }; 297a60a311cSBiju Das 298a60a311cSBiju Das sd0_mux_uhs { 299a60a311cSBiju Das pinmux = <RZG2L_PORT_PINMUX(47, 0, 2)>; /* SD0_CD */ 300a60a311cSBiju Das }; 301a60a311cSBiju Das }; 302a60a311cSBiju Das}; 303a60a311cSBiju Das 304c81bd70fSLad Prabhakar&sbc { 305c81bd70fSLad Prabhakar pinctrl-0 = <&qspi0_pins>; 306c81bd70fSLad Prabhakar pinctrl-names = "default"; 307c81bd70fSLad Prabhakar status = "okay"; 308c81bd70fSLad Prabhakar 309c81bd70fSLad Prabhakar flash@0 { 310c81bd70fSLad Prabhakar compatible = "micron,mt25qu512a", "jedec,spi-nor"; 311c81bd70fSLad Prabhakar reg = <0>; 312c81bd70fSLad Prabhakar m25p,fast-read; 313c81bd70fSLad Prabhakar spi-max-frequency = <50000000>; 314c81bd70fSLad Prabhakar spi-rx-bus-width = <4>; 315c81bd70fSLad Prabhakar 316c81bd70fSLad Prabhakar partitions { 317c81bd70fSLad Prabhakar compatible = "fixed-partitions"; 318c81bd70fSLad Prabhakar #address-cells = <1>; 319c81bd70fSLad Prabhakar #size-cells = <1>; 320c81bd70fSLad Prabhakar 321c81bd70fSLad Prabhakar boot@0 { 322c81bd70fSLad Prabhakar reg = <0x00000000 0x2000000>; 323c81bd70fSLad Prabhakar read-only; 324c81bd70fSLad Prabhakar }; 325c81bd70fSLad Prabhakar user@2000000 { 326c81bd70fSLad Prabhakar reg = <0x2000000 0x2000000>; 327c81bd70fSLad Prabhakar }; 328c81bd70fSLad Prabhakar }; 329c81bd70fSLad Prabhakar }; 330c81bd70fSLad Prabhakar}; 331c81bd70fSLad Prabhakar 332a60a311cSBiju Das#if SDHI 333a60a311cSBiju Das&sdhi0 { 334a60a311cSBiju Das pinctrl-0 = <&sdhi0_pins>; 335a60a311cSBiju Das pinctrl-1 = <&sdhi0_pins_uhs>; 336a60a311cSBiju Das pinctrl-names = "default", "state_uhs"; 337a60a311cSBiju Das 338a60a311cSBiju Das vmmc-supply = <®_3p3v>; 339a60a311cSBiju Das vqmmc-supply = <&vccq_sdhi0>; 340a60a311cSBiju Das bus-width = <4>; 341a60a311cSBiju Das sd-uhs-sdr50; 342a60a311cSBiju Das sd-uhs-sdr104; 343a60a311cSBiju Das status = "okay"; 344a60a311cSBiju Das}; 345a60a311cSBiju Das#endif 346a60a311cSBiju Das 347a60a311cSBiju Das#if EMMC 348a60a311cSBiju Das&sdhi0 { 349a60a311cSBiju Das pinctrl-0 = <&sdhi0_emmc_pins>; 350a60a311cSBiju Das pinctrl-1 = <&sdhi0_emmc_pins>; 351a60a311cSBiju Das pinctrl-names = "default", "state_uhs"; 352a60a311cSBiju Das 353a60a311cSBiju Das vmmc-supply = <®_3p3v>; 354a60a311cSBiju Das vqmmc-supply = <®_1p8v>; 355a60a311cSBiju Das bus-width = <8>; 356a60a311cSBiju Das mmc-hs200-1_8v; 357a60a311cSBiju Das non-removable; 358a60a311cSBiju Das fixed-emmc-driver-type = <1>; 359a60a311cSBiju Das status = "okay"; 360a60a311cSBiju Das}; 361a60a311cSBiju Das#endif 36244c2d2c2SBiju Das 36344c2d2c2SBiju Das&wdt0 { 36444c2d2c2SBiju Das status = "okay"; 36544c2d2c2SBiju Das timeout-sec = <60>; 36644c2d2c2SBiju Das}; 36744c2d2c2SBiju Das 36844c2d2c2SBiju Das&wdt1 { 36944c2d2c2SBiju Das status = "okay"; 37044c2d2c2SBiju Das timeout-sec = <60>; 37144c2d2c2SBiju Das}; 372