Skip to content

Commit 63e9bb0

Browse files
committed
Merge branch 'newsoc/andes' into soc/newsoc
Patches from Ben Zong-You Xie <[email protected]>: The Voyager is a 9.6” x 9.6” Micro ATX form factor development board including Andes QiLai SoC. This patch series adds minimal device tree files for the QiLai SoC and the Voyager board [1]. Now only support basic uart drivers to boot up into a basic console. Other features will be added later. [1] https://www.andestech.com/en/products-solutions/andeshape-platforms/qilai-chip/ [2] https://lore.kernel.org/all/[email protected]/ * newsoc/andes: MAINTAINERS: Add entry for Andes SoC riscv: defconfig: enable Andes SoC riscv: dts: andes: add Voyager board device tree riscv: dts: andes: add QiLai SoC device tree dt-bindings: timer: add Andes machine timer dt-bindings: interrupt-controller: add Andes machine-level software interrupt controller dt-bindings: interrupt-controller: add Andes QiLai PLIC dt-bindings: riscv: add Andes QiLai SoC and the Voyager board bindings riscv: add Andes SoC family Kconfig support
2 parents 9cf8d2b + bf40c1a commit 63e9bb0

File tree

11 files changed

+367
-0
lines changed

11 files changed

+367
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/interrupt-controller/andestech,plicsw.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Andes machine-level software interrupt controller
8+
9+
description:
10+
In the Andes platform such as QiLai SoC, the PLIC module is instantiated a
11+
second time with all interrupt sources tied to zero as the software interrupt
12+
controller (PLIC_SW). PLIC_SW directly connects to the machine-mode
13+
inter-processor interrupt lines of CPUs, so RISC-V per-CPU local interrupt
14+
controller is the parent interrupt controller for PLIC_SW. PLIC_SW can
15+
generate machine-mode inter-processor interrupts through programming its
16+
registers.
17+
18+
maintainers:
19+
- Ben Zong-You Xie <[email protected]>
20+
21+
properties:
22+
compatible:
23+
items:
24+
- enum:
25+
- andestech,qilai-plicsw
26+
- const: andestech,plicsw
27+
28+
reg:
29+
maxItems: 1
30+
31+
interrupts-extended:
32+
minItems: 1
33+
maxItems: 15872
34+
description:
35+
Specifies which harts are connected to the PLIC_SW. Each item must points
36+
to a riscv,cpu-intc node, which has a riscv cpu node as parent.
37+
38+
additionalProperties: false
39+
40+
required:
41+
- compatible
42+
- reg
43+
- interrupts-extended
44+
45+
examples:
46+
- |
47+
interrupt-controller@400000 {
48+
compatible = "andestech,qilai-plicsw", "andestech,plicsw";
49+
reg = <0x400000 0x400000>;
50+
interrupts-extended = <&cpu0intc 3>,
51+
<&cpu1intc 3>,
52+
<&cpu2intc 3>,
53+
<&cpu3intc 3>;
54+
};

Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ properties:
5353
oneOf:
5454
- items:
5555
- enum:
56+
- andestech,qilai-plic
5657
- renesas,r9a07g043-plic
5758
- const: andestech,nceplic100
5859
- items:
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/riscv/andes.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Andes SoC-based boards
8+
9+
maintainers:
10+
- Ben Zong-You Xie <[email protected]>
11+
12+
description:
13+
Andes SoC-based boards
14+
15+
properties:
16+
$nodename:
17+
const: '/'
18+
compatible:
19+
oneOf:
20+
- items:
21+
- enum:
22+
- andestech,voyager
23+
- const: andestech,qilai
24+
25+
additionalProperties: true
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/timer/andestech,plmt0.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Andes machine-level timer
8+
9+
description:
10+
The Andes machine-level timer device (PLMT0) provides machine-level timer
11+
functionality for a set of HARTs on a RISC-V platform. It has a single
12+
fixed-frequency monotonic time counter (MTIME) register and a time compare
13+
register (MTIMECMP) for each HART connected to the PLMT0. A timer interrupt is
14+
generated if MTIME >= MTIMECMP.
15+
16+
maintainers:
17+
- Ben Zong-You Xie <[email protected]>
18+
19+
properties:
20+
compatible:
21+
items:
22+
- enum:
23+
- andestech,qilai-plmt
24+
- const: andestech,plmt0
25+
26+
reg:
27+
maxItems: 1
28+
29+
interrupts-extended:
30+
minItems: 1
31+
maxItems: 32
32+
description:
33+
Specifies which harts are connected to the PLMT0. Each item must points
34+
to a riscv,cpu-intc node, which has a riscv cpu node as parent. The
35+
PLMT0 supports 1 hart up to 32 harts.
36+
37+
additionalProperties: false
38+
39+
required:
40+
- compatible
41+
- reg
42+
- interrupts-extended
43+
44+
examples:
45+
- |
46+
interrupt-controller@100000 {
47+
compatible = "andestech,qilai-plmt", "andestech,plmt0";
48+
reg = <0x100000 0x100000>;
49+
interrupts-extended = <&cpu0intc 7>,
50+
<&cpu1intc 7>,
51+
<&cpu2intc 7>,
52+
<&cpu3intc 7>;
53+
};

MAINTAINERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21293,6 +21293,15 @@ F: drivers/irqchip/irq-riscv-intc.c
2129321293
F: include/linux/irqchip/riscv-aplic.h
2129421294
F: include/linux/irqchip/riscv-imsic.h
2129521295

21296+
RISC-V ANDES SoC Support
21297+
M: Ben Zong-You Xie <[email protected]>
21298+
S: Maintained
21299+
T: git: https://github.com/ben717-linux/linux
21300+
F: Documentation/devicetree/bindings/interrupt-controller/andestech,plicsw.yaml
21301+
F: Documentation/devicetree/bindings/riscv/andes.yaml
21302+
F: Documentation/devicetree/bindings/timer/andestech,plmt0.yaml
21303+
F: arch/riscv/boot/dts/andes/
21304+
2129621305
RISC-V ARCHITECTURE
2129721306
M: Paul Walmsley <[email protected]>
2129821307
M: Palmer Dabbelt <[email protected]>

arch/riscv/Kconfig.socs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
menu "SoC selection"
22

3+
config ARCH_ANDES
4+
bool "Andes SoCs"
5+
depends on MMU && !XIP_KERNEL
6+
select ERRATA_ANDES
7+
help
8+
This enables support for Andes SoC platform hardware.
9+
310
config ARCH_MICROCHIP_POLARFIRE
411
def_bool ARCH_MICROCHIP
512

arch/riscv/boot/dts/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22
subdir-y += allwinner
3+
subdir-y += andes
34
subdir-y += canaan
45
subdir-y += microchip
56
subdir-y += renesas

arch/riscv/boot/dts/andes/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
dtb-$(CONFIG_ARCH_ANDES) += qilai-voyager.dtb
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// SPDX-License-Identifier: GPL-2.0 OR MIT
2+
/*
3+
* Copyright (C) 2025 Andes Technology Corporation. All rights reserved.
4+
*/
5+
6+
#include "qilai.dtsi"
7+
8+
/ {
9+
model = "Voyager";
10+
compatible = "andestech,voyager", "andestech,qilai";
11+
12+
aliases {
13+
serial0 = &uart0;
14+
};
15+
16+
chosen {
17+
stdout-path = "serial0:115200n8";
18+
};
19+
20+
memory@400000000 {
21+
device_type = "memory";
22+
reg = <0x4 0x00000000 0x4 0x00000000>;
23+
};
24+
};
25+
26+
&uart0 {
27+
status = "okay";
28+
};

