1// SPDX-License-Identifier: GPL-2.0 2/dts-v1/; 3 4#include "jz4780.dtsi" 5#include <dt-bindings/clock/ingenic,tcu.h> 6#include <dt-bindings/gpio/gpio.h> 7#include <dt-bindings/input/input.h> 8#include <dt-bindings/interrupt-controller/irq.h> 9#include <dt-bindings/regulator/active-semi,8865-regulator.h> 10 11/ { 12 compatible = "img,ci20", "ingenic,jz4780"; 13 14 aliases { 15 serial0 = &uart0; 16 serial1 = &uart1; 17 serial3 = &uart3; 18 serial4 = &uart4; 19 }; 20 21 chosen { 22 stdout-path = &uart4; 23 }; 24 25 memory { 26 device_type = "memory"; 27 reg = <0x0 0x10000000 28 0x30000000 0x30000000>; 29 }; 30 31 gpio-keys { 32 compatible = "gpio-keys"; 33 34 switch { 35 label = "ci20:sw1"; 36 linux,code = <KEY_F13>; 37 gpios = <&gpd 17 GPIO_ACTIVE_HIGH>; 38 wakeup-source; 39 }; 40 }; 41 42 leds { 43 compatible = "gpio-leds"; 44 45 led-0 { 46 label = "ci20:red:led0"; 47 gpios = <&gpc 3 GPIO_ACTIVE_HIGH>; 48 linux,default-trigger = "none"; 49 }; 50 51 led-1 { 52 label = "ci20:red:led1"; 53 gpios = <&gpc 2 GPIO_ACTIVE_HIGH>; 54 linux,default-trigger = "nand-disk"; 55 }; 56 57 led-2 { 58 label = "ci20:red:led2"; 59 gpios = <&gpc 1 GPIO_ACTIVE_HIGH>; 60 linux,default-trigger = "cpu1"; 61 }; 62 63 led-3 { 64 label = "ci20:red:led3"; 65 gpios = <&gpc 0 GPIO_ACTIVE_HIGH>; 66 linux,default-trigger = "cpu0"; 67 }; 68 }; 69 70 eth0_power: fixedregulator-0 { 71 compatible = "regulator-fixed"; 72 73 regulator-name = "eth0_power"; 74 regulator-min-microvolt = <3300000>; 75 regulator-max-microvolt = <3300000>; 76 77 gpio = <&gpb 25 0>; 78 enable-active-high; 79 }; 80 81 hdmi_out: connector { 82 compatible = "hdmi-connector"; 83 label = "HDMI OUT"; 84 type = "a"; 85 86 ddc-en-gpios = <&gpa 25 GPIO_ACTIVE_HIGH>; 87 88 port { 89 hdmi_con: endpoint { 90 remote-endpoint = <&dw_hdmi_out>; 91 }; 92 }; 93 }; 94 95 ir: ir { 96 compatible = "gpio-ir-receiver"; 97 gpios = <&gpe 3 GPIO_ACTIVE_LOW>; 98 }; 99 100 wlan0_power: fixedregulator-1 { 101 compatible = "regulator-fixed"; 102 103 regulator-name = "wlan0_power"; 104 105 gpio = <&gpb 19 0>; 106 enable-active-high; 107 }; 108 109 otg_power: fixedregulator-2 { 110 compatible = "regulator-fixed"; 111 112 regulator-name = "otg_power"; 113 regulator-min-microvolt = <5000000>; 114 regulator-max-microvolt = <5000000>; 115 116 gpio = <&gpf 15 0>; 117 enable-active-high; 118 }; 119}; 120 121&ext { 122 clock-frequency = <48000000>; 123}; 124 125&cgu { 126 /* 127 * Use the 32.768 kHz oscillator as the parent of the RTC for a higher 128 * precision. 129 */ 130 assigned-clocks = <&cgu JZ4780_CLK_OTGPHY>, <&cgu JZ4780_CLK_RTC>, 131 <&cgu JZ4780_CLK_SSIPLL>, <&cgu JZ4780_CLK_SSI>, 132 <&cgu JZ4780_CLK_HDMI>; 133 assigned-clock-parents = <0>, <&cgu JZ4780_CLK_RTCLK>, 134 <&cgu JZ4780_CLK_MPLL>, 135 <&cgu JZ4780_CLK_SSIPLL>; 136 assigned-clock-rates = <48000000>, <0>, <54000000>, <0>, <27000000>; 137}; 138 139&tcu { 140 /* 141 * 750 kHz for the system timers and clocksource, 142 * use channel #0 and #1 for the per cpu system timers, 143 * and use channel #2 for the clocksource. 144 * 145 * 3000 kHz for the OST timer to provide a higher 146 * precision clocksource. 147 */ 148 assigned-clocks = <&tcu TCU_CLK_TIMER0>, <&tcu TCU_CLK_TIMER1>, 149 <&tcu TCU_CLK_TIMER2>, <&tcu TCU_CLK_OST>; 150 assigned-clock-rates = <750000>, <750000>, <750000>, <3000000>; 151}; 152 153&mmc0 { 154 status = "okay"; 155 156 bus-width = <4>; 157 max-frequency = <50000000>; 158 159 pinctrl-names = "default"; 160 pinctrl-0 = <&pins_mmc0>; 161 162 cd-gpios = <&gpf 20 GPIO_ACTIVE_LOW>; 163}; 164 165&mmc1 { 166 status = "okay"; 167 168 bus-width = <4>; 169 max-frequency = <50000000>; 170 non-removable; 171 172 pinctrl-names = "default"; 173 pinctrl-0 = <&pins_mmc1>; 174 175 brcmf: wifi@1 { 176/* reg = <4>;*/ 177 compatible = "brcm,bcm4330-fmac"; 178 vcc-supply = <&wlan0_power>; 179 device-wakeup-gpios = <&gpd 9 GPIO_ACTIVE_HIGH>; 180 shutdown-gpios = <&gpf 7 GPIO_ACTIVE_LOW>; 181 }; 182}; 183 184&uart0 { 185 status = "okay"; 186 187 pinctrl-names = "default"; 188 pinctrl-0 = <&pins_uart0>; 189}; 190 191&uart1 { 192 status = "okay"; 193 194 pinctrl-names = "default"; 195 pinctrl-0 = <&pins_uart1>; 196}; 197 198&uart2 { 199 status = "okay"; 200 201 pinctrl-names = "default"; 202 pinctrl-0 = <&pins_uart2>; 203 uart-has-rtscts; 204 205 bluetooth { 206 compatible = "brcm,bcm4330-bt"; 207 reset-gpios = <&gpf 8 GPIO_ACTIVE_HIGH>; 208 vcc-supply = <&wlan0_power>; 209 device-wakeup-gpios = <&gpf 5 GPIO_ACTIVE_HIGH>; 210 host-wakeup-gpios = <&gpf 6 GPIO_ACTIVE_HIGH>; 211 shutdown-gpios = <&gpf 4 GPIO_ACTIVE_LOW>; 212 }; 213}; 214 215&uart3 { 216 status = "okay"; 217 218 pinctrl-names = "default"; 219 pinctrl-0 = <&pins_uart3>; 220}; 221 222&uart4 { 223 status = "okay"; 224 225 pinctrl-names = "default"; 226 pinctrl-0 = <&pins_uart4>; 227}; 228 229&i2c0 { 230 status = "okay"; 231 232 pinctrl-names = "default"; 233 pinctrl-0 = <&pins_i2c0>; 234 235 clock-frequency = <400000>; 236 237 act8600: act8600@5a { 238 compatible = "active-semi,act8600"; 239 reg = <0x5a>; 240 241 regulators { 242 vddcore: DCDC1 { 243 regulator-min-microvolt = <1100000>; 244 regulator-max-microvolt = <1100000>; 245 vp1-supply = <&vcc_33v>; 246 regulator-always-on; 247 }; 248 vddmem: DCDC2 { 249 regulator-min-microvolt = <1500000>; 250 regulator-max-microvolt = <1500000>; 251 vp2-supply = <&vcc_33v>; 252 regulator-always-on; 253 }; 254 vcc_33: DCDC3 { 255 regulator-min-microvolt = <3300000>; 256 regulator-max-microvolt = <3300000>; 257 vp3-supply = <&vcc_33v>; 258 regulator-always-on; 259 }; 260 vcc_50: SUDCDC_REG4 { 261 regulator-min-microvolt = <5000000>; 262 regulator-max-microvolt = <5000000>; 263 regulator-always-on; 264 }; 265 vcc_25: LDO5 { 266 regulator-min-microvolt = <2500000>; 267 regulator-max-microvolt = <2500000>; 268 inl-supply = <&vcc_33v>; 269 regulator-always-on; 270 }; 271 wifi_io: LDO6 { 272 regulator-min-microvolt = <2500000>; 273 regulator-max-microvolt = <2500000>; 274 inl-supply = <&vcc_33v>; 275 }; 276 cim_io_28: LDO7 { 277 regulator-min-microvolt = <2800000>; 278 regulator-max-microvolt = <2800000>; 279 inl-supply = <&vcc_33v>; 280 }; 281 cim_io_15: LDO8 { 282 regulator-min-microvolt = <1500000>; 283 regulator-max-microvolt = <1500000>; 284 inl-supply = <&vcc_33v>; 285 }; 286 vrtc_18: LDO_REG9 { 287 /* Despite the datasheet stating 3.3V 288 * for REG9 and the driver expecting that, 289 * REG9 outputs 1.8V. 290 * Likely the CI20 uses a proprietary 291 * factory programmed chip variant. 292 * Since this is a simple on/off LDO the 293 * exact values do not matter. 294 */ 295 regulator-min-microvolt = <3300000>; 296 regulator-max-microvolt = <3300000>; 297 regulator-always-on; 298 }; 299 vcc_11: LDO_REG10 { 300 regulator-min-microvolt = <1200000>; 301 regulator-max-microvolt = <1200000>; 302 regulator-always-on; 303 }; 304 }; 305 }; 306}; 307 308&i2c1 { 309 status = "okay"; 310 311 pinctrl-names = "default"; 312 pinctrl-0 = <&pins_i2c1>; 313 314}; 315 316&i2c2 { 317 status = "okay"; 318 319 pinctrl-names = "default"; 320 pinctrl-0 = <&pins_i2c2>; 321 322}; 323 324&i2c3 { 325 status = "okay"; 326 327 pinctrl-names = "default"; 328 pinctrl-0 = <&pins_i2c3>; 329 330}; 331 332&i2c4 { 333 status = "okay"; 334 335 pinctrl-names = "default"; 336 pinctrl-0 = <&pins_i2c4>; 337 338 clock-frequency = <400000>; 339 340 rtc@51 { 341 compatible = "nxp,pcf8563"; 342 reg = <0x51>; 343 344 interrupt-parent = <&gpf>; 345 interrupts = <30 IRQ_TYPE_LEVEL_LOW>; 346 }; 347}; 348 349&nemc { 350 status = "okay"; 351 352 nandc: nand-controller@1 { 353 compatible = "ingenic,jz4780-nand"; 354 reg = <1 0 0x1000000>; 355 356 #address-cells = <1>; 357 #size-cells = <0>; 358 359 ingenic,bch-controller = <&bch>; 360 361 ingenic,nemc-tAS = <10>; 362 ingenic,nemc-tAH = <5>; 363 ingenic,nemc-tBP = <10>; 364 ingenic,nemc-tAW = <15>; 365 ingenic,nemc-tSTRV = <100>; 366 367 /* 368 * Only CLE/ALE are needed for the devices that are connected, rather 369 * than the full address line set. 370 */ 371 pinctrl-names = "default"; 372 pinctrl-0 = <&pins_nemc>; 373 374 nand@1 { 375 reg = <1>; 376 377 nand-ecc-step-size = <1024>; 378 nand-ecc-strength = <24>; 379 nand-ecc-mode = "hw"; 380 nand-on-flash-bbt; 381 382 pinctrl-names = "default"; 383 pinctrl-0 = <&pins_nemc_cs1>; 384 385 partitions { 386 compatible = "fixed-partitions"; 387 #address-cells = <2>; 388 #size-cells = <2>; 389 390 partition@0 { 391 label = "u-boot-spl"; 392 reg = <0x0 0x0 0x0 0x800000>; 393 }; 394 395 partition@800000 { 396 label = "u-boot"; 397 reg = <0x0 0x800000 0x0 0x200000>; 398 }; 399 400 partition@a00000 { 401 label = "u-boot-env"; 402 reg = <0x0 0xa00000 0x0 0x200000>; 403 }; 404 405 partition@c00000 { 406 label = "boot"; 407 reg = <0x0 0xc00000 0x0 0x4000000>; 408 }; 409 410 partition@4c00000 { 411 label = "system"; 412 reg = <0x0 0x4c00000 0x1 0xfb400000>; 413 }; 414 }; 415 }; 416 }; 417 418 dm9000@6 { 419 compatible = "davicom,dm9000"; 420 davicom,no-eeprom; 421 422 pinctrl-names = "default"; 423 pinctrl-0 = <&pins_nemc_cs6>; 424 425 reg = <6 0 1 /* addr */ 426 6 2 1>; /* data */ 427 428 ingenic,nemc-tAS = <15>; 429 ingenic,nemc-tAH = <10>; 430 ingenic,nemc-tBP = <20>; 431 ingenic,nemc-tAW = <50>; 432 ingenic,nemc-tSTRV = <100>; 433 434 reset-gpios = <&gpf 12 GPIO_ACTIVE_LOW>; 435 vcc-supply = <ð0_power>; 436 437 interrupt-parent = <&gpe>; 438 interrupts = <19 4>; 439 440 nvmem-cells = <ð0_addr>; 441 nvmem-cell-names = "mac-address"; 442 }; 443}; 444 445&bch { 446 status = "okay"; 447}; 448 449&otg_phy { 450 status = "okay"; 451 452 vcc-supply = <&otg_power>; 453}; 454 455&otg { 456 status = "okay"; 457}; 458 459&pinctrl { 460 pins_uart0: uart0 { 461 function = "uart0"; 462 groups = "uart0-data"; 463 bias-disable; 464 }; 465 466 pins_uart1: uart1 { 467 function = "uart1"; 468 groups = "uart1-data"; 469 bias-disable; 470 }; 471 472 pins_uart2: uart2 { 473 function = "uart2"; 474 groups = "uart2-data", "uart2-hwflow"; 475 bias-disable; 476 }; 477 478 pins_uart3: uart3 { 479 function = "uart3"; 480 groups = "uart3-data", "uart3-hwflow"; 481 bias-disable; 482 }; 483 484 pins_uart4: uart4 { 485 function = "uart4"; 486 groups = "uart4-data"; 487 bias-disable; 488 }; 489 490 pins_i2c0: i2c0 { 491 function = "i2c0"; 492 groups = "i2c0-data"; 493 bias-disable; 494 }; 495 496 pins_i2c1: i2c1 { 497 function = "i2c1"; 498 groups = "i2c1-data"; 499 bias-disable; 500 }; 501 502 pins_i2c2: i2c2 { 503 function = "i2c2"; 504 groups = "i2c2-data"; 505 bias-disable; 506 }; 507 508 pins_i2c3: i2c3 { 509 function = "i2c3"; 510 groups = "i2c3-data"; 511 bias-disable; 512 }; 513 514 pins_i2c4: i2c4 { 515 function = "i2c4"; 516 groups = "i2c4-data-e"; 517 bias-disable; 518 }; 519 520 pins_hdmi_ddc: hdmi_ddc { 521 function = "hdmi-ddc"; 522 groups = "hdmi-ddc"; 523 bias-disable; 524 }; 525 526 pins_nemc: nemc { 527 function = "nemc"; 528 groups = "nemc-data", "nemc-cle-ale", "nemc-rd-we", "nemc-frd-fwe"; 529 bias-disable; 530 }; 531 532 pins_nemc_cs1: nemc-cs1 { 533 function = "nemc-cs1"; 534 groups = "nemc-cs1"; 535 bias-disable; 536 }; 537 538 pins_nemc_cs6: nemc-cs6 { 539 function = "nemc-cs6"; 540 groups = "nemc-cs6"; 541 bias-disable; 542 }; 543 544 pins_mmc0: mmc0 { 545 function = "mmc0"; 546 groups = "mmc0-1bit-e", "mmc0-4bit-e"; 547 bias-disable; 548 }; 549 550 pins_mmc1: mmc1 { 551 function = "mmc1"; 552 groups = "mmc1-1bit-d", "mmc1-4bit-d"; 553 bias-disable; 554 }; 555}; 556 557&hdmi { 558 status = "okay"; 559 560 pinctrl-names = "default"; 561 pinctrl-0 = <&pins_hdmi_ddc>; 562 563 ports { 564 #address-cells = <1>; 565 #size-cells = <0>; 566 567 port@0 { 568 reg = <0>; 569 dw_hdmi_in: endpoint { 570 remote-endpoint = <&lcd_out>; 571 }; 572 }; 573 574 port@1 { 575 reg = <1>; 576 dw_hdmi_out: endpoint { 577 remote-endpoint = <&hdmi_con>; 578 }; 579 }; 580 }; 581}; 582 583&lcdc0 { 584 status = "okay"; 585 586 port { 587 lcd_out: endpoint { 588 remote-endpoint = <&dw_hdmi_in>; 589 }; 590 }; 591}; 592