0001 // SPDX-License-Identifier: GPL-2.0
0002 /dts-v1/;
0003
0004 #include "jz4780.dtsi"
0005 #include <dt-bindings/clock/ingenic,tcu.h>
0006 #include <dt-bindings/gpio/gpio.h>
0007 #include <dt-bindings/input/input.h>
0008 #include <dt-bindings/interrupt-controller/irq.h>
0009 #include <dt-bindings/regulator/active-semi,8865-regulator.h>
0010
0011 / {
0012 compatible = "img,ci20", "ingenic,jz4780";
0013
0014 aliases {
0015 serial0 = &uart0;
0016 serial1 = &uart1;
0017 serial3 = &uart3;
0018 serial4 = &uart4;
0019 };
0020
0021 chosen {
0022 stdout-path = &uart4;
0023 };
0024
0025 memory {
0026 device_type = "memory";
0027 reg = <0x0 0x10000000
0028 0x30000000 0x30000000>;
0029 };
0030
0031 gpio-keys {
0032 compatible = "gpio-keys";
0033
0034 switch {
0035 label = "ci20:sw1";
0036 linux,code = <KEY_F13>;
0037 gpios = <&gpd 17 GPIO_ACTIVE_HIGH>;
0038 wakeup-source;
0039 };
0040 };
0041
0042 leds {
0043 compatible = "gpio-leds";
0044
0045 led0 {
0046 label = "ci20:red:led0";
0047 gpios = <&gpc 3 GPIO_ACTIVE_HIGH>;
0048 linux,default-trigger = "none";
0049 };
0050
0051 led1 {
0052 label = "ci20:red:led1";
0053 gpios = <&gpc 2 GPIO_ACTIVE_HIGH>;
0054 linux,default-trigger = "nand-disk";
0055 };
0056
0057 led2 {
0058 label = "ci20:red:led2";
0059 gpios = <&gpc 1 GPIO_ACTIVE_HIGH>;
0060 linux,default-trigger = "cpu1";
0061 };
0062
0063 led3 {
0064 label = "ci20:red:led3";
0065 gpios = <&gpc 0 GPIO_ACTIVE_HIGH>;
0066 linux,default-trigger = "cpu0";
0067 };
0068 };
0069
0070 eth0_power: fixedregulator@0 {
0071 compatible = "regulator-fixed";
0072
0073 regulator-name = "eth0_power";
0074 regulator-min-microvolt = <3300000>;
0075 regulator-max-microvolt = <3300000>;
0076
0077 gpio = <&gpb 25 GPIO_ACTIVE_LOW>;
0078 enable-active-high;
0079 };
0080
0081 hdmi_out: connector {
0082 compatible = "hdmi-connector";
0083 label = "HDMI OUT";
0084 type = "a";
0085
0086 ddc-en-gpios = <&gpa 25 GPIO_ACTIVE_HIGH>;
0087
0088 port {
0089 hdmi_con: endpoint {
0090 remote-endpoint = <&dw_hdmi_out>;
0091 };
0092 };
0093 };
0094
0095 ir: ir {
0096 compatible = "gpio-ir-receiver";
0097 gpios = <&gpe 3 GPIO_ACTIVE_LOW>;
0098 };
0099
0100 wlan0_power: fixedregulator@1 {
0101 compatible = "regulator-fixed";
0102
0103 regulator-name = "wlan0_power";
0104
0105 gpio = <&gpb 19 GPIO_ACTIVE_LOW>;
0106 enable-active-high;
0107 };
0108
0109 otg_power: fixedregulator@2 {
0110 compatible = "regulator-fixed";
0111
0112 regulator-name = "otg_power";
0113 regulator-min-microvolt = <5000000>;
0114 regulator-max-microvolt = <5000000>;
0115
0116 gpio = <&gpf 14 GPIO_ACTIVE_LOW>;
0117 enable-active-high;
0118 };
0119 };
0120
0121 &ext {
0122 clock-frequency = <48000000>;
0123 };
0124
0125 &cgu {
0126 /*
0127 * Use the 32.768 kHz oscillator as the parent of the RTC for a higher
0128 * precision.
0129 */
0130 assigned-clocks = <&cgu JZ4780_CLK_OTGPHY>, <&cgu JZ4780_CLK_RTC>,
0131 <&cgu JZ4780_CLK_SSIPLL>, <&cgu JZ4780_CLK_SSI>,
0132 <&cgu JZ4780_CLK_HDMI>;
0133 assigned-clock-parents = <0>, <&cgu JZ4780_CLK_RTCLK>,
0134 <&cgu JZ4780_CLK_MPLL>,
0135 <&cgu JZ4780_CLK_SSIPLL>;
0136 assigned-clock-rates = <48000000>, <0>, <54000000>, <0>, <27000000>;
0137 };
0138
0139 &tcu {
0140 /*
0141 * 750 kHz for the system timers and clocksource,
0142 * use channel #0 and #1 for the per cpu system timers,
0143 * and use channel #2 for the clocksource.
0144 *
0145 * 3000 kHz for the OST timer to provide a higher
0146 * precision clocksource.
0147 */
0148 assigned-clocks = <&tcu TCU_CLK_TIMER0>, <&tcu TCU_CLK_TIMER1>,
0149 <&tcu TCU_CLK_TIMER2>, <&tcu TCU_CLK_OST>;
0150 assigned-clock-rates = <750000>, <750000>, <750000>, <3000000>;
0151 };
0152
0153 &mmc0 {
0154 status = "okay";
0155
0156 bus-width = <4>;
0157 max-frequency = <50000000>;
0158
0159 pinctrl-names = "default";
0160 pinctrl-0 = <&pins_mmc0>;
0161
0162 cd-gpios = <&gpf 20 GPIO_ACTIVE_LOW>;
0163 };
0164
0165 &mmc1 {
0166 status = "okay";
0167
0168 bus-width = <4>;
0169 max-frequency = <50000000>;
0170 non-removable;
0171
0172 pinctrl-names = "default";
0173 pinctrl-0 = <&pins_mmc1>;
0174
0175 brcmf: wifi@1 {
0176 /* reg = <4>;*/
0177 compatible = "brcm,bcm4330-fmac";
0178 vcc-supply = <&wlan0_power>;
0179 device-wakeup-gpios = <&gpd 9 GPIO_ACTIVE_HIGH>;
0180 shutdown-gpios = <&gpf 7 GPIO_ACTIVE_LOW>;
0181 };
0182 };
0183
0184 &uart0 {
0185 status = "okay";
0186
0187 pinctrl-names = "default";
0188 pinctrl-0 = <&pins_uart0>;
0189 };
0190
0191 &uart1 {
0192 status = "okay";
0193
0194 pinctrl-names = "default";
0195 pinctrl-0 = <&pins_uart1>;
0196 };
0197
0198 &uart2 {
0199 status = "okay";
0200
0201 pinctrl-names = "default";
0202 pinctrl-0 = <&pins_uart2>;
0203 uart-has-rtscts;
0204
0205 bluetooth {
0206 compatible = "brcm,bcm4330-bt";
0207 reset-gpios = <&gpf 8 GPIO_ACTIVE_HIGH>;
0208 vcc-supply = <&wlan0_power>;
0209 device-wakeup-gpios = <&gpf 5 GPIO_ACTIVE_HIGH>;
0210 host-wakeup-gpios = <&gpf 6 GPIO_ACTIVE_HIGH>;
0211 shutdown-gpios = <&gpf 4 GPIO_ACTIVE_LOW>;
0212 };
0213 };
0214
0215 &uart3 {
0216 status = "okay";
0217
0218 pinctrl-names = "default";
0219 pinctrl-0 = <&pins_uart3>;
0220 };
0221
0222 &uart4 {
0223 status = "okay";
0224
0225 pinctrl-names = "default";
0226 pinctrl-0 = <&pins_uart4>;
0227 };
0228
0229 &i2c0 {
0230 status = "okay";
0231
0232 pinctrl-names = "default";
0233 pinctrl-0 = <&pins_i2c0>;
0234
0235 clock-frequency = <400000>;
0236
0237 act8600: act8600@5a {
0238 compatible = "active-semi,act8600";
0239 reg = <0x5a>;
0240 status = "okay";
0241
0242 regulators {
0243 vddcore: SUDCDC1 {
0244 regulator-name = "DCDC_REG1";
0245 regulator-min-microvolt = <1100000>;
0246 regulator-max-microvolt = <1100000>;
0247 regulator-always-on;
0248 };
0249 vddmem: SUDCDC2 {
0250 regulator-name = "DCDC_REG2";
0251 regulator-min-microvolt = <1500000>;
0252 regulator-max-microvolt = <1500000>;
0253 regulator-always-on;
0254 };
0255 vcc_33: SUDCDC3 {
0256 regulator-name = "DCDC_REG3";
0257 regulator-min-microvolt = <3300000>;
0258 regulator-max-microvolt = <3300000>;
0259 regulator-always-on;
0260 };
0261 vcc_50: SUDCDC4 {
0262 regulator-name = "SUDCDC_REG4";
0263 regulator-min-microvolt = <5000000>;
0264 regulator-max-microvolt = <5000000>;
0265 regulator-always-on;
0266 };
0267 vcc_25: LDO_REG5 {
0268 regulator-name = "LDO_REG5";
0269 regulator-min-microvolt = <2500000>;
0270 regulator-max-microvolt = <2500000>;
0271 regulator-always-on;
0272 };
0273 wifi_io: LDO_REG6 {
0274 regulator-name = "LDO_REG6";
0275 regulator-min-microvolt = <2500000>;
0276 regulator-max-microvolt = <2500000>;
0277 regulator-always-on;
0278 };
0279 vcc_28: LDO_REG7 {
0280 regulator-name = "LDO_REG7";
0281 regulator-min-microvolt = <2800000>;
0282 regulator-max-microvolt = <2800000>;
0283 regulator-always-on;
0284 };
0285 vcc_15: LDO_REG8 {
0286 regulator-name = "LDO_REG8";
0287 regulator-min-microvolt = <1500000>;
0288 regulator-max-microvolt = <1500000>;
0289 regulator-always-on;
0290 };
0291 vrtc_18: LDO_REG9 {
0292 regulator-name = "LDO_REG9";
0293 /* Despite the datasheet stating 3.3V
0294 * for REG9 and the driver expecting that,
0295 * REG9 outputs 1.8V.
0296 * Likely the CI20 uses a proprietary
0297 * factory programmed chip variant.
0298 * Since this is a simple on/off LDO the
0299 * exact values do not matter.
0300 */
0301 regulator-min-microvolt = <3300000>;
0302 regulator-max-microvolt = <3300000>;
0303 regulator-always-on;
0304 };
0305 vcc_11: LDO_REG10 {
0306 regulator-name = "LDO_REG10";
0307 regulator-min-microvolt = <1200000>;
0308 regulator-max-microvolt = <1200000>;
0309 regulator-always-on;
0310 };
0311 };
0312 };
0313 };
0314
0315 &i2c1 {
0316 status = "okay";
0317
0318 pinctrl-names = "default";
0319 pinctrl-0 = <&pins_i2c1>;
0320
0321 };
0322
0323 &i2c2 {
0324 status = "okay";
0325
0326 pinctrl-names = "default";
0327 pinctrl-0 = <&pins_i2c2>;
0328
0329 };
0330
0331 &i2c3 {
0332 status = "okay";
0333
0334 pinctrl-names = "default";
0335 pinctrl-0 = <&pins_i2c3>;
0336
0337 };
0338
0339 &i2c4 {
0340 status = "okay";
0341
0342 pinctrl-names = "default";
0343 pinctrl-0 = <&pins_i2c4>;
0344
0345 clock-frequency = <400000>;
0346
0347 rtc@51 {
0348 compatible = "nxp,pcf8563";
0349 reg = <0x51>;
0350
0351 interrupt-parent = <&gpf>;
0352 interrupts = <30 IRQ_TYPE_LEVEL_LOW>;
0353 };
0354 };
0355
0356 &nemc {
0357 status = "okay";
0358
0359 nandc: nand-controller@1 {
0360 compatible = "ingenic,jz4780-nand";
0361 reg = <1 0 0x1000000>;
0362
0363 #address-cells = <1>;
0364 #size-cells = <0>;
0365
0366 ingenic,bch-controller = <&bch>;
0367
0368 ingenic,nemc-tAS = <10>;
0369 ingenic,nemc-tAH = <5>;
0370 ingenic,nemc-tBP = <10>;
0371 ingenic,nemc-tAW = <15>;
0372 ingenic,nemc-tSTRV = <100>;
0373
0374 /*
0375 * Only CLE/ALE are needed for the devices that are connected, rather
0376 * than the full address line set.
0377 */
0378 pinctrl-names = "default";
0379 pinctrl-0 = <&pins_nemc>;
0380
0381 nand@1 {
0382 reg = <1>;
0383
0384 nand-ecc-step-size = <1024>;
0385 nand-ecc-strength = <24>;
0386 nand-ecc-mode = "hw";
0387 nand-on-flash-bbt;
0388
0389 pinctrl-names = "default";
0390 pinctrl-0 = <&pins_nemc_cs1>;
0391
0392 partitions {
0393 compatible = "fixed-partitions";
0394 #address-cells = <2>;
0395 #size-cells = <2>;
0396
0397 partition@0 {
0398 label = "u-boot-spl";
0399 reg = <0x0 0x0 0x0 0x800000>;
0400 };
0401
0402 partition@800000 {
0403 label = "u-boot";
0404 reg = <0x0 0x800000 0x0 0x200000>;
0405 };
0406
0407 partition@a00000 {
0408 label = "u-boot-env";
0409 reg = <0x0 0xa00000 0x0 0x200000>;
0410 };
0411
0412 partition@c00000 {
0413 label = "boot";
0414 reg = <0x0 0xc00000 0x0 0x4000000>;
0415 };
0416
0417 partition@4c00000 {
0418 label = "system";
0419 reg = <0x0 0x4c00000 0x1 0xfb400000>;
0420 };
0421 };
0422 };
0423 };
0424
0425 dm9000@6 {
0426 compatible = "davicom,dm9000";
0427 davicom,no-eeprom;
0428
0429 pinctrl-names = "default";
0430 pinctrl-0 = <&pins_nemc_cs6>;
0431
0432 reg = <6 0 1 /* addr */
0433 6 2 1>; /* data */
0434
0435 ingenic,nemc-tAS = <15>;
0436 ingenic,nemc-tAH = <10>;
0437 ingenic,nemc-tBP = <20>;
0438 ingenic,nemc-tAW = <50>;
0439 ingenic,nemc-tSTRV = <100>;
0440
0441 reset-gpios = <&gpf 12 GPIO_ACTIVE_HIGH>;
0442 vcc-supply = <ð0_power>;
0443
0444 interrupt-parent = <&gpe>;
0445 interrupts = <19 4>;
0446
0447 nvmem-cells = <ð0_addr>;
0448 nvmem-cell-names = "mac-address";
0449 };
0450 };
0451
0452 &bch {
0453 status = "okay";
0454 };
0455
0456 &otg_phy {
0457 status = "okay";
0458
0459 vcc-supply = <&otg_power>;
0460 };
0461
0462 &otg {
0463 status = "okay";
0464 };
0465
0466 &pinctrl {
0467 pins_uart0: uart0 {
0468 function = "uart0";
0469 groups = "uart0-data";
0470 bias-disable;
0471 };
0472
0473 pins_uart1: uart1 {
0474 function = "uart1";
0475 groups = "uart1-data";
0476 bias-disable;
0477 };
0478
0479 pins_uart2: uart2 {
0480 function = "uart2";
0481 groups = "uart2-data", "uart2-hwflow";
0482 bias-disable;
0483 };
0484
0485 pins_uart3: uart3 {
0486 function = "uart3";
0487 groups = "uart3-data", "uart3-hwflow";
0488 bias-disable;
0489 };
0490
0491 pins_uart4: uart4 {
0492 function = "uart4";
0493 groups = "uart4-data";
0494 bias-disable;
0495 };
0496
0497 pins_i2c0: i2c0 {
0498 function = "i2c0";
0499 groups = "i2c0-data";
0500 bias-disable;
0501 };
0502
0503 pins_i2c1: i2c1 {
0504 function = "i2c1";
0505 groups = "i2c1-data";
0506 bias-disable;
0507 };
0508
0509 pins_i2c2: i2c2 {
0510 function = "i2c2";
0511 groups = "i2c2-data";
0512 bias-disable;
0513 };
0514
0515 pins_i2c3: i2c3 {
0516 function = "i2c3";
0517 groups = "i2c3-data";
0518 bias-disable;
0519 };
0520
0521 pins_i2c4: i2c4 {
0522 function = "i2c4";
0523 groups = "i2c4-data-e";
0524 bias-disable;
0525 };
0526
0527 pins_hdmi_ddc: hdmi_ddc {
0528 function = "hdmi-ddc";
0529 groups = "hdmi-ddc";
0530 bias-disable;
0531 };
0532
0533 pins_nemc: nemc {
0534 function = "nemc";
0535 groups = "nemc-data", "nemc-cle-ale", "nemc-rd-we", "nemc-frd-fwe";
0536 bias-disable;
0537 };
0538
0539 pins_nemc_cs1: nemc-cs1 {
0540 function = "nemc-cs1";
0541 groups = "nemc-cs1";
0542 bias-disable;
0543 };
0544
0545 pins_nemc_cs6: nemc-cs6 {
0546 function = "nemc-cs6";
0547 groups = "nemc-cs6";
0548 bias-disable;
0549 };
0550
0551 pins_mmc0: mmc0 {
0552 function = "mmc0";
0553 groups = "mmc0-1bit-e", "mmc0-4bit-e";
0554 bias-disable;
0555 };
0556
0557 pins_mmc1: mmc1 {
0558 function = "mmc1";
0559 groups = "mmc1-1bit-d", "mmc1-4bit-d";
0560 bias-disable;
0561 };
0562 };
0563
0564 &hdmi {
0565 status = "okay";
0566
0567 pinctrl-names = "default";
0568 pinctrl-0 = <&pins_hdmi_ddc>;
0569
0570 ports {
0571 #address-cells = <1>;
0572 #size-cells = <0>;
0573
0574 port@0 {
0575 reg = <0>;
0576 dw_hdmi_in: endpoint {
0577 remote-endpoint = <&lcd_out>;
0578 };
0579 };
0580
0581 port@1 {
0582 reg = <1>;
0583 dw_hdmi_out: endpoint {
0584 remote-endpoint = <&hdmi_con>;
0585 };
0586 };
0587 };
0588 };
0589
0590 &lcdc0 {
0591 status = "okay";
0592
0593 port {
0594 lcd_out: endpoint {
0595 remote-endpoint = <&dw_hdmi_in>;
0596 };
0597 };
0598 };