1// SPDX-License-Identifier: (GPL-2.0 OR MIT) 2/* 3 * Copyright (C) 2021 Alibaba Group Holding Limited. 4 * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> 5 */ 6 7#include <dt-bindings/interrupt-controller/irq.h> 8 9/ { 10 compatible = "thead,th1520"; 11 #address-cells = <2>; 12 #size-cells = <2>; 13 14 cpus: cpus { 15 #address-cells = <1>; 16 #size-cells = <0>; 17 timebase-frequency = <3000000>; 18 19 c910_0: cpu@0 { 20 compatible = "thead,c910", "riscv"; 21 device_type = "cpu"; 22 riscv,isa = "rv64imafdc"; 23 riscv,isa-base = "rv64i"; 24 riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr", 25 "zifencei", "zihpm"; 26 reg = <0>; 27 i-cache-block-size = <64>; 28 i-cache-size = <65536>; 29 i-cache-sets = <512>; 30 d-cache-block-size = <64>; 31 d-cache-size = <65536>; 32 d-cache-sets = <512>; 33 next-level-cache = <&l2_cache>; 34 mmu-type = "riscv,sv39"; 35 36 cpu0_intc: interrupt-controller { 37 compatible = "riscv,cpu-intc"; 38 interrupt-controller; 39 #interrupt-cells = <1>; 40 }; 41 }; 42 43 c910_1: cpu@1 { 44 compatible = "thead,c910", "riscv"; 45 device_type = "cpu"; 46 riscv,isa = "rv64imafdc"; 47 riscv,isa-base = "rv64i"; 48 riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr", 49 "zifencei", "zihpm"; 50 reg = <1>; 51 i-cache-block-size = <64>; 52 i-cache-size = <65536>; 53 i-cache-sets = <512>; 54 d-cache-block-size = <64>; 55 d-cache-size = <65536>; 56 d-cache-sets = <512>; 57 next-level-cache = <&l2_cache>; 58 mmu-type = "riscv,sv39"; 59 60 cpu1_intc: interrupt-controller { 61 compatible = "riscv,cpu-intc"; 62 interrupt-controller; 63 #interrupt-cells = <1>; 64 }; 65 }; 66 67 c910_2: cpu@2 { 68 compatible = "thead,c910", "riscv"; 69 device_type = "cpu"; 70 riscv,isa = "rv64imafdc"; 71 riscv,isa-base = "rv64i"; 72 riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr", 73 "zifencei", "zihpm"; 74 reg = <2>; 75 i-cache-block-size = <64>; 76 i-cache-size = <65536>; 77 i-cache-sets = <512>; 78 d-cache-block-size = <64>; 79 d-cache-size = <65536>; 80 d-cache-sets = <512>; 81 next-level-cache = <&l2_cache>; 82 mmu-type = "riscv,sv39"; 83 84 cpu2_intc: interrupt-controller { 85 compatible = "riscv,cpu-intc"; 86 interrupt-controller; 87 #interrupt-cells = <1>; 88 }; 89 }; 90 91 c910_3: cpu@3 { 92 compatible = "thead,c910", "riscv"; 93 device_type = "cpu"; 94 riscv,isa = "rv64imafdc"; 95 riscv,isa-base = "rv64i"; 96 riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "zicntr", "zicsr", 97 "zifencei", "zihpm"; 98 reg = <3>; 99 i-cache-block-size = <64>; 100 i-cache-size = <65536>; 101 i-cache-sets = <512>; 102 d-cache-block-size = <64>; 103 d-cache-size = <65536>; 104 d-cache-sets = <512>; 105 next-level-cache = <&l2_cache>; 106 mmu-type = "riscv,sv39"; 107 108 cpu3_intc: interrupt-controller { 109 compatible = "riscv,cpu-intc"; 110 interrupt-controller; 111 #interrupt-cells = <1>; 112 }; 113 }; 114 115 l2_cache: l2-cache { 116 compatible = "cache"; 117 cache-block-size = <64>; 118 cache-level = <2>; 119 cache-size = <1048576>; 120 cache-sets = <1024>; 121 cache-unified; 122 }; 123 }; 124 125 osc: oscillator { 126 compatible = "fixed-clock"; 127 clock-output-names = "osc_24m"; 128 #clock-cells = <0>; 129 }; 130 131 osc_32k: 32k-oscillator { 132 compatible = "fixed-clock"; 133 clock-output-names = "osc_32k"; 134 #clock-cells = <0>; 135 }; 136 137 apb_clk: apb-clk-clock { 138 compatible = "fixed-clock"; 139 clock-output-names = "apb_clk"; 140 #clock-cells = <0>; 141 }; 142 143 uart_sclk: uart-sclk-clock { 144 compatible = "fixed-clock"; 145 clock-output-names = "uart_sclk"; 146 #clock-cells = <0>; 147 }; 148 149 sdhci_clk: sdhci-clock { 150 compatible = "fixed-clock"; 151 clock-frequency = <198000000>; 152 clock-output-names = "sdhci_clk"; 153 #clock-cells = <0>; 154 }; 155 156 soc { 157 compatible = "simple-bus"; 158 interrupt-parent = <&plic>; 159 #address-cells = <2>; 160 #size-cells = <2>; 161 dma-noncoherent; 162 ranges; 163 164 plic: interrupt-controller@ffd8000000 { 165 compatible = "thead,th1520-plic", "thead,c900-plic"; 166 reg = <0xff 0xd8000000 0x0 0x01000000>; 167 interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>, 168 <&cpu1_intc 11>, <&cpu1_intc 9>, 169 <&cpu2_intc 11>, <&cpu2_intc 9>, 170 <&cpu3_intc 11>, <&cpu3_intc 9>; 171 interrupt-controller; 172 #address-cells = <0>; 173 #interrupt-cells = <2>; 174 riscv,ndev = <240>; 175 }; 176 177 clint: timer@ffdc000000 { 178 compatible = "thead,th1520-clint", "thead,c900-clint"; 179 reg = <0xff 0xdc000000 0x0 0x00010000>; 180 interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>, 181 <&cpu1_intc 3>, <&cpu1_intc 7>, 182 <&cpu2_intc 3>, <&cpu2_intc 7>, 183 <&cpu3_intc 3>, <&cpu3_intc 7>; 184 }; 185 186 uart0: serial@ffe7014000 { 187 compatible = "snps,dw-apb-uart"; 188 reg = <0xff 0xe7014000 0x0 0x100>; 189 interrupts = <36 IRQ_TYPE_LEVEL_HIGH>; 190 clocks = <&uart_sclk>; 191 reg-shift = <2>; 192 reg-io-width = <4>; 193 status = "disabled"; 194 }; 195 196 emmc: mmc@ffe7080000 { 197 compatible = "thead,th1520-dwcmshc"; 198 reg = <0xff 0xe7080000 0x0 0x10000>; 199 interrupts = <62 IRQ_TYPE_LEVEL_HIGH>; 200 clocks = <&sdhci_clk>; 201 clock-names = "core"; 202 status = "disabled"; 203 }; 204 205 sdio0: mmc@ffe7090000 { 206 compatible = "thead,th1520-dwcmshc"; 207 reg = <0xff 0xe7090000 0x0 0x10000>; 208 interrupts = <64 IRQ_TYPE_LEVEL_HIGH>; 209 clocks = <&sdhci_clk>; 210 clock-names = "core"; 211 status = "disabled"; 212 }; 213 214 sdio1: mmc@ffe70a0000 { 215 compatible = "thead,th1520-dwcmshc"; 216 reg = <0xff 0xe70a0000 0x0 0x10000>; 217 interrupts = <71 IRQ_TYPE_LEVEL_HIGH>; 218 clocks = <&sdhci_clk>; 219 clock-names = "core"; 220 status = "disabled"; 221 }; 222 223 uart1: serial@ffe7f00000 { 224 compatible = "snps,dw-apb-uart"; 225 reg = <0xff 0xe7f00000 0x0 0x100>; 226 interrupts = <37 IRQ_TYPE_LEVEL_HIGH>; 227 clocks = <&uart_sclk>; 228 reg-shift = <2>; 229 reg-io-width = <4>; 230 status = "disabled"; 231 }; 232 233 uart3: serial@ffe7f04000 { 234 compatible = "snps,dw-apb-uart"; 235 reg = <0xff 0xe7f04000 0x0 0x100>; 236 interrupts = <39 IRQ_TYPE_LEVEL_HIGH>; 237 clocks = <&uart_sclk>; 238 reg-shift = <2>; 239 reg-io-width = <4>; 240 status = "disabled"; 241 }; 242 243 gpio2: gpio@ffe7f34000 { 244 compatible = "snps,dw-apb-gpio"; 245 reg = <0xff 0xe7f34000 0x0 0x1000>; 246 #address-cells = <1>; 247 #size-cells = <0>; 248 249 portc: gpio-controller@0 { 250 compatible = "snps,dw-apb-gpio-port"; 251 gpio-controller; 252 #gpio-cells = <2>; 253 ngpios = <32>; 254 reg = <0>; 255 interrupt-controller; 256 #interrupt-cells = <2>; 257 interrupts = <58 IRQ_TYPE_LEVEL_HIGH>; 258 }; 259 }; 260 261 gpio3: gpio@ffe7f38000 { 262 compatible = "snps,dw-apb-gpio"; 263 reg = <0xff 0xe7f38000 0x0 0x1000>; 264 #address-cells = <1>; 265 #size-cells = <0>; 266 267 portd: gpio-controller@0 { 268 compatible = "snps,dw-apb-gpio-port"; 269 gpio-controller; 270 #gpio-cells = <2>; 271 ngpios = <32>; 272 reg = <0>; 273 interrupt-controller; 274 #interrupt-cells = <2>; 275 interrupts = <59 IRQ_TYPE_LEVEL_HIGH>; 276 }; 277 }; 278 279 gpio0: gpio@ffec005000 { 280 compatible = "snps,dw-apb-gpio"; 281 reg = <0xff 0xec005000 0x0 0x1000>; 282 #address-cells = <1>; 283 #size-cells = <0>; 284 285 porta: gpio-controller@0 { 286 compatible = "snps,dw-apb-gpio-port"; 287 gpio-controller; 288 #gpio-cells = <2>; 289 ngpios = <32>; 290 reg = <0>; 291 interrupt-controller; 292 #interrupt-cells = <2>; 293 interrupts = <56 IRQ_TYPE_LEVEL_HIGH>; 294 }; 295 }; 296 297 gpio1: gpio@ffec006000 { 298 compatible = "snps,dw-apb-gpio"; 299 reg = <0xff 0xec006000 0x0 0x1000>; 300 #address-cells = <1>; 301 #size-cells = <0>; 302 303 portb: gpio-controller@0 { 304 compatible = "snps,dw-apb-gpio-port"; 305 gpio-controller; 306 #gpio-cells = <2>; 307 ngpios = <32>; 308 reg = <0>; 309 interrupt-controller; 310 #interrupt-cells = <2>; 311 interrupts = <57 IRQ_TYPE_LEVEL_HIGH>; 312 }; 313 }; 314 315 uart2: serial@ffec010000 { 316 compatible = "snps,dw-apb-uart"; 317 reg = <0xff 0xec010000 0x0 0x4000>; 318 interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; 319 clocks = <&uart_sclk>; 320 reg-shift = <2>; 321 reg-io-width = <4>; 322 status = "disabled"; 323 }; 324 325 dmac0: dma-controller@ffefc00000 { 326 compatible = "snps,axi-dma-1.01a"; 327 reg = <0xff 0xefc00000 0x0 0x1000>; 328 interrupts = <27 IRQ_TYPE_LEVEL_HIGH>; 329 clocks = <&apb_clk>, <&apb_clk>; 330 clock-names = "core-clk", "cfgr-clk"; 331 #dma-cells = <1>; 332 dma-channels = <4>; 333 snps,block-size = <65536 65536 65536 65536>; 334 snps,priority = <0 1 2 3>; 335 snps,dma-masters = <1>; 336 snps,data-width = <4>; 337 snps,axi-max-burst-len = <16>; 338 status = "disabled"; 339 }; 340 341 timer0: timer@ffefc32000 { 342 compatible = "snps,dw-apb-timer"; 343 reg = <0xff 0xefc32000 0x0 0x14>; 344 clocks = <&apb_clk>; 345 clock-names = "timer"; 346 interrupts = <16 IRQ_TYPE_LEVEL_HIGH>; 347 status = "disabled"; 348 }; 349 350 timer1: timer@ffefc32014 { 351 compatible = "snps,dw-apb-timer"; 352 reg = <0xff 0xefc32014 0x0 0x14>; 353 clocks = <&apb_clk>; 354 clock-names = "timer"; 355 interrupts = <17 IRQ_TYPE_LEVEL_HIGH>; 356 status = "disabled"; 357 }; 358 359 timer2: timer@ffefc32028 { 360 compatible = "snps,dw-apb-timer"; 361 reg = <0xff 0xefc32028 0x0 0x14>; 362 clocks = <&apb_clk>; 363 clock-names = "timer"; 364 interrupts = <18 IRQ_TYPE_LEVEL_HIGH>; 365 status = "disabled"; 366 }; 367 368 timer3: timer@ffefc3203c { 369 compatible = "snps,dw-apb-timer"; 370 reg = <0xff 0xefc3203c 0x0 0x14>; 371 clocks = <&apb_clk>; 372 clock-names = "timer"; 373 interrupts = <19 IRQ_TYPE_LEVEL_HIGH>; 374 status = "disabled"; 375 }; 376 377 uart4: serial@fff7f08000 { 378 compatible = "snps,dw-apb-uart"; 379 reg = <0xff 0xf7f08000 0x0 0x4000>; 380 interrupts = <40 IRQ_TYPE_LEVEL_HIGH>; 381 clocks = <&uart_sclk>; 382 reg-shift = <2>; 383 reg-io-width = <4>; 384 status = "disabled"; 385 }; 386 387 uart5: serial@fff7f0c000 { 388 compatible = "snps,dw-apb-uart"; 389 reg = <0xff 0xf7f0c000 0x0 0x4000>; 390 interrupts = <41 IRQ_TYPE_LEVEL_HIGH>; 391 clocks = <&uart_sclk>; 392 reg-shift = <2>; 393 reg-io-width = <4>; 394 status = "disabled"; 395 }; 396 397 timer4: timer@ffffc33000 { 398 compatible = "snps,dw-apb-timer"; 399 reg = <0xff 0xffc33000 0x0 0x14>; 400 clocks = <&apb_clk>; 401 clock-names = "timer"; 402 interrupts = <20 IRQ_TYPE_LEVEL_HIGH>; 403 status = "disabled"; 404 }; 405 406 timer5: timer@ffffc33014 { 407 compatible = "snps,dw-apb-timer"; 408 reg = <0xff 0xffc33014 0x0 0x14>; 409 clocks = <&apb_clk>; 410 clock-names = "timer"; 411 interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; 412 status = "disabled"; 413 }; 414 415 timer6: timer@ffffc33028 { 416 compatible = "snps,dw-apb-timer"; 417 reg = <0xff 0xffc33028 0x0 0x14>; 418 clocks = <&apb_clk>; 419 clock-names = "timer"; 420 interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; 421 status = "disabled"; 422 }; 423 424 timer7: timer@ffffc3303c { 425 compatible = "snps,dw-apb-timer"; 426 reg = <0xff 0xffc3303c 0x0 0x14>; 427 clocks = <&apb_clk>; 428 clock-names = "timer"; 429 interrupts = <23 IRQ_TYPE_LEVEL_HIGH>; 430 status = "disabled"; 431 }; 432 433 ao_gpio0: gpio@fffff41000 { 434 compatible = "snps,dw-apb-gpio"; 435 reg = <0xff 0xfff41000 0x0 0x1000>; 436 #address-cells = <1>; 437 #size-cells = <0>; 438 439 porte: gpio-controller@0 { 440 compatible = "snps,dw-apb-gpio-port"; 441 gpio-controller; 442 #gpio-cells = <2>; 443 ngpios = <32>; 444 reg = <0>; 445 interrupt-controller; 446 #interrupt-cells = <2>; 447 interrupts = <76 IRQ_TYPE_LEVEL_HIGH>; 448 }; 449 }; 450 451 ao_gpio1: gpio@fffff52000 { 452 compatible = "snps,dw-apb-gpio"; 453 reg = <0xff 0xfff52000 0x0 0x1000>; 454 #address-cells = <1>; 455 #size-cells = <0>; 456 457 portf: gpio-controller@0 { 458 compatible = "snps,dw-apb-gpio-port"; 459 gpio-controller; 460 #gpio-cells = <2>; 461 ngpios = <32>; 462 reg = <0>; 463 interrupt-controller; 464 #interrupt-cells = <2>; 465 interrupts = <55 IRQ_TYPE_LEVEL_HIGH>; 466 }; 467 }; 468 }; 469}; 470