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