1/* 2 * (C) Copyright 2018 Rockchip Electronics Co., Ltd 3 * 4 * SPDX-License-Identifier: GPL-2.0+ 5 */ 6 7/dts-v1/; 8#include "rk3308.dtsi" 9#include "rk3308-u-boot.dtsi" 10#include <dt-bindings/input/input.h> 11#include <linux/media-bus-format.h> 12 13/ { 14 model = "Rockchip RK3308 EVB"; 15 compatible = "rockchip,rk3308-evb", "rockchip,rk3308"; 16 17 adc-keys0 { 18 u-boot,dm-pre-reloc; 19 compatible = "adc-keys"; 20 io-channels = <&saradc 0>; 21 io-channel-names = "buttons"; 22 poll-interval = <100>; 23 keyup-threshold-microvolt = <1800000>; 24 25 vol-up-key { 26 u-boot,dm-pre-reloc; 27 linux,code = <KEY_VOLUMEUP>; 28 label = "volume up"; 29 press-threshold-microvolt = <18000>; 30 }; 31 }; 32 33 adc-keys1 { 34 u-boot,dm-pre-reloc; 35 compatible = "adc-keys"; 36 io-channels = <&saradc 1>; 37 io-channel-names = "buttons"; 38 poll-interval = <100>; 39 keyup-threshold-microvolt = <1800000>; 40 41 esc-key { 42 linux,code = <KEY_MUTE>; 43 label = "mute"; 44 press-threshold-microvolt = <1130000>; 45 }; 46 47 home-key { 48 linux,code = <KEY_MODE>; 49 label = "mode"; 50 press-threshold-microvolt = <901000>; 51 }; 52 53 menu-key { 54 linux,code = <KEY_PLAY>; 55 label = "play"; 56 press-threshold-microvolt = <624000>; 57 }; 58 59 vol-down-key { 60 linux,code = <KEY_VOLUMEDOWN>; 61 label = "volume down"; 62 press-threshold-microvolt = <300000>; 63 }; 64 65 vol-up-key { 66 u-boot,dm-pre-reloc; 67 linux,code = <KEY_VOLUMEUP>; 68 label = "volume up"; 69 press-threshold-microvolt = <18000>; 70 }; 71 }; 72 73 backlight: backlight { 74 status = "disabled"; 75 compatible = "pwm-backlight"; 76 pwms = <&pwm1 0 25000 0>; 77 brightness-levels = < 78 0 1 2 3 4 5 6 7 79 8 9 10 11 12 13 14 15 80 16 17 18 19 20 21 22 23 81 24 25 26 27 28 29 30 31 82 32 33 34 35 36 37 38 39 83 40 41 42 43 44 45 46 47 84 48 49 50 51 52 53 54 55 85 56 57 58 59 60 61 62 63 86 64 65 66 67 68 69 70 71 87 72 73 74 75 76 77 78 79 88 80 81 82 83 84 85 86 87 89 88 89 90 91 92 93 94 95 90 96 97 98 99 100 101 102 103 91 104 105 106 107 108 109 110 111 92 112 113 114 115 116 117 118 119 93 120 121 122 123 124 125 126 127 94 128 129 130 131 132 133 134 135 95 136 137 138 139 140 141 142 143 96 144 145 146 147 148 149 150 151 97 152 153 154 155 156 157 158 159 98 160 161 162 163 164 165 166 167 99 168 169 170 171 172 173 174 175 100 176 177 178 179 180 181 182 183 101 184 185 186 187 188 189 190 191 102 192 193 194 195 196 197 198 199 103 200 201 202 203 204 205 206 207 104 208 209 210 211 212 213 214 215 105 216 217 218 219 220 221 222 223 106 224 225 226 227 228 229 230 231 107 232 233 234 235 236 237 238 239 108 240 241 242 243 244 245 246 247 109 248 249 250 251 252 253 254 255>; 110 default-brightness-level = <200>; 111 }; 112 113 panel: panel { 114 compatible = "simple-panel"; 115 bus-format = <MEDIA_BUS_FMT_RGB666_1X18>; 116 backlight = <&backlight>; 117 /* enable-gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_LOW>; */ 118 enable-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>; 119 enable-delay-ms = <20>; 120 reset-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_LOW>; 121 reset-value = <0>; 122 reset-delay-ms = <10>; 123 prepare-delay-ms = <20>; 124 unprepare-delay-ms = <20>; 125 disable-delay-ms = <20>; 126 /* spi-sdo-gpios = <&gpio3 RK_PD2 GPIO_ACTIVE_HIGH>; */ 127 spi-sdi-gpios = <&gpio1 RK_PC7 GPIO_ACTIVE_HIGH>; 128 spi-scl-gpios = <&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>; 129 spi-cs-gpios = <&gpio1 RK_PD1 GPIO_ACTIVE_HIGH>; 130 width-mm = <217>; 131 height-mm = <136>; 132 rockchip,data-mapping = "vesa"; 133 rockchip,data-width = <18>; 134 rockchip,output = "rgb"; 135 rgb-mode = "p666"; 136 status = "disabled"; 137 pinctrl-names = "default"; 138 pinctrl-0 = <&spi_init_cmd>; 139 rockchip,cmd-type = "spi"; 140 141 /* type:0 is cmd, 1 is data */ 142 panel-init-sequence = [ 143 /* type delay num val1 val2 val3 */ 144 00 00 01 e0 145 01 00 01 00 146 01 00 01 07 147 01 00 01 0f 148 01 00 01 0d 149 01 00 01 1b 150 01 00 01 0a 151 01 00 01 3c 152 01 00 01 78 153 01 00 01 4a 154 01 00 01 07 155 01 00 01 0e 156 01 00 01 09 157 01 00 01 1b 158 01 00 01 1e 159 01 00 01 0f 160 00 00 01 e1 161 01 00 01 00 162 01 00 01 22 163 01 00 01 24 164 01 00 01 06 165 01 00 01 12 166 01 00 01 07 167 01 00 01 36 168 01 00 01 47 169 01 00 01 47 170 01 00 01 06 171 01 00 01 0a 172 01 00 01 07 173 01 00 01 30 174 01 00 01 37 175 01 00 01 0f 176 177 00 00 01 c0 178 01 00 01 10 179 01 00 01 10 180 181 00 00 01 c1 182 01 00 01 41 183 184 00 00 01 c5 185 01 00 01 00 186 01 00 01 22 187 01 00 01 80 188 189 00 00 01 36 190 01 00 01 48 191 192 00 00 01 3a /* interface mode control */ 193 01 00 01 66 194 195 00 00 01 b0 /* interface mode control */ 196 01 00 01 00 197 198 00 00 01 b1 /* frame rate 70hz */ 199 01 00 01 b0 200 01 00 01 11 201 00 00 01 b4 202 01 00 01 02 203 00 00 01 B6 /* RGB/MCU Interface Control */ 204 01 00 01 32 /* 02 mcu, 32 rgb */ 205 01 00 01 02 206 207 00 00 01 b7 208 01 00 01 c6 209 210 00 00 01 be 211 01 00 01 00 212 01 00 01 04 213 214 00 00 01 e9 215 01 00 01 00 216 217 00 00 01 f7 218 01 00 01 a9 219 01 00 01 51 220 01 00 01 2c 221 01 00 01 82 222 223 00 78 01 11 224 00 00 01 29 225 ]; 226 227 panel-exit-sequence = [ 228 /* type delay num val1 val2 val3 */ 229 00 0a 01 28 230 00 78 01 10 231 ]; 232 233 display-timings { 234 native-mode = <&kd050fwfba002_timing>; 235 236 kd050fwfba002_timing: timing0 { 237 clock-frequency = <11000000>; 238 hactive = <320>; 239 vactive = <480>; 240 hback-porch = <10>; 241 hfront-porch = <4>; 242 vback-porch = <10>; 243 vfront-porch = <4>; 244 hsync-len = <20>; 245 vsync-len = <20>; 246 hsync-active = <0>; 247 vsync-active = <0>; 248 de-active = <0>; 249 pixelclk-active = <0>; 250 }; 251 }; 252 253 port { 254 panel_in_rgb: endpoint { 255 remote-endpoint = <&rgb_out_panel>; 256 }; 257 }; 258 }; 259 260 vbus_host: vbus-host-regulator { 261 compatible = "regulator-fixed"; 262 enable-active-high; 263 gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>; 264 pinctrl-names = "default"; 265 pinctrl-0 = <&usb_drv>; 266 regulator-name = "vbus_host"; 267 }; 268 269 vdd_log: vdd_core: vdd-core { 270 compatible = "pwm-regulator"; 271 pwms = <&pwm0 0 5000 1>; 272 regulator-name = "vdd_core"; 273 regulator-min-microvolt = <847000>; 274 regulator-max-microvolt = <1366000>; 275 regulator-init-microvolt = <1044000>; 276 regulator-always-on; 277 regulator-boot-on; 278 status = "okay"; 279 }; 280 281 vcc_phy: vcc-phy-regulator { 282 compatible = "regulator-fixed"; 283 regulator-name = "vcc_phy"; 284 regulator-always-on; 285 regulator-boot-on; 286 }; 287}; 288 289&display_subsystem { 290 status = "disabled"; 291}; 292 293&emmc { 294 cap-mmc-highspeed; 295 supports-emmc; 296 non-removable; 297 num-slots = <1>; 298 status = "okay"; 299}; 300 301&mac { 302 phy-supply = <&vcc_phy>; 303 assigned-clocks = <&cru SCLK_MAC>; 304 assigned-clock-parents = <&mac_clkin>; 305 clock_in_out = "input"; 306 pinctrl-names = "default"; 307 pinctrl-0 = <&rmii_pins &mac_refclk>; 308 snps,reset-gpio = <&gpio4 RK_PC0 GPIO_ACTIVE_LOW>; 309 snps,reset-active-low; 310 snps,reset-delays-us = <0 50000 50000>; 311 status = "disabled"; 312}; 313 314&pwm0 { 315 status = "okay"; 316}; 317 318&pwm1 { 319 status = "disabled"; 320}; 321 322&sdmmc { 323 bus-width = <4>; 324 cap-mmc-highspeed; 325 cap-sd-highspeed; 326 supports-sd; 327 card-detect-delay = <800>; 328 ignore-pm-notify; 329 sd-uhs-sdr12; 330 sd-uhs-sdr25; 331 sd-uhs-sdr50; 332 sd-uhs-sdr104; 333 status = "disabled"; 334}; 335 336&u2phy { 337 status = "okay"; 338}; 339 340&u2phy_otg { 341 status = "okay"; 342}; 343 344&u2phy_host { 345 status = "okay"; 346}; 347 348&usb_host0_ehci { 349 status = "okay"; 350}; 351 352&usb_host0_ohci { 353 status = "okay"; 354}; 355 356&usb20_otg { 357 status = "okay"; 358}; 359 360&route_rgb { 361 status = "disabled"; 362}; 363 364&vop { 365 status = "disabled"; 366}; 367 368&rgb { 369 status = "disabled"; 370 371 ports { 372 rgb_out: port@1 { 373 reg = <1>; 374 #address-cells = <1>; 375 #size-cells = <0>; 376 377 rgb_out_panel: endpoint@0 { 378 reg = <0>; 379 remote-endpoint = <&panel_in_rgb>; 380 }; 381 }; 382 }; 383}; 384 385&pinctrl { 386 spi_panel { 387 spi_init_cmd: spi-init-cmd { 388 rockchip,pins = 389 /* spi sdi */ 390 <1 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>, 391 /* spi scl */ 392 <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>, 393 /* spi cs */ 394 <1 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>; 395 }; 396 }; 397 398 usb { 399 usb_drv: usb-drv { 400 rockchip,pins = 401 <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; 402 }; 403 }; 404}; 405 406&crypto { 407 status = "okay"; 408}; 409