1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 2023 Loongson Technology Corporation Limited 4 */ 5 6/dts-v1/; 7 8#include <dt-bindings/interrupt-controller/irq.h> 9#include <dt-bindings/clock/loongson,ls2k-clk.h> 10#include <dt-bindings/gpio/gpio.h> 11 12/ { 13 #address-cells = <2>; 14 #size-cells = <2>; 15 16 cpus { 17 #address-cells = <1>; 18 #size-cells = <0>; 19 20 cpu0: cpu@0 { 21 compatible = "loongson,la264"; 22 device_type = "cpu"; 23 reg= <0x0>; 24 clocks = <&clk LOONGSON2_NODE_CLK>; 25 }; 26 27 cpu1: cpu@1 { 28 compatible = "loongson,la264"; 29 device_type = "cpu"; 30 reg = <0x1>; 31 clocks = <&clk LOONGSON2_NODE_CLK>; 32 }; 33 }; 34 35 ref_100m: clock-ref-100m { 36 compatible = "fixed-clock"; 37 #clock-cells = <0>; 38 clock-frequency = <100000000>; 39 clock-output-names = "ref_100m"; 40 }; 41 42 cpuintc: interrupt-controller { 43 compatible = "loongson,cpu-interrupt-controller"; 44 #interrupt-cells = <1>; 45 interrupt-controller; 46 }; 47 48 /* i2c of the dvi eeprom edid */ 49 i2c-gpio-0 { 50 compatible = "i2c-gpio"; 51 scl-gpios = <&gpio0 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 52 sda-gpios = <&gpio0 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 53 i2c-gpio,delay-us = <5>; /* ~100 kHz */ 54 #address-cells = <1>; 55 #size-cells = <0>; 56 status = "disabled"; 57 }; 58 59 /* i2c of the eeprom edid */ 60 i2c-gpio-1 { 61 compatible = "i2c-gpio"; 62 scl-gpios = <&gpio0 33 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 63 sda-gpios = <&gpio0 32 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 64 i2c-gpio,delay-us = <5>; /* ~100 kHz */ 65 #address-cells = <1>; 66 #size-cells = <0>; 67 status = "disabled"; 68 }; 69 70 thermal-zones { 71 cpu_thermal: cpu-thermal { 72 polling-delay-passive = <1000>; 73 polling-delay = <5000>; 74 thermal-sensors = <&tsensor 0>; 75 76 trips { 77 cpu_alert: cpu-alert { 78 temperature = <33000>; 79 hysteresis = <2000>; 80 type = "active"; 81 }; 82 83 cpu_crit: cpu-crit { 84 temperature = <85000>; 85 hysteresis = <5000>; 86 type = "critical"; 87 }; 88 }; 89 }; 90 }; 91 92 bus@10000000 { 93 compatible = "simple-bus"; 94 ranges = <0x0 0x10000000 0x0 0x10000000 0x0 0x10000000>, 95 <0x0 0x02000000 0x0 0x02000000 0x0 0x02000000>, 96 <0x0 0x20000000 0x0 0x20000000 0x0 0x10000000>, 97 <0x0 0x40000000 0x0 0x40000000 0x0 0x40000000>, 98 <0xfe 0x0 0xfe 0x0 0x0 0x40000000>; 99 #address-cells = <2>; 100 #size-cells = <2>; 101 dma-coherent; 102 103 isa@18000000 { 104 compatible = "isa"; 105 #size-cells = <1>; 106 #address-cells = <2>; 107 ranges = <1 0x0 0x0 0x18000000 0x4000>; 108 }; 109 110 liointc0: interrupt-controller@1fe01400 { 111 compatible = "loongson,liointc-2.0"; 112 reg = <0x0 0x1fe01400 0x0 0x40>, 113 <0x0 0x1fe01040 0x0 0x8>, 114 <0x0 0x1fe01140 0x0 0x8>; 115 reg-names = "main", "isr0", "isr1"; 116 interrupt-controller; 117 #interrupt-cells = <2>; 118 interrupt-parent = <&cpuintc>; 119 interrupts = <2>; 120 interrupt-names = "int0"; 121 loongson,parent_int_map = <0xffffffff>, /* int0 */ 122 <0x00000000>, /* int1 */ 123 <0x00000000>, /* int2 */ 124 <0x00000000>; /* int3 */ 125 }; 126 127 liointc1: interrupt-controller@1fe01440 { 128 compatible = "loongson,liointc-2.0"; 129 reg = <0x0 0x1fe01440 0x0 0x40>, 130 <0x0 0x1fe01048 0x0 0x8>, 131 <0x0 0x1fe01148 0x0 0x8>; 132 reg-names = "main", "isr0", "isr1"; 133 interrupt-controller; 134 #interrupt-cells = <2>; 135 interrupt-parent = <&cpuintc>; 136 interrupts = <3>; 137 interrupt-names = "int1"; 138 loongson,parent_int_map = <0x00000000>, /* int0 */ 139 <0xffffffff>, /* int1 */ 140 <0x00000000>, /* int2 */ 141 <0x00000000>; /* int3 */ 142 }; 143 144 chipid@1fe00000 { 145 compatible = "loongson,ls2k-chipid"; 146 reg = <0x0 0x1fe00000 0x0 0x30>; 147 little-endian; 148 }; 149 150 pctrl: pinctrl@1fe00420 { 151 compatible = "loongson,ls2k-pinctrl"; 152 reg = <0x0 0x1fe00420 0x0 0x18>; 153 status = "disabled"; 154 }; 155 156 clk: clock-controller@1fe00480 { 157 compatible = "loongson,ls2k-clk"; 158 reg = <0x0 0x1fe00480 0x0 0x58>; 159 #clock-cells = <1>; 160 clocks = <&ref_100m>; 161 clock-names = "ref_100m"; 162 }; 163 164 gpio0: gpio@1fe00500 { 165 compatible = "loongson,ls2k-gpio"; 166 reg = <0x0 0x1fe00500 0x0 0x38>; 167 ngpios = <64>; 168 #gpio-cells = <2>; 169 gpio-controller; 170 gpio-ranges = <&pctrl 0x0 0x0 15>, 171 <&pctrl 16 16 15>, 172 <&pctrl 32 32 10>, 173 <&pctrl 44 44 20>; 174 interrupt-parent = <&liointc1>; 175 interrupts = <28 IRQ_TYPE_LEVEL_HIGH>, 176 <29 IRQ_TYPE_LEVEL_HIGH>, 177 <30 IRQ_TYPE_LEVEL_HIGH>, 178 <30 IRQ_TYPE_LEVEL_HIGH>, 179 <26 IRQ_TYPE_LEVEL_HIGH>, 180 <26 IRQ_TYPE_LEVEL_HIGH>, 181 <26 IRQ_TYPE_LEVEL_HIGH>, 182 <26 IRQ_TYPE_LEVEL_HIGH>, 183 <26 IRQ_TYPE_LEVEL_HIGH>, 184 <26 IRQ_TYPE_LEVEL_HIGH>, 185 <26 IRQ_TYPE_LEVEL_HIGH>, 186 <26 IRQ_TYPE_LEVEL_HIGH>, 187 <26 IRQ_TYPE_LEVEL_HIG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EVEL_HIGH>, 228 <27 IRQ_TYPE_LEVEL_HIGH>, 229 <27 IRQ_TYPE_LEVEL_HIGH>, 230 <27 IRQ_TYPE_LEVEL_HIGH>, 231 <27 IRQ_TYPE_LEVEL_HIGH>, 232 <27 IRQ_TYPE_LEVEL_HIGH>, 233 <27 IRQ_TYPE_LEVEL_HIGH>, 234 <27 IRQ_TYPE_LEVEL_HIGH>, 235 <27 IRQ_TYPE_LEVEL_HIGH>, 236 <27 IRQ_TYPE_LEVEL_HIGH>, 237 <27 IRQ_TYPE_LEVEL_HIGH>, 238 <27 IRQ_TYPE_LEVEL_HIGH>; 239 }; 240 241 tsensor: thermal-sensor@1fe01500 { 242 compatible = "loongson,ls2k1000-thermal"; 243 reg = <0x0 0x1fe01500 0x0 0x30>; 244 interrupt-parent = <&liointc0>; 245 interrupts = <7 IRQ_TYPE_LEVEL_HIGH>; 246 #thermal-sensor-cells = <1>; 247 }; 248 249 dma-controller@1fe00c00 { 250 compatible = "loongson,ls2k1000-apbdma"; 251 reg = <0x0 0x1fe00c00 0x0 0x8>; 252 interrupt-parent = <&liointc1>; 253 interrupts = <12 IRQ_TYPE_LEVEL_HIGH>; 254 clocks = <&clk LOONGSON2_APB_CLK>; 255 #dma-cells = <1>; 256 status = "disabled"; 257 }; 258 259 dma-controller@1fe00c10 { 260 compatible = "loongson,ls2k1000-apbdma"; 261 reg = <0x0 0x1fe00c10 0x0 0x8>; 262 interrupt-parent = <&liointc1>; 263 interrupts = <13 IRQ_TYPE_LEVEL_HIGH>; 264 clocks = <&clk LOONGSON2_APB_CLK>; 265 #dma-cells = <1>; 266 status = "disabled"; 267 }; 268 269 apbdma2: dma-controller@1fe00c20 { 270 compatible = "loongson,ls2k1000-apbdma"; 271 reg = <0x0 0x1fe00c20 0x0 0x8>; 272 interrupt-parent = <&liointc1>; 273 interrupts = <14 IRQ_TYPE_LEVEL_HIGH>; 274 clocks = <&clk LOONGSON2_APB_CLK>; 275 #dma-cells = <1>; 276 status = "disabled"; 277 }; 278 279 apbdma3: dma-controller@1fe00c30 { 280 compatible = "loongson,ls2k1000-apbdma"; 281 reg = <0x0 0x1fe00c30 0x0 0x8>; 282 interrupt-parent = <&liointc1>; 283 interrupts = <15 IRQ_TYPE_LEVEL_HIGH>; 284 clocks = <&clk LOONGSON2_APB_CLK>; 285 #dma-cells = <1>; 286 status = "disabled"; 287 }; 288 289 dma-controller@1fe00c40 { 290 compatible = "loongson,ls2k1000-apbdma"; 291 reg = <0x0 0x1fe00c40 0x0 0x8>; 292 interrupt-parent = <&liointc1>; 293 interrupts = <16 IRQ_TYPE_LEVEL_HIGH>; 294 clocks = <&clk LOONGSON2_APB_CLK>; 295 #dma-cells = <1>; 296 status = "disabled"; 297 }; 298 299 uart0: serial@1fe20000 { 300 compatible = "ns16550a"; 301 reg = <0x0 0x1fe20000 0x0 0x10>; 302 clock-frequency = <125000000>; 303 interrupt-parent = <&liointc0>; 304 interrupts = <0x0 IRQ_TYPE_LEVEL_HIGH>; 305 no-loopback-test; 306 status = "disabled"; 307 }; 308 309 i2c2: i2c@1fe21000 { 310 compatible = "loongson,ls2k-i2c"; 311 reg = <0x0 0x1fe21000 0x0 0x8>; 312 interrupt-parent = <&liointc0>; 313 interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; 314 status = "disabled"; 315 }; 316 317 i2c3: i2c@1fe21800 { 318 compatible = "loongson,ls2k-i2c"; 319 reg = <0x0 0x1fe21800 0x0 0x8>; 320 interrupt-parent = <&liointc0>; 321 interrupts = <23 IRQ_TYPE_LEVEL_HIGH>; 322 status = "disabled"; 323 }; 324 325 pwm@1fe22000 { 326 compatible = "loongson,ls2k1000-pwm", "loongson,ls7a-pwm"; 327 reg = <0x0 0x1fe22000 0x0 0x10>; 328 interrupt-parent = <&liointc0>; 329 interrupts = <24 IRQ_TYPE_LEVEL_HIGH>; 330 clocks = <&clk LOONGSON2_APB_CLK>; 331 #pwm-cells = <3>; 332 status = "disabled"; 333 }; 334 335 pwm1: pwm@1fe22010 { 336 compatible = "loongson,ls2k1000-pwm", "loongson,ls7a-pwm"; 337 reg = <0x0 0x1fe22010 0x0 0x10>; 338 interrupt-parent = <&liointc0>; 339 interrupts = <25 IRQ_TYPE_LEVEL_HIGH>; 340 clocks = <&clk LOONGSON2_APB_CLK>; 341 #pwm-cells = <3>; 342 status = "disabled"; 343 }; 344 345 pwm@1fe22020 { 346 compatible = "loongson,ls2k1000-pwm", "loongson,ls7a-pwm"; 347 reg = <0x0 0x1fe22020 0x0 0x10>; 348 interrupt-parent = <&liointc0>; 349 interrupts = <26 IRQ_TYPE_LEVEL_HIGH>; 350 clocks = <&clk LOONGSON2_APB_CLK>; 351 #pwm-cells = <3>; 352 status = "disabled"; 353 }; 354 355 pwm@1fe22030 { 356 compatible = "loongson,ls2k1000-pwm", "loongson,ls7a-pwm"; 357 reg = <0x0 0x1fe22030 0x0 0x10>; 358 interrupt-parent = <&liointc0>; 359 interrupts = <27 IRQ_TYPE_LEVEL_HIGH>; 360 clocks = <&clk LOONGSON2_APB_CLK>; 361 #pwm-cells = <3>; 362 status = "disabled"; 363 }; 364 365 pmc: power-management@1fe27000 { 366 compatible = "loongson,ls2k1000-pmc", "loongson,ls2k0500-pmc", "syscon"; 367 reg = <0x0 0x1fe27000 0x0 0x58>; 368 interrupt-parent = <&liointc1>; 369 interrupts = <11 IRQ_TYPE_LEVEL_HIGH>; 370 loongson,suspend-address = <0x0 0x1c000500>; 371 372 syscon-reboot { 373 compatible = "syscon-reboot"; 374 offset = <0x30>; 375 mask = <0x1>; 376 }; 377 378 syscon-poweroff { 379 compatible = "syscon-poweroff"; 380 regmap = <&pmc>; 381 offset = <0x14>; 382 mask = <0x3c00>; 383 value = <0x3c00>; 384 }; 385 }; 386 387 rtc0: rtc@1fe27800 { 388 compatible = "loongson,ls2k1000-rtc"; 389 reg = <0x0 0x1fe27800 0x0 0x100>; 390 interrupt-parent = <&liointc1>; 391 interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; 392 status = "disabled"; 393 }; 394 395 i2s: i2s@1fe2d000 { 396 compatible = "loongson,ls2k1000-i2s"; 397 reg = <0 0x1fe2d000 0 0x14>, 398 <0 0x1fe00438 0 0x8>; 399 interrupt-parent = <&liointc0>; 400 interrupts = <5 IRQ_TYPE_LEVEL_HIGH>; 401 clocks = <&clk LOONGSON2_APB_CLK>; 402 dmas = <&apbdma2 0>, <&apbdma3 0>; 403 dma-names = "tx", "rx"; 404 #sound-dai-cells = <0>; 405 status = "disabled"; 406 }; 407 408 spi0: spi@1fff0220 { 409 compatible = "loongson,ls2k1000-spi"; 410 reg = <0x0 0x1fff0220 0x0 0x10>; 411 clocks = <&clk LOONGSON2_BOOT_CLK>; 412 status = "disabled"; 413 }; 414 415 pcie@1a000000 { 416 compatible = "loongson,ls2k-pci"; 417 reg = <0x0 0x1a000000 0x0 0x02000000>, 418 <0xfe 0x0 0x0 0x20000000>; 419 #address-cells = <3>; 420 #size-cells = <2>; 421 device_type = "pci"; 422 bus-range = <0x0 0xff>; 423 ranges = <0x01000000 0x0 0x00008000 0x0 0x18008000 0x0 0x00008000>, 424 <0x02000000 0x0 0x60000000 0x0 0x60000000 0x0 0x20000000>; 425 426 gmac0: ethernet@3,0 { 427 reg = <0x1800 0x0 0x0 0x0 0x0>; 428 interrupt-parent = <&liointc0>; 429 interrupts = <12 IRQ_TYPE_LEVEL_HIGH>, 430 <13 IRQ_TYPE_LEVEL_HIGH>; 431 interrupt-names = "macirq", "eth_lpi"; 432 status = "disabled"; 433 }; 434 435 gmac1: ethernet@3,1 { 436 reg = <0x1900 0x0 0x0 0x0 0x0>; 437 interrupt-parent = <&liointc0>; 438 interrupts = <14 IRQ_TYPE_LEVEL_HIGH>, 439 <15 IRQ_TYPE_LEVEL_HIGH>; 440 interrupt-names = "macirq", "eth_lpi"; 441 status = "disabled"; 442 }; 443 444 ehci0: usb@4,1 { 445 reg = <0x2100 0x0 0x0 0x0 0x0>; 446 interrupt-parent = <&liointc1>; 447 interrupts = <18 IRQ_TYPE_LEVEL_HIGH>; 448 status = "disabled"; 449 }; 450 451 ohci0: usb@4,2 { 452 reg = <0x2200 0x0 0x0 0x0 0x0>; 453 interrupt-parent = <&liointc1>; 454 interrupts = <19 IRQ_TYPE_LEVEL_HIGH>; 455 status = "disabled"; 456 }; 457 458 display@6,0 { 459 reg = <0x3000 0x0 0x0 0x0 0x0>; 460 interrupt-parent = <&liointc0>; 461 interrupts = <28 IRQ_TYPE_LEVEL_HIGH>; 462 status = "disabled"; 463 }; 464 465 hda@7,0 { 466 reg = <0x3800 0x0 0x0 0x0 0x0>; 467 interrupt-parent = <&liointc0>; 468 interrupts = <4 IRQ_TYPE_LEVEL_HIGH>; 469 status = "disabled"; 470 }; 471 472 sata: sata@8,0 { 473 reg = <0x4000 0x0 0x0 0x0 0x0>; 474 interrupt-parent = <&liointc0>; 475 interrupts = <19 IRQ_TYPE_LEVEL_HIGH>; 476 status = "disabled"; 477 }; 478 479 pcie@9,0 { 480 reg = <0x4800 0x0 0x0 0x0 0x0>; 481 #address-cells = <3>; 482 #size-cells = <2>; 483 device_type = "pci"; 484 #interrupt-cells = <1>; 485 interrupt-map-mask = <0x0 0x0 0x0 0x0>; 486 interrupt-map = <0x0 0x0 0x0 0x0 &liointc1 0x0 IRQ_TYPE_LEVEL_HIGH>; 487 ranges; 488 }; 489 490 pcie@a,0 { 491 reg = <0x5000 0x0 0x0 0x0 0x0>; 492 #address-cells = <3>; 493 #size-cells = <2>; 494 device_type = "pci"; 495 interrupt-parent = <&liointc1>; 496 #interrupt-cells = <1>; 497 interrupt-map-mask = <0x0 0x0 0x0 0x0>; 498 interrupt-map = <0x0 0x0 0x0 0x0 &liointc1 1 IRQ_TYPE_LEVEL_HIGH>; 499 ranges; 500 }; 501 502 pcie@b,0 { 503 reg = <0x5800 0x0 0x0 0x0 0x0>; 504 #address-cells = <3>; 505 #size-cells = <2>; 506 device_type = "pci"; 507 interrupt-parent = <&liointc1>; 508 #interrupt-cells = <1>; 509 interrupt-map-mask = <0x0 0x0 0x0 0x0>; 510 interrupt-map = <0x0 0x0 0x0 0x0 &liointc1 2 IRQ_TYPE_LEVEL_HIGH>; 511 ranges; 512 }; 513 514 pcie@c,0 { 515 reg = <0x6000 0x0 0x0 0x0 0x0>; 516 #address-cells = <3>; 517 #size-cells = <2>; 518 device_type = "pci"; 519 interrupt-parent = <&liointc1>; 520 #interrupt-cells = <1>; 521 interrupt-map-mask = <0x0 0x0 0x0 0x0>; 522 interrupt-map = <0x0 0x0 0x0 0x0 &liointc1 3 IRQ_TYPE_LEVEL_HIGH>; 523 ranges; 524 }; 525 526 pcie@d,0 { 527 reg = <0x6800 0x0 0x0 0x0 0x0>; 528 #address-cells = <3>; 529 #size-cells = <2>; 530 device_type = "pci"; 531 interrupt-parent = <&liointc1>; 532 #interrupt-cells = <1>; 533 interrupt-map-mask = <0x0 0x0 0x0 0x0>; 534 interrupt-map = <0x0 0x0 0x0 0x0 &liointc1 4 IRQ_TYPE_LEVEL_HIGH>; 535 ranges; 536 }; 537 538 pcie@e,0 { 539 reg = <0x7000 0x0 0x0 0x0 0x0>; 540 #address-cells = <3>; 541 #size-cells = <2>; 542 device_type = "pci"; 543 interrupt-parent = <&liointc1>; 544 #interrupt-cells = <1>; 545 interrupt-map-mask = <0x0 0x0 0x0 0x0>; 546 interrupt-map = <0x0 0x0 0x0 0x0 &liointc1 5 IRQ_TYPE_LEVEL_HIGH>; 547 ranges; 548 }; 549 }; 550 }; 551}; 552