* [PATCH v3 0/6] spacemit: k3: Replace bad CLINT node with ACLINT nodes
@ 2026-09-17 16:29 Junhui Liu
2026-09-17 16:29 ` [PATCH v3 1/6] dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3 Junhui Liu
` (6 more replies)
0 siblings, 7 replies; 9+ messages in thread
From: Junhui Liu @ 2026-09-17 16:29 UTC (permalink / raw)
To: Daniel Lezcano, Thomas Gleixner, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Yixun Lan, Inochi Amaoto,
Radu Rendec, Paul Walmsley, Samuel Holland, Palmer Dabbelt,
Anup Patel, Guodong Xu, Albert Ou, Alexandre Ghiti
Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
Bo Gan, Junhui Liu
When testing OpenSBI with the upstream Device Tree, the CLINT controller
failed to function properly with the irqchip.riscv_imsic_noipi boot
parameter:
Platform IPI Device : aclint-mswi
Platform Timer Device : aclint-mtimer @ 24000000Hz
Domain0 Region03 : 0x00000000e081c000-0x00000000e081ffff M: (I,R,W) S/U: ()
[ 0.091014] smp: Bringing up secondary CPUs ...
[ 10.104917] CPU1 failed to report alive state
[ 20.118689] CPU2 failed to report alive state
[ 30.132288] CPU3 failed to report alive state
[ 40.145953] CPU4 failed to report alive state
[ 50.159604] CPU5 failed to report alive state
[ 60.173212] CPU6 failed to report alive state
[ 70.186981] CPU7 failed to report alive state
[ 70.191411] smp: Brought up 1 node, 1 CPU
Through exploring and testing, I discovered that the K3 actually
provides all three complete ACLINT components, and subsequent
confirmation with the vendor yielded the following information:
The ACLINT register space is mapped at two base addresses: a secure
window at 0xf1810000 and a non-secure window at 0xe0810000. The
secure window exposes all three components, while the non-secure
window only exposes SSWI; the MSWI and MTIMER offsets are reserved
there:
+---------+--------+-----------------------+-----------------------+
| Offset | Module | Secure Window | Non-Secure Window |
+---------+--------+-----------------------+-----------------------+
| +0x0000 | MSWI | 0xf1810000-0xf1813fff | 0xe0810000-0xe0813fff |
| | | | (Reserved) |
+---------+--------+-----------------------+-----------------------+
| +0x4000 | MTIMER | 0xf1814000-0xf181bfff | 0xe0814000-0xe081bfff |
| | | | (Reserved) |
+---------+--------+-----------------------+-----------------------+
| +0xc000 | SSWI | 0xf181c000-0xf181ffff | 0xe081c000-0xe081ffff |
+---------+--------+-----------------------+-----------------------+
MSWI and MTIMER reside in the secure ACLINT space, which is only
accessible through the secure window; their offsets in the non-secure
window are reserved. SSWI resides in the non-secure ACLINT space,
which is aliased in both windows. However, depending on the eFuse
configuration, the whole non-secure window can be inaccessible, while
the secure window remains available.
Taking these constraints into account, we use the secure window
(0xf1810000-0xf181ffff) consistently for all three ACLINT components,
as it is accessible regardless of the eFuse configuration. OpenSBI
protects the MSWI and MTIMER ranges from Supervisor-mode access via PMP,
leaving the SSWI range available to S-mode.
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
Changes in v3:
- Correct the accessibility description of secure and non-secure windows
- Drop spacemit,k3-clint from sifive,clint.yaml entirely
- Move SSWI to its secure-window alias
- Link to v2: https://patch.msgid.link/20260909-k3-aclint-v2-0-7931e5bc86ad@pigmoral.tech
Changes in v2:
- Drop the generic riscv,aclint-* fallback compatibles and use only
SpacemiT K3-specific compatibles.
- Match spacemit,k3-aclint-sswi directly in the SSWI driver.
- Squash the ACLINT MSWI and MTIMER DT additions into the patch that
replaces the incorrect CLINT node.
- Link to v1: https://patch.msgid.link/20260729-k3-aclint-v1-0-aef88614d3a5@pigmoral.tech
---
Junhui Liu (6):
dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3
dt-bindings: interrupt-controller: thead,c900-aclint-mswi: Add SpacemiT K3
dt-bindings: interrupt-controller: thead,c900-aclint-sswi: Add SpacemiT K3
dt-bindings: timer: sifive,clint: Remove spacemit,k3-clint
irqchip/aclint-sswi: Add support for SpacemiT K3
riscv: dts: spacemit: k3: Replace incorrect CLINT node with ACLINT nodes
.../thead,c900-aclint-mswi.yaml | 1 +
.../thead,c900-aclint-sswi.yaml | 5 ++-
.../devicetree/bindings/timer/sifive,clint.yaml | 1 -
.../bindings/timer/thead,c900-aclint-mtimer.yaml | 1 +
arch/riscv/boot/dts/spacemit/k3.dtsi | 43 +++++++++++++++-------
drivers/irqchip/irq-aclint-sswi.c | 1 +
6 files changed, 36 insertions(+), 16 deletions(-)
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260729-k3-aclint-94ca9d3f818f
Best regards,
--
Junhui Liu <junhui.liu@pigmoral.tech>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 1/6] dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3
2026-09-17 16:29 [PATCH v3 0/6] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
@ 2026-09-17 16:29 ` Junhui Liu
2026-09-17 16:29 ` [PATCH v3 2/6] dt-bindings: interrupt-controller: thead,c900-aclint-mswi: " Junhui Liu
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Junhui Liu @ 2026-09-17 16:29 UTC (permalink / raw)
To: Daniel Lezcano, Thomas Gleixner, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Yixun Lan, Inochi Amaoto,
Radu Rendec, Paul Walmsley, Samuel Holland, Palmer Dabbelt,
Anup Patel, Guodong Xu, Albert Ou, Alexandre Ghiti
Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
Bo Gan, Junhui Liu
Add support for the SpacemiT K3 ACLINT MTIMER, which provides per-hart
timer interrupts in Machine mode.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml b/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml
index cf7c82e980f6..082378b04d72 100644
--- a/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml
+++ b/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml
@@ -12,6 +12,7 @@ maintainers:
properties:
compatible:
oneOf:
+ - const: spacemit,k3-aclint-mtimer
- items:
- enum:
- sophgo,sg2042-aclint-mtimer
--
2.55.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 2/6] dt-bindings: interrupt-controller: thead,c900-aclint-mswi: Add SpacemiT K3
2026-09-17 16:29 [PATCH v3 0/6] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
2026-09-17 16:29 ` [PATCH v3 1/6] dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3 Junhui Liu
@ 2026-09-17 16:29 ` Junhui Liu
2026-09-17 16:29 ` [PATCH v3 3/6] dt-bindings: interrupt-controller: thead,c900-aclint-sswi: " Junhui Liu
` (4 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Junhui Liu @ 2026-09-17 16:29 UTC (permalink / raw)
To: Daniel Lezcano, Thomas Gleixner, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Yixun Lan, Inochi Amaoto,
Radu Rendec, Paul Walmsley, Samuel Holland, Palmer Dabbelt,
Anup Patel, Guodong Xu, Albert Ou, Alexandre Ghiti
Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
Bo Gan, Junhui Liu
Add support for the SpacemiT K3 ACLINT MSWI, which provides per-hart
software interrupts for inter-processor communication in Machine mode.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
.../devicetree/bindings/interrupt-controller/thead,c900-aclint-mswi.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-mswi.yaml b/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-mswi.yaml
index 62fd220e126e..d17f5613612c 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-mswi.yaml
+++ b/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-mswi.yaml
@@ -12,6 +12,7 @@ maintainers:
properties:
compatible:
oneOf:
+ - const: spacemit,k3-aclint-mswi
- items:
- enum:
- sophgo,sg2042-aclint-mswi
--
2.55.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 3/6] dt-bindings: interrupt-controller: thead,c900-aclint-sswi: Add SpacemiT K3
2026-09-17 16:29 [PATCH v3 0/6] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
2026-09-17 16:29 ` [PATCH v3 1/6] dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3 Junhui Liu
2026-09-17 16:29 ` [PATCH v3 2/6] dt-bindings: interrupt-controller: thead,c900-aclint-mswi: " Junhui Liu
@ 2026-09-17 16:29 ` Junhui Liu
2026-09-17 16:29 ` [PATCH v3 4/6] dt-bindings: timer: sifive,clint: Remove spacemit,k3-clint Junhui Liu
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Junhui Liu @ 2026-09-17 16:29 UTC (permalink / raw)
To: Daniel Lezcano, Thomas Gleixner, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Yixun Lan, Inochi Amaoto,
Radu Rendec, Paul Walmsley, Samuel Holland, Palmer Dabbelt,
Anup Patel, Guodong Xu, Albert Ou, Alexandre Ghiti
Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
Bo Gan, Junhui Liu
Add support for the SpacemiT K3 ACLINT SSWI, which provides
inter-processor interrupts in Supervisor mode without calling into
Machine-mode firmware.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
.../bindings/interrupt-controller/thead,c900-aclint-sswi.yaml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-sswi.yaml b/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-sswi.yaml
index d02c6886283a..0b34ed5b4639 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-sswi.yaml
+++ b/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-sswi.yaml
@@ -24,12 +24,13 @@ description:
properties:
compatible:
oneOf:
+ - enum:
+ - mips,p8700-aclint-sswi
+ - spacemit,k3-aclint-sswi
- items:
- enum:
- sophgo,sg2044-aclint-sswi
- const: thead,c900-aclint-sswi
- - items:
- - const: mips,p8700-aclint-sswi
- items:
- enum:
- anlogic,dr1v90-aclint-sswi
--
2.55.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 4/6] dt-bindings: timer: sifive,clint: Remove spacemit,k3-clint
2026-09-17 16:29 [PATCH v3 0/6] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
` (2 preceding siblings ...)
2026-09-17 16:29 ` [PATCH v3 3/6] dt-bindings: interrupt-controller: thead,c900-aclint-sswi: " Junhui Liu
@ 2026-09-17 16:29 ` Junhui Liu
2026-09-17 16:29 ` [PATCH v3 5/6] irqchip/aclint-sswi: Add support for SpacemiT K3 Junhui Liu
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Junhui Liu @ 2026-09-17 16:29 UTC (permalink / raw)
To: Daniel Lezcano, Thomas Gleixner, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Yixun Lan, Inochi Amaoto,
Radu Rendec, Paul Walmsley, Samuel Holland, Palmer Dabbelt,
Anup Patel, Guodong Xu, Albert Ou, Alexandre Ghiti
Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
Bo Gan, Junhui Liu
The SpacemiT K3 implements separate ACLINT MSWI, MTIMER and SSWI
devices. The existing spacemit,k3-clint compatible incorrectly describes
the SSWI register space as a legacy CLINT.
Remove this compatible, as it never matched the actual hardware and
has no remaining users.
Fixes: 6cdeb30db4d8 ("dt-bindings: timer: add SpacemiT K3 CLINT")
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
Documentation/devicetree/bindings/timer/sifive,clint.yaml | 1 -
1 file changed, 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/timer/sifive,clint.yaml b/Documentation/devicetree/bindings/timer/sifive,clint.yaml
index 3673836e14de..d53f52e80d88 100644
--- a/Documentation/devicetree/bindings/timer/sifive,clint.yaml
+++ b/Documentation/devicetree/bindings/timer/sifive,clint.yaml
@@ -34,7 +34,6 @@ properties:
- microchip,pic64gx-clint # Microchip PIC64GX
- sifive,fu540-c000-clint # SiFive FU540
- spacemit,k1-clint # SpacemiT K1
- - spacemit,k3-clint # SpacemiT K3
- starfive,jh7100-clint # StarFive JH7100
- starfive,jh7110-clint # StarFive JH7110
- starfive,jh8100-clint # StarFive JH8100
--
2.55.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 5/6] irqchip/aclint-sswi: Add support for SpacemiT K3
2026-09-17 16:29 [PATCH v3 0/6] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
` (3 preceding siblings ...)
2026-09-17 16:29 ` [PATCH v3 4/6] dt-bindings: timer: sifive,clint: Remove spacemit,k3-clint Junhui Liu
@ 2026-09-17 16:29 ` Junhui Liu
2026-09-19 0:06 ` Yixun Lan
2026-09-17 16:29 ` [PATCH v3 6/6] riscv: dts: spacemit: k3: Replace incorrect CLINT node with ACLINT nodes Junhui Liu
2026-09-18 23:52 ` [PATCH v3 0/6] spacemit: k3: Replace bad " Yixun Lan
6 siblings, 1 reply; 9+ messages in thread
From: Junhui Liu @ 2026-09-17 16:29 UTC (permalink / raw)
To: Daniel Lezcano, Thomas Gleixner, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Yixun Lan, Inochi Amaoto,
Radu Rendec, Paul Walmsley, Samuel Holland, Palmer Dabbelt,
Anup Patel, Guodong Xu, Albert Ou, Alexandre Ghiti
Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
Bo Gan, Junhui Liu
Add a match entry for the spacemit,k3-aclint-sswi compatible. The K3
SSWI device requires no special handling and can use the existing
generic ACLINT SSWI initialization function.
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
drivers/irqchip/irq-aclint-sswi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/irqchip/irq-aclint-sswi.c b/drivers/irqchip/irq-aclint-sswi.c
index ca06efd86fa1..d3ef2cd3b5c5 100644
--- a/drivers/irqchip/irq-aclint-sswi.c
+++ b/drivers/irqchip/irq-aclint-sswi.c
@@ -179,6 +179,7 @@ static int __init generic_aclint_sswi_early_probe(struct device_node *node,
}
IRQCHIP_DECLARE(mips_p8700_sswi, "mips,p8700-aclint-sswi", generic_aclint_sswi_early_probe);
IRQCHIP_DECLARE(nuclei_ux900_sswi, "nuclei,ux900-aclint-sswi", generic_aclint_sswi_early_probe);
+IRQCHIP_DECLARE(spacemit_k3_sswi, "spacemit,k3-aclint-sswi", generic_aclint_sswi_early_probe);
/* THEAD variant */
#define THEAD_C9XX_CSR_SXSTATUS 0x5c0
--
2.55.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 6/6] riscv: dts: spacemit: k3: Replace incorrect CLINT node with ACLINT nodes
2026-09-17 16:29 [PATCH v3 0/6] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
` (4 preceding siblings ...)
2026-09-17 16:29 ` [PATCH v3 5/6] irqchip/aclint-sswi: Add support for SpacemiT K3 Junhui Liu
@ 2026-09-17 16:29 ` Junhui Liu
2026-09-18 23:52 ` [PATCH v3 0/6] spacemit: k3: Replace bad " Yixun Lan
6 siblings, 0 replies; 9+ messages in thread
From: Junhui Liu @ 2026-09-17 16:29 UTC (permalink / raw)
To: Daniel Lezcano, Thomas Gleixner, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Yixun Lan, Inochi Amaoto,
Radu Rendec, Paul Walmsley, Samuel Holland, Palmer Dabbelt,
Anup Patel, Guodong Xu, Albert Ou, Alexandre Ghiti
Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
Bo Gan, Junhui Liu
The K3 implements separate ACLINT MSWI, MTIMER and SSWI devices. The
existing CLINT node at 0xe081c000 incorrectly describes the SSWI
register space in the non-secure window as a legacy CLINT.
The ACLINT register space is mapped at two base addresses: a secure
window at 0xf1810000 and a non-secure window at 0xe0810000. The
secure window exposes all three components, while the non-secure
window only exposes SSWI; the MSWI and MTIMER offsets are reserved
there. Moreover, depending on the eFuse configuration, the non-secure
window may be entirely inaccessible, whereas the secure window is
always available.
Replace the CLINT node with the three ACLINT devices, all using
secure-window addresses: MSWI and MTIMER for machine-level firmware
such as OpenSBI, and SSWI for supervisor software interrupts.
Fixes: 56f37e391a62 ("riscv: dts: spacemit: add initial support for K3 SoC")
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
arch/riscv/boot/dts/spacemit/k3.dtsi | 43 +++++++++++++++++++++++++-----------
1 file changed, 30 insertions(+), 13 deletions(-)
diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index c3f2dce0969c..74831974435e 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -1261,19 +1261,6 @@ saplic: interrupt-controller@e0804000 {
riscv,num-sources = <512>;
};
- clint: timer@e081c000 {
- compatible = "spacemit,k3-clint", "sifive,clint0";
- reg = <0x0 0xe081c000 0x0 0x4000>;
- interrupts-extended = <&cpu0_intc 3>, <&cpu0_intc 7>,
- <&cpu1_intc 3>, <&cpu1_intc 7>,
- <&cpu2_intc 3>, <&cpu2_intc 7>,
- <&cpu3_intc 3>, <&cpu3_intc 7>,
- <&cpu4_intc 3>, <&cpu4_intc 7>,
- <&cpu5_intc 3>, <&cpu5_intc 7>,
- <&cpu6_intc 3>, <&cpu6_intc 7>,
- <&cpu7_intc 3>, <&cpu7_intc 7>;
- };
-
/* sec_i2c3: 0xf0614000, not available from Linux */
mimsic: interrupt-controller@f1000000 {
@@ -1305,5 +1292,35 @@ maplic: interrupt-controller@f1800000 {
riscv,num-sources = <512>;
status = "reserved";
};
+
+ aclint_mswi: interrupt-controller@f1810000 {
+ compatible = "spacemit,k3-aclint-mswi";
+ reg = <0x0 0xf1810000 0x0 0x4000>;
+ interrupts-extended = <&cpu0_intc 3>, <&cpu1_intc 3>,
+ <&cpu2_intc 3>, <&cpu3_intc 3>,
+ <&cpu4_intc 3>, <&cpu5_intc 3>,
+ <&cpu6_intc 3>, <&cpu7_intc 3>;
+ };
+
+ aclint_mtimer: timer@f1814000 {
+ compatible = "spacemit,k3-aclint-mtimer";
+ reg = <0x0 0xf1814000 0x0 0x8000>;
+ reg-names = "mtimecmp";
+ interrupts-extended = <&cpu0_intc 7>, <&cpu1_intc 7>,
+ <&cpu2_intc 7>, <&cpu3_intc 7>,
+ <&cpu4_intc 7>, <&cpu5_intc 7>,
+ <&cpu6_intc 7>, <&cpu7_intc 7>;
+ };
+
+ aclint_sswi: interrupt-controller@f181c000 {
+ compatible = "spacemit,k3-aclint-sswi";
+ reg = <0x0 0xf181c000 0x0 0x4000>;
+ #interrupt-cells = <0>;
+ interrupt-controller;
+ interrupts-extended = <&cpu0_intc 1>, <&cpu1_intc 1>,
+ <&cpu2_intc 1>, <&cpu3_intc 1>,
+ <&cpu4_intc 1>, <&cpu5_intc 1>,
+ <&cpu6_intc 1>, <&cpu7_intc 1>;
+ };
};
};
--
2.55.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 0/6] spacemit: k3: Replace bad CLINT node with ACLINT nodes
2026-09-17 16:29 [PATCH v3 0/6] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
` (5 preceding siblings ...)
2026-09-17 16:29 ` [PATCH v3 6/6] riscv: dts: spacemit: k3: Replace incorrect CLINT node with ACLINT nodes Junhui Liu
@ 2026-09-18 23:52 ` Yixun Lan
6 siblings, 0 replies; 9+ messages in thread
From: Yixun Lan @ 2026-09-18 23:52 UTC (permalink / raw)
To: Junhui Liu
Cc: Daniel Lezcano, Thomas Gleixner, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Inochi Amaoto, Radu Rendec,
Paul Walmsley, Samuel Holland, Palmer Dabbelt, Anup Patel,
Guodong Xu, Albert Ou, Alexandre Ghiti, linux-kernel, devicetree,
linux-riscv, spacemit, Conor Dooley, Bo Gan
Hi Junhui,
On 00:29 Fri 18 Sep , Junhui Liu wrote:
> When testing OpenSBI with the upstream Device Tree, the CLINT controller
> failed to function properly with the irqchip.riscv_imsic_noipi boot
> parameter:
>
> Platform IPI Device : aclint-mswi
> Platform Timer Device : aclint-mtimer @ 24000000Hz
>
> Domain0 Region03 : 0x00000000e081c000-0x00000000e081ffff M: (I,R,W) S/U: ()
>
> [ 0.091014] smp: Bringing up secondary CPUs ...
> [ 10.104917] CPU1 failed to report alive state
> [ 20.118689] CPU2 failed to report alive state
> [ 30.132288] CPU3 failed to report alive state
> [ 40.145953] CPU4 failed to report alive state
> [ 50.159604] CPU5 failed to report alive state
> [ 60.173212] CPU6 failed to report alive state
> [ 70.186981] CPU7 failed to report alive state
> [ 70.191411] smp: Brought up 1 node, 1 CPU
>
> Through exploring and testing, I discovered that the K3 actually
> provides all three complete ACLINT components, and subsequent
> confirmation with the vendor yielded the following information:
>
> The ACLINT register space is mapped at two base addresses: a secure
> window at 0xf1810000 and a non-secure window at 0xe0810000. The
> secure window exposes all three components, while the non-secure
> window only exposes SSWI; the MSWI and MTIMER offsets are reserved
> there:
>
> +---------+--------+-----------------------+-----------------------+
> | Offset | Module | Secure Window | Non-Secure Window |
> +---------+--------+-----------------------+-----------------------+
> | +0x0000 | MSWI | 0xf1810000-0xf1813fff | 0xe0810000-0xe0813fff |
> | | | | (Reserved) |
> +---------+--------+-----------------------+-----------------------+
> | +0x4000 | MTIMER | 0xf1814000-0xf181bfff | 0xe0814000-0xe081bfff |
> | | | | (Reserved) |
> +---------+--------+-----------------------+-----------------------+
> | +0xc000 | SSWI | 0xf181c000-0xf181ffff | 0xe081c000-0xe081ffff |
> +---------+--------+-----------------------+-----------------------+
>
> MSWI and MTIMER reside in the secure ACLINT space, which is only
> accessible through the secure window; their offsets in the non-secure
> window are reserved. SSWI resides in the non-secure ACLINT space,
> which is aliased in both windows. However, depending on the eFuse
> configuration, the whole non-secure window can be inaccessible, while
> the secure window remains available.
>
> Taking these constraints into account, we use the secure window
> (0xf1810000-0xf181ffff) consistently for all three ACLINT components,
> as it is accessible regardless of the eFuse configuration. OpenSBI
> protects the MSWI and MTIMER ranges from Supervisor-mode access via PMP,
> leaving the SSWI range available to S-mode.
>
> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
> ---
> Changes in v3:
> - Correct the accessibility description of secure and non-secure windows
> - Drop spacemit,k3-clint from sifive,clint.yaml entirely
> - Move SSWI to its secure-window alias
> - Link to v2: https://patch.msgid.link/20260909-k3-aclint-v2-0-7931e5bc86ad@pigmoral.tech
>
> Changes in v2:
> - Drop the generic riscv,aclint-* fallback compatibles and use only
> SpacemiT K3-specific compatibles.
> - Match spacemit,k3-aclint-sswi directly in the SSWI driver.
> - Squash the ACLINT MSWI and MTIMER DT additions into the patch that
> replaces the incorrect CLINT node.
> - Link to v1: https://patch.msgid.link/20260729-k3-aclint-v1-0-aef88614d3a5@pigmoral.tech
>
> ---
> Junhui Liu (6):
> dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3
> dt-bindings: interrupt-controller: thead,c900-aclint-mswi: Add SpacemiT K3
> dt-bindings: interrupt-controller: thead,c900-aclint-sswi: Add SpacemiT K3
> dt-bindings: timer: sifive,clint: Remove spacemit,k3-clint
> irqchip/aclint-sswi: Add support for SpacemiT K3
> riscv: dts: spacemit: k3: Replace incorrect CLINT node with ACLINT nodes
>
> .../thead,c900-aclint-mswi.yaml | 1 +
> .../thead,c900-aclint-sswi.yaml | 5 ++-
> .../devicetree/bindings/timer/sifive,clint.yaml | 1 -
> .../bindings/timer/thead,c900-aclint-mtimer.yaml | 1 +
> arch/riscv/boot/dts/spacemit/k3.dtsi | 43 +++++++++++++++-------
> drivers/irqchip/irq-aclint-sswi.c | 1 +
> 6 files changed, 36 insertions(+), 16 deletions(-)
> ---
For the series, with my
Reviewed-by: Yixun Lan <dlan@kernel.org>
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 5/6] irqchip/aclint-sswi: Add support for SpacemiT K3
2026-09-17 16:29 ` [PATCH v3 5/6] irqchip/aclint-sswi: Add support for SpacemiT K3 Junhui Liu
@ 2026-09-19 0:06 ` Yixun Lan
0 siblings, 0 replies; 9+ messages in thread
From: Yixun Lan @ 2026-09-19 0:06 UTC (permalink / raw)
To: Thomas Gleixner, Radu Rendec
Cc: Junhui Liu, Daniel Lezcano, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Inochi Amaoto, Paul Walmsley, Samuel Holland,
Palmer Dabbelt, Anup Patel, Guodong Xu, Albert Ou,
Alexandre Ghiti, linux-kernel, devicetree, linux-riscv, spacemit,
Conor Dooley, Bo Gan
Hi Thomas Gleixner, Radu Rendec
On 00:29 Fri 18 Sep , Junhui Liu wrote:
> Add a match entry for the spacemit,k3-aclint-sswi compatible. The K3
> SSWI device requires no special handling and can use the existing
> generic ACLINT SSWI initialization function.
>
> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
> ---
> drivers/irqchip/irq-aclint-sswi.c | 1 +
> 1 file changed, 1 insertion(+)
>
Ping irqchip subsystem maintainer, how do you expect to handle this patch?
There are some dependencies between dt-binding, the driver and DTS file..
Would it be ok if I take it together via SpacemiT SoC tree? and probably with
your Acked-by? Thanks
> diff --git a/drivers/irqchip/irq-aclint-sswi.c b/drivers/irqchip/irq-aclint-sswi.c
> index ca06efd86fa1..d3ef2cd3b5c5 100644
> --- a/drivers/irqchip/irq-aclint-sswi.c
> +++ b/drivers/irqchip/irq-aclint-sswi.c
> @@ -179,6 +179,7 @@ static int __init generic_aclint_sswi_early_probe(struct device_node *node,
> }
> IRQCHIP_DECLARE(mips_p8700_sswi, "mips,p8700-aclint-sswi", generic_aclint_sswi_early_probe);
> IRQCHIP_DECLARE(nuclei_ux900_sswi, "nuclei,ux900-aclint-sswi", generic_aclint_sswi_early_probe);
> +IRQCHIP_DECLARE(spacemit_k3_sswi, "spacemit,k3-aclint-sswi", generic_aclint_sswi_early_probe);
>
> /* THEAD variant */
> #define THEAD_C9XX_CSR_SXSTATUS 0x5c0
>
> --
> 2.55.0
>
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-09-19 0:06 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 16:29 [PATCH v3 0/6] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
2026-09-17 16:29 ` [PATCH v3 1/6] dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3 Junhui Liu
2026-09-17 16:29 ` [PATCH v3 2/6] dt-bindings: interrupt-controller: thead,c900-aclint-mswi: " Junhui Liu
2026-09-17 16:29 ` [PATCH v3 3/6] dt-bindings: interrupt-controller: thead,c900-aclint-sswi: " Junhui Liu
2026-09-17 16:29 ` [PATCH v3 4/6] dt-bindings: timer: sifive,clint: Remove spacemit,k3-clint Junhui Liu
2026-09-17 16:29 ` [PATCH v3 5/6] irqchip/aclint-sswi: Add support for SpacemiT K3 Junhui Liu
2026-09-19 0:06 ` Yixun Lan
2026-09-17 16:29 ` [PATCH v3 6/6] riscv: dts: spacemit: k3: Replace incorrect CLINT node with ACLINT nodes Junhui Liu
2026-09-18 23:52 ` [PATCH v3 0/6] spacemit: k3: Replace bad " Yixun Lan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®