1*f126890aSEmmanuel Vadot// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2*f126890aSEmmanuel Vadot 3*f126890aSEmmanuel Vadot/dts-v1/; 4*f126890aSEmmanuel Vadot#include <dt-bindings/input/input.h> 5*f126890aSEmmanuel Vadot#include "rk3288-rock2-som.dtsi" 6*f126890aSEmmanuel Vadot 7*f126890aSEmmanuel Vadot/ { 8*f126890aSEmmanuel Vadot model = "Radxa Rock 2 Square"; 9*f126890aSEmmanuel Vadot compatible = "radxa,rock2-square", "rockchip,rk3288"; 10*f126890aSEmmanuel Vadot 11*f126890aSEmmanuel Vadot chosen { 12*f126890aSEmmanuel Vadot stdout-path = "serial2:115200n8"; 13*f126890aSEmmanuel Vadot }; 14*f126890aSEmmanuel Vadot 15*f126890aSEmmanuel Vadot adc-keys { 16*f126890aSEmmanuel Vadot compatible = "adc-keys"; 17*f126890aSEmmanuel Vadot io-channels = <&saradc 1>; 18*f126890aSEmmanuel Vadot io-channel-names = "buttons"; 19*f126890aSEmmanuel Vadot keyup-threshold-microvolt = <1800000>; 20*f126890aSEmmanuel Vadot 21*f126890aSEmmanuel Vadot button-recovery { 22*f126890aSEmmanuel Vadot label = "Recovery"; 23*f126890aSEmmanuel Vadot linux,code = <KEY_VENDOR>; 24*f126890aSEmmanuel Vadot press-threshold-microvolt = <0>; 25*f126890aSEmmanuel Vadot }; 26*f126890aSEmmanuel Vadot }; 27*f126890aSEmmanuel Vadot 28*f126890aSEmmanuel Vadot gpio-keys { 29*f126890aSEmmanuel Vadot compatible = "gpio-keys"; 30*f126890aSEmmanuel Vadot 31*f126890aSEmmanuel Vadot key-power { 32*f126890aSEmmanuel Vadot gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>; 33*f126890aSEmmanuel Vadot label = "GPIO Power"; 34*f126890aSEmmanuel Vadot linux,code = <KEY_POWER>; 35*f126890aSEmmanuel Vadot pinctrl-names = "default"; 36*f126890aSEmmanuel Vadot pinctrl-0 = <&pwr_key>; 37*f126890aSEmmanuel Vadot wakeup-source; 38*f126890aSEmmanuel Vadot }; 39*f126890aSEmmanuel Vadot }; 40*f126890aSEmmanuel Vadot 41*f126890aSEmmanuel Vadot gpio-leds { 42*f126890aSEmmanuel Vadot compatible = "gpio-leds"; 43*f126890aSEmmanuel Vadot 44*f126890aSEmmanuel Vadot heartbeat_led: led-0 { 45*f126890aSEmmanuel Vadot gpios = <&gpio7 RK_PB7 GPIO_ACTIVE_LOW>; 46*f126890aSEmmanuel Vadot label = "rock2:green:state1"; 47*f126890aSEmmanuel Vadot linux,default-trigger = "heartbeat"; 48*f126890aSEmmanuel Vadot }; 49*f126890aSEmmanuel Vadot 50*f126890aSEmmanuel Vadot mmc_led: led-1 { 51*f126890aSEmmanuel Vadot gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_LOW>; 52*f126890aSEmmanuel Vadot label = "rock2:blue:state2"; 53*f126890aSEmmanuel Vadot linux,default-trigger = "mmc0"; 54*f126890aSEmmanuel Vadot }; 55*f126890aSEmmanuel Vadot }; 56*f126890aSEmmanuel Vadot 57*f126890aSEmmanuel Vadot ir: ir-receiver { 58*f126890aSEmmanuel Vadot compatible = "gpio-ir-receiver"; 59*f126890aSEmmanuel Vadot gpios = <&gpio8 RK_PA1 GPIO_ACTIVE_LOW>; 60*f126890aSEmmanuel Vadot pinctrl-names = "default"; 61*f126890aSEmmanuel Vadot pinctrl-0 = <&ir_int>; 62*f126890aSEmmanuel Vadot }; 63*f126890aSEmmanuel Vadot 64*f126890aSEmmanuel Vadot sound { 65*f126890aSEmmanuel Vadot compatible = "simple-audio-card"; 66*f126890aSEmmanuel Vadot simple-audio-card,name = "SPDIF"; 67*f126890aSEmmanuel Vadot simple-audio-card,dai-link@1 { /* S/PDIF - S/PDIF */ 68*f126890aSEmmanuel Vadot cpu { sound-dai = <&spdif>; }; 69*f126890aSEmmanuel Vadot codec { sound-dai = <&spdif_out>; }; 70*f126890aSEmmanuel Vadot }; 71*f126890aSEmmanuel Vadot }; 72*f126890aSEmmanuel Vadot 73*f126890aSEmmanuel Vadot sata_pwr: sata-prw-regulator { 74*f126890aSEmmanuel Vadot compatible = "regulator-fixed"; 75*f126890aSEmmanuel Vadot enable-active-high; 76*f126890aSEmmanuel Vadot gpio = <&gpio0 13 GPIO_ACTIVE_HIGH>; 77*f126890aSEmmanuel Vadot pinctrl-names = "default"; 78*f126890aSEmmanuel Vadot pinctrl-0 = <&sata_pwr_en>; 79*f126890aSEmmanuel Vadot /* Always turn on the 5V sata power connector */ 80*f126890aSEmmanuel Vadot regulator-always-on; 81*f126890aSEmmanuel Vadot regulator-name = "sata_pwr"; 82*f126890aSEmmanuel Vadot }; 83*f126890aSEmmanuel Vadot 84*f126890aSEmmanuel Vadot spdif_out: spdif-out { 85*f126890aSEmmanuel Vadot compatible = "linux,spdif-dit"; 86*f126890aSEmmanuel Vadot #sound-dai-cells = <0>; 87*f126890aSEmmanuel Vadot }; 88*f126890aSEmmanuel Vadot 89*f126890aSEmmanuel Vadot sound-i2s { 90*f126890aSEmmanuel Vadot compatible = "rockchip,rk3288-hdmi-analog"; 91*f126890aSEmmanuel Vadot pinctrl-names = "default"; 92*f126890aSEmmanuel Vadot pinctrl-0 = <&phone_ctl>, <&hp_det>; 93*f126890aSEmmanuel Vadot rockchip,audio-codec = <&es8388>; 94*f126890aSEmmanuel Vadot rockchip,hp-det-gpios = <&gpio7 7 GPIO_ACTIVE_HIGH>; 95*f126890aSEmmanuel Vadot rockchip,hp-en-gpios = <&gpio8 0 GPIO_ACTIVE_HIGH>; 96*f126890aSEmmanuel Vadot rockchip,i2s-controller = <&i2s>; 97*f126890aSEmmanuel Vadot rockchip,model = "I2S"; 98*f126890aSEmmanuel Vadot rockchip,routing = "Analog", "LOUT2", 99*f126890aSEmmanuel Vadot "Analog", "ROUT2"; 100*f126890aSEmmanuel Vadot }; 101*f126890aSEmmanuel Vadot 102*f126890aSEmmanuel Vadot sdio_pwrseq: sdio-pwrseq { 103*f126890aSEmmanuel Vadot compatible = "mmc-pwrseq-simple"; 104*f126890aSEmmanuel Vadot clocks = <&hym8563>; 105*f126890aSEmmanuel Vadot clock-names = "ext_clock"; 106*f126890aSEmmanuel Vadot pinctrl-names = "default"; 107*f126890aSEmmanuel Vadot pinctrl-0 = <&wifi_enable>; 108*f126890aSEmmanuel Vadot reset-gpios = <&gpio4 RK_PD4 GPIO_ACTIVE_LOW>; 109*f126890aSEmmanuel Vadot }; 110*f126890aSEmmanuel Vadot 111*f126890aSEmmanuel Vadot vcc_usb_host: vcc-host-regulator { 112*f126890aSEmmanuel Vadot compatible = "regulator-fixed"; 113*f126890aSEmmanuel Vadot enable-active-high; 114*f126890aSEmmanuel Vadot gpio = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>; 115*f126890aSEmmanuel Vadot pinctrl-names = "default"; 116*f126890aSEmmanuel Vadot pinctrl-0 = <&host_vbus_drv>; 117*f126890aSEmmanuel Vadot regulator-name = "vcc_host"; 118*f126890aSEmmanuel Vadot }; 119*f126890aSEmmanuel Vadot 120*f126890aSEmmanuel Vadot vcc_sd: sdmmc-regulator { 121*f126890aSEmmanuel Vadot compatible = "regulator-fixed"; 122*f126890aSEmmanuel Vadot gpio = <&gpio7 RK_PB3 GPIO_ACTIVE_LOW>; 123*f126890aSEmmanuel Vadot pinctrl-names = "default"; 124*f126890aSEmmanuel Vadot pinctrl-0 = <&sdmmc_pwr>; 125*f126890aSEmmanuel Vadot regulator-name = "vcc_sd"; 126*f126890aSEmmanuel Vadot regulator-min-microvolt = <3300000>; 127*f126890aSEmmanuel Vadot regulator-max-microvolt = <3300000>; 128*f126890aSEmmanuel Vadot vin-supply = <&vcc_io>; 129*f126890aSEmmanuel Vadot }; 130*f126890aSEmmanuel Vadot}; 131*f126890aSEmmanuel Vadot 132*f126890aSEmmanuel Vadot&sdio0 { 133*f126890aSEmmanuel Vadot bus-width = <4>; 134*f126890aSEmmanuel Vadot cap-sd-highspeed; 135*f126890aSEmmanuel Vadot cap-sdio-irq; 136*f126890aSEmmanuel Vadot mmc-pwrseq = <&sdio_pwrseq>; 137*f126890aSEmmanuel Vadot non-removable; 138*f126890aSEmmanuel Vadot pinctrl-names = "default"; 139*f126890aSEmmanuel Vadot pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk &sdio0_int>; 140*f126890aSEmmanuel Vadot vmmc-supply = <&vcc_io>; 141*f126890aSEmmanuel Vadot vqmmc-supply = <&vcc_18>; 142*f126890aSEmmanuel Vadot status = "okay"; 143*f126890aSEmmanuel Vadot}; 144*f126890aSEmmanuel Vadot 145*f126890aSEmmanuel Vadot&sdmmc { 146*f126890aSEmmanuel Vadot bus-width = <4>; 147*f126890aSEmmanuel Vadot cap-mmc-highspeed; 148*f126890aSEmmanuel Vadot cap-sd-highspeed; 149*f126890aSEmmanuel Vadot card-detect-delay = <200>; 150*f126890aSEmmanuel Vadot disable-wp; /* wp not hooked up */ 151*f126890aSEmmanuel Vadot pinctrl-names = "default"; 152*f126890aSEmmanuel Vadot pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; 153*f126890aSEmmanuel Vadot vmmc-supply = <&vcc_sd>; 154*f126890aSEmmanuel Vadot vqmmc-supply = <&vccio_sd>; 155*f126890aSEmmanuel Vadot status = "okay"; 156*f126890aSEmmanuel Vadot}; 157*f126890aSEmmanuel Vadot 158*f126890aSEmmanuel Vadot&gmac { 159*f126890aSEmmanuel Vadot status = "okay"; 160*f126890aSEmmanuel Vadot}; 161*f126890aSEmmanuel Vadot 162*f126890aSEmmanuel Vadot&hdmi { 163*f126890aSEmmanuel Vadot ddc-i2c-bus = <&i2c5>; 164*f126890aSEmmanuel Vadot status = "okay"; 165*f126890aSEmmanuel Vadot}; 166*f126890aSEmmanuel Vadot 167*f126890aSEmmanuel Vadot&i2c0 { 168*f126890aSEmmanuel Vadot hym8563: rtc@51 { 169*f126890aSEmmanuel Vadot compatible = "haoyu,hym8563"; 170*f126890aSEmmanuel Vadot reg = <0x51>; 171*f126890aSEmmanuel Vadot #clock-cells = <0>; 172*f126890aSEmmanuel Vadot clock-output-names = "xin32k"; 173*f126890aSEmmanuel Vadot interrupt-parent = <&gpio0>; 174*f126890aSEmmanuel Vadot interrupts = <RK_PA4 IRQ_TYPE_EDGE_FALLING>; 175*f126890aSEmmanuel Vadot pinctrl-names = "default"; 176*f126890aSEmmanuel Vadot pinctrl-0 = <&pmic_int>; 177*f126890aSEmmanuel Vadot 178*f126890aSEmmanuel Vadot }; 179*f126890aSEmmanuel Vadot}; 180*f126890aSEmmanuel Vadot 181*f126890aSEmmanuel Vadot&i2c2 { 182*f126890aSEmmanuel Vadot status = "okay"; 183*f126890aSEmmanuel Vadot 184*f126890aSEmmanuel Vadot es8388: es8388@10 { 185*f126890aSEmmanuel Vadot compatible = "everest,es8388", "everest,es8328"; 186*f126890aSEmmanuel Vadot reg = <0x10>; 187*f126890aSEmmanuel Vadot AVDD-supply = <&vccio_codec>; 188*f126890aSEmmanuel Vadot DVDD-supply = <&vccio_codec>; 189*f126890aSEmmanuel Vadot HPVDD-supply = <&vccio_codec>; 190*f126890aSEmmanuel Vadot PVDD-supply = <&vccio_codec>; 191*f126890aSEmmanuel Vadot clocks = <&cru SCLK_I2S0_OUT>; 192*f126890aSEmmanuel Vadot }; 193*f126890aSEmmanuel Vadot}; 194*f126890aSEmmanuel Vadot 195*f126890aSEmmanuel Vadot&i2c5 { 196*f126890aSEmmanuel Vadot status = "okay"; 197*f126890aSEmmanuel Vadot}; 198*f126890aSEmmanuel Vadot 199*f126890aSEmmanuel Vadot&i2s { 200*f126890aSEmmanuel Vadot status = "okay"; 201*f126890aSEmmanuel Vadot}; 202*f126890aSEmmanuel Vadot 203*f126890aSEmmanuel Vadot&pinctrl { 204*f126890aSEmmanuel Vadot ir { 205*f126890aSEmmanuel Vadot ir_int: ir-int { 206*f126890aSEmmanuel Vadot rockchip,pins = <8 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>; 207*f126890aSEmmanuel Vadot }; 208*f126890aSEmmanuel Vadot }; 209*f126890aSEmmanuel Vadot 210*f126890aSEmmanuel Vadot keys { 211*f126890aSEmmanuel Vadot pwr_key: pwr-key { 212*f126890aSEmmanuel Vadot rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; 213*f126890aSEmmanuel Vadot }; 214*f126890aSEmmanuel Vadot }; 215*f126890aSEmmanuel Vadot 216*f126890aSEmmanuel Vadot pmic { 217*f126890aSEmmanuel Vadot pmic_int: pmic-int { 218*f126890aSEmmanuel Vadot rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>; 219*f126890aSEmmanuel Vadot }; 220*f126890aSEmmanuel Vadot }; 221*f126890aSEmmanuel Vadot 222*f126890aSEmmanuel Vadot headphone { 223*f126890aSEmmanuel Vadot hp_det: hp-det { 224*f126890aSEmmanuel Vadot rockchip,pins = <7 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>; 225*f126890aSEmmanuel Vadot }; 226*f126890aSEmmanuel Vadot 227*f126890aSEmmanuel Vadot phone_ctl: phone-ctl { 228*f126890aSEmmanuel Vadot rockchip,pins = <8 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>; 229*f126890aSEmmanuel Vadot }; 230*f126890aSEmmanuel Vadot }; 231*f126890aSEmmanuel Vadot 232*f126890aSEmmanuel Vadot usb { 233*f126890aSEmmanuel Vadot host_vbus_drv: host-vbus-drv { 234*f126890aSEmmanuel Vadot rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>; 235*f126890aSEmmanuel Vadot }; 236*f126890aSEmmanuel Vadot }; 237*f126890aSEmmanuel Vadot 238*f126890aSEmmanuel Vadot sata { 239*f126890aSEmmanuel Vadot sata_pwr_en: sata-pwr-en { 240*f126890aSEmmanuel Vadot rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; 241*f126890aSEmmanuel Vadot }; 242*f126890aSEmmanuel Vadot }; 243*f126890aSEmmanuel Vadot 244*f126890aSEmmanuel Vadot sdmmc { 245*f126890aSEmmanuel Vadot sdmmc_pwr: sdmmc-pwr { 246*f126890aSEmmanuel Vadot rockchip,pins = <7 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; 247*f126890aSEmmanuel Vadot }; 248*f126890aSEmmanuel Vadot }; 249*f126890aSEmmanuel Vadot 250*f126890aSEmmanuel Vadot sdio { 251*f126890aSEmmanuel Vadot wifi_enable: wifi-enable { 252*f126890aSEmmanuel Vadot rockchip,pins = <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; 253*f126890aSEmmanuel Vadot }; 254*f126890aSEmmanuel Vadot }; 255*f126890aSEmmanuel Vadot}; 256*f126890aSEmmanuel Vadot 257*f126890aSEmmanuel Vadot&saradc { 258*f126890aSEmmanuel Vadot status = "okay"; 259*f126890aSEmmanuel Vadot}; 260*f126890aSEmmanuel Vadot 261*f126890aSEmmanuel Vadot&spdif { 262*f126890aSEmmanuel Vadot status = "okay"; 263*f126890aSEmmanuel Vadot}; 264*f126890aSEmmanuel Vadot 265*f126890aSEmmanuel Vadot&uart2 { 266*f126890aSEmmanuel Vadot status = "okay"; 267*f126890aSEmmanuel Vadot}; 268*f126890aSEmmanuel Vadot 269*f126890aSEmmanuel Vadot&usbphy { 270*f126890aSEmmanuel Vadot status = "okay"; 271*f126890aSEmmanuel Vadot}; 272*f126890aSEmmanuel Vadot 273*f126890aSEmmanuel Vadot&usbphy1 { 274*f126890aSEmmanuel Vadot vbus-supply = <&vcc_usb_host>; 275*f126890aSEmmanuel Vadot}; 276*f126890aSEmmanuel Vadot 277*f126890aSEmmanuel Vadot&usb_host0_ehci { 278*f126890aSEmmanuel Vadot status = "okay"; 279*f126890aSEmmanuel Vadot}; 280*f126890aSEmmanuel Vadot 281*f126890aSEmmanuel Vadot&usb_host1 { 282*f126890aSEmmanuel Vadot status = "okay"; 283*f126890aSEmmanuel Vadot}; 284*f126890aSEmmanuel Vadot 285*f126890aSEmmanuel Vadot&usb_otg { 286*f126890aSEmmanuel Vadot status = "okay"; 287*f126890aSEmmanuel Vadot}; 288