Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'riscv-dt-for-v6.5-pt2' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into soc/dt

RISC-V Devicetrees for v6.5 Part 2

T-Head:
Add a basic dtsi, Kconfig bits & trivial binding additions for the T-Head
1520 SoC (codename "light"). This SoC can be found on the Lichee Pi 4a,
for which a minimal dts is added.

Misc:
Re-sort the dts Makefile to be in alphanumerical order by directory.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>

* tag 'riscv-dt-for-v6.5-pt2' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux:
riscv: dts: sort makefile entries by directory
riscv: defconfig: enable T-HEAD SoC
MAINTAINERS: add entry for T-HEAD RISC-V SoC
riscv: dts: thead: add sipeed Lichee Pi 4A board device tree
riscv: dts: add initial T-HEAD TH1520 SoC device tree
riscv: Add the T-HEAD SoC family Kconfig option
dt-bindings: riscv: Add T-HEAD TH1520 board compatibles
dt-bindings: timer: Add T-HEAD TH1520 clint
dt-bindings: interrupt-controller: Add T-HEAD's TH1520 PLIC

Link: https://lore.kernel.org/r/20230620-fidelity-variety-60b47c889e31@spud
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+543 -2
+1
Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml
··· 65 65 - items: 66 66 - enum: 67 67 - allwinner,sun20i-d1-plic 68 + - thead,th1520-plic 68 69 - const: thead,c900-plic 69 70 - items: 70 71 - const: sifive,plic-1.0.0
+29
Documentation/devicetree/bindings/riscv/thead.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/riscv/thead.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: T-HEAD SoC-based boards 8 + 9 + maintainers: 10 + - Jisheng Zhang <jszhang@kernel.org> 11 + 12 + description: 13 + T-HEAD SoC-based boards 14 + 15 + properties: 16 + $nodename: 17 + const: '/' 18 + compatible: 19 + oneOf: 20 + - description: Sipeed Lichee Pi 4A board for the Sipeed Lichee Module 4A 21 + items: 22 + - enum: 23 + - sipeed,lichee-pi-4a 24 + - const: sipeed,lichee-module-4a 25 + - const: thead,th1520 26 + 27 + additionalProperties: true 28 + 29 + ...
+1
Documentation/devicetree/bindings/timer/sifive,clint.yaml
··· 37 37 - items: 38 38 - enum: 39 39 - allwinner,sun20i-d1-clint 40 + - thead,th1520-clint 40 41 - const: thead,c900-clint 41 42 - items: 42 43 - const: sifive,clint0
+8
MAINTAINERS
··· 18163 18163 F: drivers/perf/riscv_pmu_legacy.c 18164 18164 F: drivers/perf/riscv_pmu_sbi.c 18165 18165 18166 + RISC-V THEAD SoC SUPPORT 18167 + M: Jisheng Zhang <jszhang@kernel.org> 18168 + M: Guo Ren <guoren@kernel.org> 18169 + M: Fu Wei <wefu@redhat.com> 18170 + L: linux-riscv@lists.infradead.org 18171 + S: Maintained 18172 + F: arch/riscv/boot/dts/thead/ 18173 + 18166 18174 RNBD BLOCK DRIVERS 18167 18175 M: Md. Haris Iqbal <haris.iqbal@ionos.com> 18168 18176 M: Jack Wang <jinpu.wang@ionos.com>
+6
arch/riscv/Kconfig.socs
··· 41 41 This enables support for Allwinner sun20i platform hardware, 42 42 including boards based on the D1 and D1s SoCs. 43 43 44 + config ARCH_THEAD 45 + bool "T-HEAD RISC-V SoCs" 46 + select ERRATA_THEAD 47 + help 48 + This enables support for the RISC-V based T-HEAD SoCs. 49 + 44 50 config ARCH_VIRT 45 51 def_bool SOC_VIRT 46 52
+3 -2
arch/riscv/boot/dts/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 subdir-y += allwinner 3 - subdir-y += sifive 4 - subdir-y += starfive 5 3 subdir-y += canaan 6 4 subdir-y += microchip 7 5 subdir-y += renesas 6 + subdir-y += sifive 7 + subdir-y += starfive 8 + subdir-y += thead 8 9 9 10 obj-$(CONFIG_BUILTIN_DTB) := $(addsuffix /, $(subdir-y))
+2
arch/riscv/boot/dts/thead/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + dtb-$(CONFIG_ARCH_THEAD) += th1520-lichee-pi-4a.dtb
+38
arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include "th1520.dtsi" 9 + 10 + / { 11 + model = "Sipeed Lichee Module 4A"; 12 + compatible = "sipeed,lichee-module-4a", "thead,th1520"; 13 + 14 + memory@0 { 15 + device_type = "memory"; 16 + reg = <0x0 0x00000000 0x2 0x00000000>; 17 + }; 18 + }; 19 + 20 + &osc { 21 + clock-frequency = <24000000>; 22 + }; 23 + 24 + &osc_32k { 25 + clock-frequency = <32768>; 26 + }; 27 + 28 + &apb_clk { 29 + clock-frequency = <62500000>; 30 + }; 31 + 32 + &uart_sclk { 33 + clock-frequency = <100000000>; 34 + }; 35 + 36 + &dmac0 { 37 + status = "okay"; 38 + };
+32
arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org> 4 + */ 5 + 6 + #include "th1520-lichee-module-4a.dtsi" 7 + 8 + / { 9 + model = "Sipeed Lichee Pi 4A"; 10 + compatible = "sipeed,lichee-pi-4a", "sipeed,lichee-module-4a", "thead,th1520"; 11 + 12 + aliases { 13 + gpio0 = &gpio0; 14 + gpio1 = &gpio1; 15 + gpio2 = &gpio2; 16 + gpio3 = &gpio3; 17 + serial0 = &uart0; 18 + serial1 = &uart1; 19 + serial2 = &uart2; 20 + serial3 = &uart3; 21 + serial4 = &uart4; 22 + serial5 = &uart5; 23 + }; 24 + 25 + chosen { 26 + stdout-path = "serial0:115200n8"; 27 + }; 28 + }; 29 + 30 + &uart0 { 31 + status = "okay"; 32 + };
+422
arch/riscv/boot/dts/thead/th1520.dtsi
··· 1 + // SPDX-License-Identifier: GPL-2.0 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 + reg = <0>; 24 + i-cache-block-size = <64>; 25 + i-cache-size = <65536>; 26 + i-cache-sets = <512>; 27 + d-cache-block-size = <64>; 28 + d-cache-size = <65536>; 29 + d-cache-sets = <512>; 30 + next-level-cache = <&l2_cache>; 31 + mmu-type = "riscv,sv39"; 32 + 33 + cpu0_intc: interrupt-controller { 34 + compatible = "riscv,cpu-intc"; 35 + interrupt-controller; 36 + #interrupt-cells = <1>; 37 + }; 38 + }; 39 + 40 + c910_1: cpu@1 { 41 + compatible = "thead,c910", "riscv"; 42 + device_type = "cpu"; 43 + riscv,isa = "rv64imafdc"; 44 + reg = <1>; 45 + i-cache-block-size = <64>; 46 + i-cache-size = <65536>; 47 + i-cache-sets = <512>; 48 + d-cache-block-size = <64>; 49 + d-cache-size = <65536>; 50 + d-cache-sets = <512>; 51 + next-level-cache = <&l2_cache>; 52 + mmu-type = "riscv,sv39"; 53 + 54 + cpu1_intc: interrupt-controller { 55 + compatible = "riscv,cpu-intc"; 56 + interrupt-controller; 57 + #interrupt-cells = <1>; 58 + }; 59 + }; 60 + 61 + c910_2: cpu@2 { 62 + compatible = "thead,c910", "riscv"; 63 + device_type = "cpu"; 64 + riscv,isa = "rv64imafdc"; 65 + reg = <2>; 66 + i-cache-block-size = <64>; 67 + i-cache-size = <65536>; 68 + i-cache-sets = <512>; 69 + d-cache-block-size = <64>; 70 + d-cache-size = <65536>; 71 + d-cache-sets = <512>; 72 + next-level-cache = <&l2_cache>; 73 + mmu-type = "riscv,sv39"; 74 + 75 + cpu2_intc: interrupt-controller { 76 + compatible = "riscv,cpu-intc"; 77 + interrupt-controller; 78 + #interrupt-cells = <1>; 79 + }; 80 + }; 81 + 82 + c910_3: cpu@3 { 83 + compatible = "thead,c910", "riscv"; 84 + device_type = "cpu"; 85 + riscv,isa = "rv64imafdc"; 86 + reg = <3>; 87 + i-cache-block-size = <64>; 88 + i-cache-size = <65536>; 89 + i-cache-sets = <512>; 90 + d-cache-block-size = <64>; 91 + d-cache-size = <65536>; 92 + d-cache-sets = <512>; 93 + next-level-cache = <&l2_cache>; 94 + mmu-type = "riscv,sv39"; 95 + 96 + cpu3_intc: interrupt-controller { 97 + compatible = "riscv,cpu-intc"; 98 + interrupt-controller; 99 + #interrupt-cells = <1>; 100 + }; 101 + }; 102 + 103 + l2_cache: l2-cache { 104 + compatible = "cache"; 105 + cache-block-size = <64>; 106 + cache-level = <2>; 107 + cache-size = <1048576>; 108 + cache-sets = <1024>; 109 + cache-unified; 110 + }; 111 + }; 112 + 113 + osc: oscillator { 114 + compatible = "fixed-clock"; 115 + clock-output-names = "osc_24m"; 116 + #clock-cells = <0>; 117 + }; 118 + 119 + osc_32k: 32k-oscillator { 120 + compatible = "fixed-clock"; 121 + clock-output-names = "osc_32k"; 122 + #clock-cells = <0>; 123 + }; 124 + 125 + apb_clk: apb-clk-clock { 126 + compatible = "fixed-clock"; 127 + clock-output-names = "apb_clk"; 128 + #clock-cells = <0>; 129 + }; 130 + 131 + uart_sclk: uart-sclk-clock { 132 + compatible = "fixed-clock"; 133 + clock-output-names = "uart_sclk"; 134 + #clock-cells = <0>; 135 + }; 136 + 137 + soc { 138 + compatible = "simple-bus"; 139 + interrupt-parent = <&plic>; 140 + #address-cells = <2>; 141 + #size-cells = <2>; 142 + ranges; 143 + 144 + plic: interrupt-controller@ffd8000000 { 145 + compatible = "thead,th1520-plic", "thead,c900-plic"; 146 + reg = <0xff 0xd8000000 0x0 0x01000000>; 147 + interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>, 148 + <&cpu1_intc 11>, <&cpu1_intc 9>, 149 + <&cpu2_intc 11>, <&cpu2_intc 9>, 150 + <&cpu3_intc 11>, <&cpu3_intc 9>; 151 + interrupt-controller; 152 + #address-cells = <0>; 153 + #interrupt-cells = <2>; 154 + riscv,ndev = <240>; 155 + }; 156 + 157 + clint: timer@ffdc000000 { 158 + compatible = "thead,th1520-clint", "thead,c900-clint"; 159 + reg = <0xff 0xdc000000 0x0 0x00010000>; 160 + interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>, 161 + <&cpu1_intc 3>, <&cpu1_intc 7>, 162 + <&cpu2_intc 3>, <&cpu2_intc 7>, 163 + <&cpu3_intc 3>, <&cpu3_intc 7>; 164 + }; 165 + 166 + uart0: serial@ffe7014000 { 167 + compatible = "snps,dw-apb-uart"; 168 + reg = <0xff 0xe7014000 0x0 0x100>; 169 + interrupts = <36 IRQ_TYPE_LEVEL_HIGH>; 170 + clocks = <&uart_sclk>; 171 + reg-shift = <2>; 172 + reg-io-width = <4>; 173 + status = "disabled"; 174 + }; 175 + 176 + uart1: serial@ffe7f00000 { 177 + compatible = "snps,dw-apb-uart"; 178 + reg = <0xff 0xe7f00000 0x0 0x100>; 179 + interrupts = <37 IRQ_TYPE_LEVEL_HIGH>; 180 + clocks = <&uart_sclk>; 181 + reg-shift = <2>; 182 + reg-io-width = <4>; 183 + status = "disabled"; 184 + }; 185 + 186 + uart3: serial@ffe7f04000 { 187 + compatible = "snps,dw-apb-uart"; 188 + reg = <0xff 0xe7f04000 0x0 0x100>; 189 + interrupts = <39 IRQ_TYPE_LEVEL_HIGH>; 190 + clocks = <&uart_sclk>; 191 + reg-shift = <2>; 192 + reg-io-width = <4>; 193 + status = "disabled"; 194 + }; 195 + 196 + gpio2: gpio@ffe7f34000 { 197 + compatible = "snps,dw-apb-gpio"; 198 + reg = <0xff 0xe7f34000 0x0 0x1000>; 199 + #address-cells = <1>; 200 + #size-cells = <0>; 201 + 202 + portc: gpio-controller@0 { 203 + compatible = "snps,dw-apb-gpio-port"; 204 + gpio-controller; 205 + #gpio-cells = <2>; 206 + ngpios = <32>; 207 + reg = <0>; 208 + interrupt-controller; 209 + #interrupt-cells = <2>; 210 + interrupts = <58 IRQ_TYPE_LEVEL_HIGH>; 211 + }; 212 + }; 213 + 214 + gpio3: gpio@ffe7f38000 { 215 + compatible = "snps,dw-apb-gpio"; 216 + reg = <0xff 0xe7f38000 0x0 0x1000>; 217 + #address-cells = <1>; 218 + #size-cells = <0>; 219 + 220 + portd: gpio-controller@0 { 221 + compatible = "snps,dw-apb-gpio-port"; 222 + gpio-controller; 223 + #gpio-cells = <2>; 224 + ngpios = <32>; 225 + reg = <0>; 226 + interrupt-controller; 227 + #interrupt-cells = <2>; 228 + interrupts = <59 IRQ_TYPE_LEVEL_HIGH>; 229 + }; 230 + }; 231 + 232 + gpio0: gpio@ffec005000 { 233 + compatible = "snps,dw-apb-gpio"; 234 + reg = <0xff 0xec005000 0x0 0x1000>; 235 + #address-cells = <1>; 236 + #size-cells = <0>; 237 + 238 + porta: gpio-controller@0 { 239 + compatible = "snps,dw-apb-gpio-port"; 240 + gpio-controller; 241 + #gpio-cells = <2>; 242 + ngpios = <32>; 243 + reg = <0>; 244 + interrupt-controller; 245 + #interrupt-cells = <2>; 246 + interrupts = <56 IRQ_TYPE_LEVEL_HIGH>; 247 + }; 248 + }; 249 + 250 + gpio1: gpio@ffec006000 { 251 + compatible = "snps,dw-apb-gpio"; 252 + reg = <0xff 0xec006000 0x0 0x1000>; 253 + #address-cells = <1>; 254 + #size-cells = <0>; 255 + 256 + portb: gpio-controller@0 { 257 + compatible = "snps,dw-apb-gpio-port"; 258 + gpio-controller; 259 + #gpio-cells = <2>; 260 + ngpios = <32>; 261 + reg = <0>; 262 + interrupt-controller; 263 + #interrupt-cells = <2>; 264 + interrupts = <57 IRQ_TYPE_LEVEL_HIGH>; 265 + }; 266 + }; 267 + 268 + uart2: serial@ffec010000 { 269 + compatible = "snps,dw-apb-uart"; 270 + reg = <0xff 0xec010000 0x0 0x4000>; 271 + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; 272 + clocks = <&uart_sclk>; 273 + reg-shift = <2>; 274 + reg-io-width = <4>; 275 + status = "disabled"; 276 + }; 277 + 278 + dmac0: dma-controller@ffefc00000 { 279 + compatible = "snps,axi-dma-1.01a"; 280 + reg = <0xff 0xefc00000 0x0 0x1000>; 281 + interrupts = <27 IRQ_TYPE_LEVEL_HIGH>; 282 + clocks = <&apb_clk>, <&apb_clk>; 283 + clock-names = "core-clk", "cfgr-clk"; 284 + #dma-cells = <1>; 285 + dma-channels = <4>; 286 + snps,block-size = <65536 65536 65536 65536>; 287 + snps,priority = <0 1 2 3>; 288 + snps,dma-masters = <1>; 289 + snps,data-width = <4>; 290 + snps,axi-max-burst-len = <16>; 291 + status = "disabled"; 292 + }; 293 + 294 + timer0: timer@ffefc32000 { 295 + compatible = "snps,dw-apb-timer"; 296 + reg = <0xff 0xefc32000 0x0 0x14>; 297 + clocks = <&apb_clk>; 298 + clock-names = "timer"; 299 + interrupts = <16 IRQ_TYPE_LEVEL_HIGH>; 300 + status = "disabled"; 301 + }; 302 + 303 + timer1: timer@ffefc32014 { 304 + compatible = "snps,dw-apb-timer"; 305 + reg = <0xff 0xefc32014 0x0 0x14>; 306 + clocks = <&apb_clk>; 307 + clock-names = "timer"; 308 + interrupts = <17 IRQ_TYPE_LEVEL_HIGH>; 309 + status = "disabled"; 310 + }; 311 + 312 + timer2: timer@ffefc32028 { 313 + compatible = "snps,dw-apb-timer"; 314 + reg = <0xff 0xefc32028 0x0 0x14>; 315 + clocks = <&apb_clk>; 316 + clock-names = "timer"; 317 + interrupts = <18 IRQ_TYPE_LEVEL_HIGH>; 318 + status = "disabled"; 319 + }; 320 + 321 + timer3: timer@ffefc3203c { 322 + compatible = "snps,dw-apb-timer"; 323 + reg = <0xff 0xefc3203c 0x0 0x14>; 324 + clocks = <&apb_clk>; 325 + clock-names = "timer"; 326 + interrupts = <19 IRQ_TYPE_LEVEL_HIGH>; 327 + status = "disabled"; 328 + }; 329 + 330 + uart4: serial@fff7f08000 { 331 + compatible = "snps,dw-apb-uart"; 332 + reg = <0xff 0xf7f08000 0x0 0x4000>; 333 + interrupts = <40 IRQ_TYPE_LEVEL_HIGH>; 334 + clocks = <&uart_sclk>; 335 + reg-shift = <2>; 336 + reg-io-width = <4>; 337 + status = "disabled"; 338 + }; 339 + 340 + uart5: serial@fff7f0c000 { 341 + compatible = "snps,dw-apb-uart"; 342 + reg = <0xff 0xf7f0c000 0x0 0x4000>; 343 + interrupts = <41 IRQ_TYPE_LEVEL_HIGH>; 344 + clocks = <&uart_sclk>; 345 + reg-shift = <2>; 346 + reg-io-width = <4>; 347 + status = "disabled"; 348 + }; 349 + 350 + timer4: timer@ffffc33000 { 351 + compatible = "snps,dw-apb-timer"; 352 + reg = <0xff 0xffc33000 0x0 0x14>; 353 + clocks = <&apb_clk>; 354 + clock-names = "timer"; 355 + interrupts = <20 IRQ_TYPE_LEVEL_HIGH>; 356 + status = "disabled"; 357 + }; 358 + 359 + timer5: timer@ffffc33014 { 360 + compatible = "snps,dw-apb-timer"; 361 + reg = <0xff 0xffc33014 0x0 0x14>; 362 + clocks = <&apb_clk>; 363 + clock-names = "timer"; 364 + interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; 365 + status = "disabled"; 366 + }; 367 + 368 + timer6: timer@ffffc33028 { 369 + compatible = "snps,dw-apb-timer"; 370 + reg = <0xff 0xffc33028 0x0 0x14>; 371 + clocks = <&apb_clk>; 372 + clock-names = "timer"; 373 + interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; 374 + status = "disabled"; 375 + }; 376 + 377 + timer7: timer@ffffc3303c { 378 + compatible = "snps,dw-apb-timer"; 379 + reg = <0xff 0xffc3303c 0x0 0x14>; 380 + clocks = <&apb_clk>; 381 + clock-names = "timer"; 382 + interrupts = <23 IRQ_TYPE_LEVEL_HIGH>; 383 + status = "disabled"; 384 + }; 385 + 386 + ao_gpio0: gpio@fffff41000 { 387 + compatible = "snps,dw-apb-gpio"; 388 + reg = <0xff 0xfff41000 0x0 0x1000>; 389 + #address-cells = <1>; 390 + #size-cells = <0>; 391 + 392 + porte: gpio-controller@0 { 393 + compatible = "snps,dw-apb-gpio-port"; 394 + gpio-controller; 395 + #gpio-cells = <2>; 396 + ngpios = <32>; 397 + reg = <0>; 398 + interrupt-controller; 399 + #interrupt-cells = <2>; 400 + interrupts = <76 IRQ_TYPE_LEVEL_HIGH>; 401 + }; 402 + }; 403 + 404 + ao_gpio1: gpio@fffff52000 { 405 + compatible = "snps,dw-apb-gpio"; 406 + reg = <0xff 0xfff52000 0x0 0x1000>; 407 + #address-cells = <1>; 408 + #size-cells = <0>; 409 + 410 + portf: gpio-controller@0 { 411 + compatible = "snps,dw-apb-gpio-port"; 412 + gpio-controller; 413 + #gpio-cells = <2>; 414 + ngpios = <32>; 415 + reg = <0>; 416 + interrupt-controller; 417 + #interrupt-cells = <2>; 418 + interrupts = <55 IRQ_TYPE_LEVEL_HIGH>; 419 + }; 420 + }; 421 + }; 422 + };
+1
arch/riscv/configs/defconfig
··· 27 27 CONFIG_PROFILING=y 28 28 CONFIG_SOC_MICROCHIP_POLARFIRE=y 29 29 CONFIG_ARCH_RENESAS=y 30 + CONFIG_ARCH_THEAD=y 30 31 CONFIG_SOC_SIFIVE=y 31 32 CONFIG_SOC_STARFIVE=y 32 33 CONFIG_ARCH_SUNXI=y