1// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2/* 3 * Copyright (c) 2022 Rockchip Electronics Co., Ltd. 4 * 5 */ 6 7#include "rk3399-sapphire.dtsi" 8#include <dt-bindings/sensor-dev.h> 9/ { 10 compatible = "rockchip,rk3399-sapphire-excavator", "rockchip,rk3399"; 11 12 rt5651_sound: rt5651-sound { 13 compatible = "simple-audio-card"; 14 simple-audio-card,format = "i2s"; 15 simple-audio-card,name = "realtek,rt5651-codec"; 16 simple-audio-card,mclk-fs = <256>; 17 simple-audio-card,widgets = 18 "Microphone", "Mic Jack", 19 "Headphone", "Headphone Jack"; 20 simple-audio-card,routing = 21 "Mic Jack", "MICBIAS1", 22 "IN1P", "Mic Jack", 23 "Headphone Jack", "HPOL", 24 "Headphone Jack", "HPOR"; 25 simple-audio-card,cpu { 26 sound-dai = <&i2s0>; 27 }; 28 simple-audio-card,codec { 29 sound-dai = <&rt5651>; 30 }; 31 }; 32 33 spdif-sound { 34 status = "okay"; 35 compatible = "simple-audio-card"; 36 simple-audio-card,name = "ROCKCHIP,SPDIF"; 37 simple-audio-card,cpu { 38 sound-dai = <&spdif>; 39 }; 40 simple-audio-card,codec { 41 sound-dai = <&spdif_out>; 42 }; 43 }; 44 45 spdif_out: spdif-out { 46 status = "okay"; 47 compatible = "linux,spdif-dit"; 48 #sound-dai-cells = <0>; 49 }; 50 51 sdio_pwrseq: sdio-pwrseq { 52 compatible = "mmc-pwrseq-simple"; 53 clocks = <&rk808 1>; 54 clock-names = "ext_clock"; 55 pinctrl-names = "default"; 56 pinctrl-0 = <&wifi_enable_h>; 57 58 /* 59 * On the module itself this is one of these (depending 60 * on the actual card populated): 61 * - SDIO_RESET_L_WL_REG_ON 62 * - PDN (power down when low) 63 */ 64 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */ 65 }; 66 67 wireless-wlan { 68 compatible = "wlan-platdata"; 69 rockchip,grf = <&grf>; 70 wifi_chip_type = "ap6354"; 71 sdio_vref = <1800>; 72 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */ 73 WIFI,poweren_gpio = <&gpio0 10 GPIO_ACTIVE_HIGH>; 74 status = "okay"; 75 }; 76 77 wireless-bluetooth { 78 compatible = "bluetooth-platdata"; 79 clocks = <&rk808 1>; 80 clock-names = "ext_clock"; 81 //wifi-bt-power-toggle; 82 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */ 83 pinctrl-names = "default", "rts_gpio"; 84 pinctrl-0 = <&uart0_rts>, <&bt_reset_gpio>, <&bt_wake_gpio>, <&bt_irq_gpio>; 85 pinctrl-1 = <&uart0_gpios>; 86 //BT,power_gpio = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */ 87 BT,reset_gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */ 88 BT,wake_gpio = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */ 89 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */ 90 status = "okay"; 91 }; 92}; 93 94&dfi { 95 status = "okay"; 96}; 97 98&dmc { 99 status = "okay"; 100 center-supply = <&vdd_center>; 101 upthreshold = <40>; 102 downdifferential = <20>; 103 system-status-freq = < 104 /*system status freq(KHz)*/ 105 SYS_STATUS_NORMAL 800000 106 SYS_STATUS_REBOOT 528000 107 SYS_STATUS_SUSPEND 200000 108 SYS_STATUS_VIDEO_1080P 200000 109 SYS_STATUS_VIDEO_4K 600000 110 SYS_STATUS_VIDEO_4K_10B 800000 111 SYS_STATUS_PERFORMANCE 800000 112 SYS_STATUS_BOOST 600000 113 SYS_STATUS_DUALVIEW 600000 114 SYS_STATUS_ISP 600000 115 >; 116 vop-bw-dmc-freq = < 117 /* min_bw(MB/s) max_bw(MB/s) freq(KHz) */ 118 0 762 200000 119 763 1893 400000 120 1894 3012 528000 121 3013 99999 800000 122 >; 123 auto-freq-en = <1>; 124 auto-min-freq = <200000>; 125}; 126 127&spdif { 128 status = "okay"; 129 pinctrl-0 = <&spdif_bus>; 130 i2c-scl-rising-time-ns = <450>; 131 i2c-scl-falling-time-ns = <15>; 132 #sound-dai-cells = <0>; 133}; 134 135&i2s0 { 136 status = "okay"; 137 rockchip,playback-channels = <8>; 138 rockchip,capture-channels = <8>; 139 #sound-dai-cells = <0>; 140}; 141 142&i2c1 { 143 status = "okay"; 144 i2c-scl-rising-time-ns = <300>; 145 i2c-scl-falling-time-ns = <15>; 146 147 rt5651: rt5651@1a { 148 #sound-dai-cells = <0>; 149 compatible = "rockchip,rt5651"; 150 reg = <0x1a>; 151 clocks = <&cru SCLK_I2S_8CH_OUT>; 152 clock-names = "mclk"; 153 pinctrl-names = "default"; 154 pinctrl-0 = <&i2s_8ch_mclk>; 155 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>; 156 hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>; 157 }; 158}; 159 160&i2c4 { 161 status = "okay"; 162 i2c-scl-rising-time-ns = <600>; 163 i2c-scl-falling-time-ns = <20>; 164 165 mpu6500@68 { 166 status = "disabled"; 167 compatible = "invensense,mpu6500"; 168 reg = <0x68>; 169 irq-gpio = <&gpio1 22 IRQ_TYPE_EDGE_RISING>; 170 mpu-int_config = <0x10>; 171 mpu-level_shifter = <0>; 172 mpu-orientation = <0 1 0 1 0 0 0 0 1>; 173 orientation-x= <1>; 174 orientation-y= <0>; 175 orientation-z= <0>; 176 mpu-debug = <1>; 177 }; 178 179 mpu6500_acc: mpu_acc@68 { 180 compatible = "mpu6500_acc"; 181 reg = <0x68>; 182 irq-gpio = <&gpio1 22 IRQ_TYPE_EDGE_RISING>; 183 irq_enable = <0>; 184 poll_delay_ms = <30>; 185 type = <SENSOR_TYPE_ACCEL>; 186 layout = <2>; 187 }; 188 189 mpu6500_gyro: mpu_gyro@68 { 190 compatible = "mpu6500_gyro"; 191 reg = <0x68>; 192 irq_enable = <0>; 193 poll_delay_ms = <30>; 194 type = <SENSOR_TYPE_GYROSCOPE>; 195 layout = <2>; 196 }; 197}; 198 199&pcie0 { 200 ep-gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>; 201 num-lanes = <4>; 202 pinctrl-names = "default"; 203 pinctrl-0 = <&pcie_clkreqn_cpm>; 204}; 205 206&uart0 { 207 pinctrl-names = "default"; 208 pinctrl-0 = <&uart0_xfer &uart0_cts>; 209 status = "okay"; 210}; 211 212&saradc { 213 status = "okay"; 214}; 215 216&sdio0 { 217 max-frequency = <100000000>; 218 no-sd; 219 no-mmc; 220 bus-width = <4>; 221 disable-wp; 222 cap-sd-highspeed; 223 cap-sdio-irq; 224 keep-power-in-suspend; 225 mmc-pwrseq = <&sdio_pwrseq>; 226 non-removable; 227 num-slots = <1>; 228 pinctrl-names = "default"; 229 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; 230 sd-uhs-sdr104; 231 status = "okay"; 232}; 233 234&rockchip_suspend { 235 status = "okay"; 236 rockchip,sleep-debug-en = <1>; 237 rockchip,sleep-mode-config = < 238 (0 239 | RKPM_SLP_ARMPD 240 | RKPM_SLP_PERILPPD 241 | RKPM_SLP_DDR_RET 242 | RKPM_SLP_PLLPD 243 | RKPM_SLP_CENTER_PD 244 | RKPM_SLP_AP_PWROFF 245 ) 246 >; 247 rockchip,wakeup-config = < 248 (0 249 | RKPM_GPIO_WKUP_EN 250 | RKPM_PWM_WKUP_EN 251 ) 252 >; 253 rockchip,pwm-regulator-config = < 254 (0 255 | PWM2_REGULATOR_EN 256 ) 257 >; 258 rockchip,power-ctrl = 259 <&gpio1 17 GPIO_ACTIVE_HIGH>, 260 <&gpio1 14 GPIO_ACTIVE_HIGH>; 261}; 262 263&pinctrl { 264 sdio-pwrseq { 265 wifi_enable_h: wifi-enable-h { 266 rockchip,pins = 267 <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; 268 }; 269 }; 270 271 wireless-bluetooth { 272 uart0_gpios: uart0-gpios { 273 rockchip,pins = 274 <2 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>; 275 }; 276 bt_reset_gpio: bt-reset-gpio { 277 rockchip,pins = 278 <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; 279 }; 280 bt_wake_gpio: bt-wake-gpio { 281 rockchip,pins = 282 <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; 283 }; 284 bt_irq_gpio: bt-irq-gpio { 285 rockchip,pins = 286 <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>; 287 }; 288 }; 289}; 290