arch/riscv/boot/dts/andes/qilai.dtsi

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2+
/*
3+
* Copyright (C) 2025 Andes Technology Corporation. All rights reserved.
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <dt-bindings/interrupt-controller/irq.h>
9+
10+
/ {
11+
#address-cells = <2>;
12+
#size-cells = <2>;
13+
14+
cpus {
15+
#address-cells = <1>;
16+
#size-cells = <0>;
17+
timebase-frequency = <62500000>;
18+
19+
cpu0: cpu@0 {
20+
compatible = "andestech,ax45mp", "riscv";
21+
device_type = "cpu";
22+
reg = <0>;
23+
riscv,isa-base = "rv64i";
24+
riscv,isa-extensions = "i", "m", "a", "f", "d", "c",
25+
"zicntr", "zicsr", "zifencei",
26+
"zihpm", "xandespmu";
27+
mmu-type = "riscv,sv39";
28+
clock-frequency = <100000000>;
29+
i-cache-size = <0x8000>;
30+
i-cache-sets = <256>;
31+
i-cache-line-size = <64>;
32+
d-cache-size = <0x8000>;
33+
d-cache-sets = <128>;
34+
d-cache-line-size = <64>;
35+
next-level-cache = <&l2_cache>;
36+
37+
cpu0_intc: interrupt-controller {
38+
compatible = "andestech,cpu-intc", "riscv,cpu-intc";
39+
#interrupt-cells = <1>;
40+
interrupt-controller;
41+
};
42+
};
43+
44+
cpu1: cpu@1 {
45+
compatible = "andestech,ax45mp", "riscv";
46+
device_type = "cpu";
47+
reg = <1>;
48+
riscv,isa-base = "rv64i";
49+
riscv,isa-extensions = "i", "m", "a", "f", "d", "c",
50+
"zicntr", "zicsr", "zifencei",
51+
"zihpm", "xandespmu";
52+
mmu-type = "riscv,sv39";
53+
clock-frequency = <100000000>;
54+
i-cache-size = <0x8000>;
55+
i-cache-sets = <256>;
56+
i-cache-line-size = <64>;
57+
d-cache-size = <0x8000>;
58+
d-cache-sets = <128>;
59+
d-cache-line-size = <64>;
60+
next-level-cache = <&l2_cache>;
61+
62+
cpu1_intc: interrupt-controller {
63+
compatible = "andestech,cpu-intc",
64+
"riscv,cpu-intc";
65+
#interrupt-cells = <1>;
66+
interrupt-controller;
67+
};
68+
};
69+
70+
cpu2: cpu@2 {
71+
compatible = "andestech,ax45mp", "riscv";
72+
device_type = "cpu";
73+
reg = <2>;
74+
riscv,isa-base = "rv64i";
75+
riscv,isa-extensions = "i", "m", "a", "f", "d", "c",
76+
"zicntr", "zicsr", "zifencei",
77+
"zihpm", "xandespmu";
78+
mmu-type = "riscv,sv39";
79+
clock-frequency = <100000000>;
80+
i-cache-size = <0x8000>;
81+
i-cache-sets = <256>;
82+
i-cache-line-size = <64>;
83+
d-cache-size = <0x8000>;
84+
d-cache-sets = <128>;
85+
d-cache-line-size = <64>;
86+
next-level-cache = <&l2_cache>;
87+
88+
cpu2_intc: interrupt-controller {
89+
compatible = "andestech,cpu-intc",
90+
"riscv,cpu-intc";
91+
#interrupt-cells = <1>;
92+
interrupt-controller;
93+
};
94+
};
95+
96+
cpu3: cpu@3 {
97+
compatible = "andestech,ax45mp", "riscv";
98+
device_type = "cpu";
99+
reg = <3>;
100+
riscv,isa-base = "rv64i";
101+
riscv,isa-extensions = "i", "m", "a", "f", "d", "c",
102+
"zicntr", "zicsr", "zifencei",
103+
"zihpm", "xandespmu";
104+
mmu-type = "riscv,sv39";
105+
clock-frequency = <100000000>;
106+
i-cache-size = <0x8000>;
107+
i-cache-sets = <256>;
108+
i-cache-line-size = <64>;
109+
d-cache-size = <0x8000>;
110+
d-cache-sets = <128>;
111+
d-cache-line-size = <64>;
112+
next-level-cache = <&l2_cache>;
113+
114+
cpu3_intc: interrupt-controller {
115+
compatible = "andestech,cpu-intc",
116+
"riscv,cpu-intc";
117+
#interrupt-cells = <1>;
118+
interrupt-controller;
119+
};
120+
};
121+
};
122+
123+
soc {
124+
compatible = "simple-bus";
125+
ranges;
126+
interrupt-parent = <&plic>;
127+
#address-cells = <2>;
128+
#size-cells = <2>;
129+
130+
plmt: timer@100000 {
131+
compatible = "andestech,qilai-plmt", "andestech,plmt0";
132+
reg = <0x0 0x00100000 0x0 0x100000>;
133+
interrupts-extended = <&cpu0_intc 7>,
134+
<&cpu1_intc 7>,
135+
<&cpu2_intc 7>,
136+
<&cpu3_intc 7>;
137+
};
138+
139+
l2_cache: cache-controller@200000 {
140+
compatible = "andestech,qilai-ax45mp-cache",
141+
"andestech,ax45mp-cache", "cache";
142+
reg = <0x0 0x00200000 0x0 0x100000>;
143+
interrupts = <16 IRQ_TYPE_LEVEL_HIGH>;
144+
cache-line-size = <64>;
145+
cache-level = <2>;
146+
cache-sets = <2048>;
147+
cache-size = <0x200000>;
148+
cache-unified;
149+
};
150+
151+
plic_sw: interrupt-controller@400000 {
152+
compatible = "andestech,qilai-plicsw",
153+
"andestech,plicsw";
154+
reg = <0x0 0x00400000 0x0 0x400000>;
155+
interrupts-extended = <&cpu0_intc 3>,
156+
<&cpu1_intc 3>,
157+
<&cpu2_intc 3>,
158+
<&cpu3_intc 3>;
159+
};
160+
161+
plic: interrupt-controller@2000000 {
162+
compatible = "andestech,qilai-plic",
163+
"andestech,nceplic100";
164+
reg = <0x0 0x02000000 0x0 0x2000000>;
165+
#address-cells = <0>;
166+
#interrupt-cells = <2>;
167+
interrupt-controller;
168+
interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>,
169+
<&cpu1_intc 11>, <&cpu1_intc 9>,
170+
<&cpu2_intc 11>, <&cpu2_intc 9>,
171+
<&cpu3_intc 11>, <&cpu3_intc 9>;
172+
riscv,ndev = <71>;
173+
};
174+
175+
uart0: serial@30300000 {
176+
compatible = "andestech,uart16550", "ns16550a";
177+
reg = <0x0 0x30300000 0x0 0x100000>;
178+
interrupts = <9 IRQ_TYPE_LEVEL_HIGH>;
179+
clock-frequency = <50000000>;
180+
reg-offset = <32>;
181+
reg-shift = <2>;
182+
reg-io-width = <4>;
183+
no-loopback-test;
184+
};
185+
};
186+
};

0 commit comments

Comments
 (0)