Linux SpacemiT device drivers
 help / color / mirror / Atom feed
* [PATCH RFC 0/7] spacemit: k3: Replace bad CLINT node with ACLINT nodes
@ 2026-07-28 16:36 Junhui Liu
  2026-07-28 16:36 ` [PATCH RFC 1/7] dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3 Junhui Liu
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Junhui Liu @ 2026-07-28 16:36 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Yixun Lan, Inochi Amaoto, Samuel Holland,
	Anup Patel, Guodong Xu
  Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
	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 controllers are mapped to two physical memory regions:
secure (0xf1810000-0xf1820000) and non-secure (0xe0810000-0xe0820000),
with varying accessibility per controller and execution mode:

+---------+--------+------------------------+-----------------------+
| Offset  | Module | Secure Region          | Non-Secure Region     |
+---------+--------+------------------------+-----------------------+
| +0x0000 | MSWI   | 0xf1810000-0xf1813fff  | 0xe0810000-0xe0813fff |
|         |        | (M-mode only)          | (Inaccessible)        |
+---------+--------+------------------------+-----------------------+
| +0x4000 | MTIMER | 0xf1814000-0xf181bfff  | 0xe0814000-0xe081bfff |
|         |        | (M-mode only)          | (Inaccessible)        |
+---------+--------+------------------------+-----------------------+
| +0xc000 | SSWI   | 0xf181c000-0xf181ffff  | 0xe081c000-0xe081ffff |
|         |        | (M-mode only if efused)| (M/S-mode Accessible) |
+---------+--------+------------------------+-----------------------+

Taking these constraints into account, we choose the secure region
(0xf1810000-0xf181bfff) for the M-mode ACLINT components (MSWI and
MTIMER), and the non-secure region (0xe081c000-0xe081ffff) for the
S-mode SSWI component.

This series is marked as RFC to discuss the ACLINT compatible string
strategy. Existing ACLINT compatibles in upstream carry specific quirks
(e.g., Nuclei/T-Head MTIMER requiring 32-bit MMIO access, or MIPS SSWI
adding extra DT properties). This series introduces the standard generic
"riscv,aclint-*" fallback compatibles, similar to "riscv,imsics" and
"riscv,aplic", to prevent constantly updating drivers for future SoCs.

Feedback is welcomed on this approach versus potential alternatives,
such as using standalone "spacemit,k3-aclint-*" compatibles without
fallbacks, or selecting distinct existing fallbacks per ACLINT
sub-module to bypass known vendor quirks.

Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
Junhui Liu (7):
      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: Mark spacemit,k3-clint as deprecated
      irqchip/aclint-sswi: Add generic riscv,aclint-sswi match
      riscv: dts: spacemit: k3: Fix SSWI node misidentified as CLINT
      riscv: dts: spacemit: k3: Add ACLINT MSWI and MTIMER nodes

 .../thead,c900-aclint-mswi.yaml                    |  4 +++
 .../thead,c900-aclint-sswi.yaml                    |  4 +++
 .../devicetree/bindings/timer/sifive,clint.yaml    |  5 ++-
 .../bindings/timer/thead,c900-aclint-mtimer.yaml   |  4 +++
 arch/riscv/boot/dts/spacemit/k3.dtsi               | 37 ++++++++++++++++------
 drivers/irqchip/irq-aclint-sswi.c                  |  1 +
 6 files changed, 44 insertions(+), 11 deletions(-)
---
base-commit: 46380e4b1534c1626cecd7f4d0abb5e0cce09af6
change-id: 20260729-k3-aclint-94ca9d3f818f

Best regards,
--  
Junhui Liu <junhui.liu@pigmoral.tech>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH RFC 1/7] dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3
  2026-07-28 16:36 [PATCH RFC 0/7] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
@ 2026-07-28 16:36 ` Junhui Liu
  2026-07-28 22:13   ` Inochi Amaoto
  2026-07-28 16:36 ` [PATCH RFC 2/7] dt-bindings: interrupt-controller: thead,c900-aclint-mswi: " Junhui Liu
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: Junhui Liu @ 2026-07-28 16:36 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Yixun Lan, Inochi Amaoto, Samuel Holland,
	Anup Patel, Guodong Xu
  Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
	Junhui Liu

Add support for the ACLINT MTIMER found in the SpacemiT K3 SoC. The
hardware provides a ACLINT TIMER unit. Adding riscv,aclint-mtimer as a
fallback compatible allows direct reuse of existing OpenSBI driver.

Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
 Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml b/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml
index cf7c82e980f6..c9429a2fa364 100644
--- a/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml
+++ b/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml
@@ -21,6 +21,10 @@ properties:
           - enum:
               - anlogic,dr1v90-aclint-mtimer
           - const: nuclei,ux900-aclint-mtimer
+      - items:
+          - enum:
+              - spacemit,k3-aclint-mtimer
+          - const: riscv,aclint-mtimer
 
   reg:
     items:

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH RFC 2/7] dt-bindings: interrupt-controller: thead,c900-aclint-mswi: Add SpacemiT K3
  2026-07-28 16:36 [PATCH RFC 0/7] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
  2026-07-28 16:36 ` [PATCH RFC 1/7] dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3 Junhui Liu
@ 2026-07-28 16:36 ` Junhui Liu
  2026-07-28 16:36 ` [PATCH RFC 3/7] dt-bindings: interrupt-controller: thead,c900-aclint-sswi: " Junhui Liu
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Junhui Liu @ 2026-07-28 16:36 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Yixun Lan, Inochi Amaoto, Samuel Holland,
	Anup Patel, Guodong Xu
  Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
	Junhui Liu

Add support for the ACLINT MSWI found in the SpacemiT K3 SoC. The
hardware provides a ACLINT MSWI unit. Adding riscv,aclint-mswi as a
fallback compatible allows direct reuse of existing OpenSBI driver.

Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
 .../bindings/interrupt-controller/thead,c900-aclint-mswi.yaml         | 4 ++++
 1 file changed, 4 insertions(+)

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..d83d434a3f81 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-mswi.yaml
+++ b/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-mswi.yaml
@@ -21,6 +21,10 @@ properties:
           - enum:
               - anlogic,dr1v90-aclint-mswi
           - const: nuclei,ux900-aclint-mswi
+      - items:
+          - enum:
+              - spacemit,k3-aclint-mswi
+          - const: riscv,aclint-mswi
 
   reg:
     maxItems: 1

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH RFC 3/7] dt-bindings: interrupt-controller: thead,c900-aclint-sswi: Add SpacemiT K3
  2026-07-28 16:36 [PATCH RFC 0/7] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
  2026-07-28 16:36 ` [PATCH RFC 1/7] dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3 Junhui Liu
  2026-07-28 16:36 ` [PATCH RFC 2/7] dt-bindings: interrupt-controller: thead,c900-aclint-mswi: " Junhui Liu
@ 2026-07-28 16:36 ` Junhui Liu
  2026-07-28 16:36 ` [PATCH RFC 4/7] dt-bindings: timer: sifive,clint: Mark spacemit,k3-clint as deprecated Junhui Liu
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Junhui Liu @ 2026-07-28 16:36 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Yixun Lan, Inochi Amaoto, Samuel Holland,
	Anup Patel, Guodong Xu
  Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
	Junhui Liu

Add support for the ACLINT SSWI found in the SpacemiT K3 SoC. The
hardware provides a ACLINT SSWI unit. Adding riscv,aclint-sswi as a
fallback compatible allows direct reuse of the SSWI driver when
introducing new compatible strings in the future.

Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
 .../bindings/interrupt-controller/thead,c900-aclint-sswi.yaml         | 4 ++++
 1 file changed, 4 insertions(+)

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..529819258054 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-sswi.yaml
+++ b/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-sswi.yaml
@@ -34,6 +34,10 @@ properties:
           - enum:
               - anlogic,dr1v90-aclint-sswi
           - const: nuclei,ux900-aclint-sswi
+      - items:
+          - enum:
+              - spacemit,k3-aclint-sswi
+          - const: riscv,aclint-sswi
 
   reg:
     maxItems: 1

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH RFC 4/7] dt-bindings: timer: sifive,clint: Mark spacemit,k3-clint as deprecated
  2026-07-28 16:36 [PATCH RFC 0/7] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
                   ` (2 preceding siblings ...)
  2026-07-28 16:36 ` [PATCH RFC 3/7] dt-bindings: interrupt-controller: thead,c900-aclint-sswi: " Junhui Liu
@ 2026-07-28 16:36 ` Junhui Liu
  2026-07-28 16:36 ` [PATCH RFC 5/7] irqchip/aclint-sswi: Add generic riscv,aclint-sswi match Junhui Liu
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Junhui Liu @ 2026-07-28 16:36 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Yixun Lan, Inochi Amaoto, Samuel Holland,
	Anup Patel, Guodong Xu
  Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
	Junhui Liu

The SpacemiT K3 SoC actually implements a full ACLINT interface rather
than a legacy CLINT interface. Deprecating this entry prevents improper
usage in device trees while maintaining backward compatibility.

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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/timer/sifive,clint.yaml b/Documentation/devicetree/bindings/timer/sifive,clint.yaml
index 105e3ef539e6..bdb58f97c2e1 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
@@ -61,6 +60,10 @@ properties:
           - const: riscv,clint0
         deprecated: true
         description: For the QEMU virt machine only
+      - items:
+          - const: spacemit,k3-clint
+          - const: sifive,clint0
+        deprecated: true
 
     description:
       Should be "<vendor>,<chip>-clint", followed by "sifive,clint<version>"

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH RFC 5/7] irqchip/aclint-sswi: Add generic riscv,aclint-sswi match
  2026-07-28 16:36 [PATCH RFC 0/7] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
                   ` (3 preceding siblings ...)
  2026-07-28 16:36 ` [PATCH RFC 4/7] dt-bindings: timer: sifive,clint: Mark spacemit,k3-clint as deprecated Junhui Liu
@ 2026-07-28 16:36 ` Junhui Liu
  2026-07-28 22:14   ` Inochi Amaoto
  2026-07-28 16:36 ` [PATCH RFC 6/7] riscv: dts: spacemit: k3: Fix SSWI node misidentified as CLINT Junhui Liu
  2026-07-28 16:36 ` [PATCH RFC 7/7] riscv: dts: spacemit: k3: Add ACLINT MSWI and MTIMER nodes Junhui Liu
  6 siblings, 1 reply; 11+ messages in thread
From: Junhui Liu @ 2026-07-28 16:36 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Yixun Lan, Inochi Amaoto, Samuel Holland,
	Anup Patel, Guodong Xu
  Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
	Junhui Liu

Add match entry for the generic "riscv,aclint-sswi" compatible string.
This allows future SoCs with standard ACLINT SSWI implementations to
directly reuse the driver via the generic fallback compatible (at least
until hardware-specific quirks are identified).

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..2bd40c3ea288 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(riscv_sswi, "riscv,aclint-sswi", generic_aclint_sswi_early_probe);
 
 /* THEAD variant */
 #define THEAD_C9XX_CSR_SXSTATUS			0x5c0

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH RFC 6/7] riscv: dts: spacemit: k3: Fix SSWI node misidentified as CLINT
  2026-07-28 16:36 [PATCH RFC 0/7] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
                   ` (4 preceding siblings ...)
  2026-07-28 16:36 ` [PATCH RFC 5/7] irqchip/aclint-sswi: Add generic riscv,aclint-sswi match Junhui Liu
@ 2026-07-28 16:36 ` Junhui Liu
  2026-07-28 16:36 ` [PATCH RFC 7/7] riscv: dts: spacemit: k3: Add ACLINT MSWI and MTIMER nodes Junhui Liu
  6 siblings, 0 replies; 11+ messages in thread
From: Junhui Liu @ 2026-07-28 16:36 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Yixun Lan, Inochi Amaoto, Samuel Holland,
	Anup Patel, Guodong Xu
  Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
	Junhui Liu

The previous Device Tree defined a legacy CLINT node at 0xe081c000.
However, this register space actually belongs to the ACLINT SSWI
controller. Correct the node definition and compatible string so that
SSWI functions properly.

The ACLINT SSWI device can be accessed at either 0xf181c000 (secure) or
0xe081c000 (non-secure). However, there is an efuse bit that controls
access to the secure alias: when enabled, it restricts access solely to
Machine mode. Therefore, the non-secure base address is chosen for the
kernel to drive SSWI reliably.

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 | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index c3f2dce0969c..5fb719f79467 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -1261,17 +1261,15 @@ saplic: interrupt-controller@e0804000 {
 			riscv,num-sources = <512>;
 		};
 
-		clint: timer@e081c000 {
-			compatible = "spacemit,k3-clint", "sifive,clint0";
+		aclint_sswi: interrupt-controller@e081c000 {
+			compatible = "spacemit,k3-aclint-sswi", "riscv,aclint-sswi";
 			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>;
+			#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>;
 		};
 
 		/* sec_i2c3: 0xf0614000, not available from Linux */

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH RFC 7/7] riscv: dts: spacemit: k3: Add ACLINT MSWI and MTIMER nodes
  2026-07-28 16:36 [PATCH RFC 0/7] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
                   ` (5 preceding siblings ...)
  2026-07-28 16:36 ` [PATCH RFC 6/7] riscv: dts: spacemit: k3: Fix SSWI node misidentified as CLINT Junhui Liu
@ 2026-07-28 16:36 ` Junhui Liu
  2026-07-28 22:15   ` Inochi Amaoto
  6 siblings, 1 reply; 11+ messages in thread
From: Junhui Liu @ 2026-07-28 16:36 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Yixun Lan, Inochi Amaoto, Samuel Holland,
	Anup Patel, Guodong Xu
  Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
	Junhui Liu

The SpacemiT K3 SoC provides ACLINT MSWI and MTIMER controllers. Add
these nodes to complete the ACLINT description in the Device Tree for
M-mode firmware such as OpenSBI.

Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
---
 arch/riscv/boot/dts/spacemit/k3.dtsi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index 5fb719f79467..ecb5f4fcd8fd 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -1303,5 +1303,24 @@ maplic: interrupt-controller@f1800000 {
 			riscv,num-sources = <512>;
 			status = "reserved";
 		};
+
+		aclint_mswi: interrupt-controller@f1810000 {
+			compatible = "spacemit,k3-aclint-mswi", "riscv,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", "riscv,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>;
+		};
 	};
 };

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH RFC 1/7] dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3
  2026-07-28 16:36 ` [PATCH RFC 1/7] dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3 Junhui Liu
@ 2026-07-28 22:13   ` Inochi Amaoto
  0 siblings, 0 replies; 11+ messages in thread
From: Inochi Amaoto @ 2026-07-28 22:13 UTC (permalink / raw)
  To: Junhui Liu, Daniel Lezcano, Thomas Gleixner, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti, Yixun Lan, Inochi Amaoto,
	Samuel Holland, Anup Patel, Guodong Xu
  Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley

On Wed, Jul 29, 2026 at 12:36:27AM +0800, Junhui Liu wrote:
> Add support for the ACLINT MTIMER found in the SpacemiT K3 SoC. The
> hardware provides a ACLINT TIMER unit. Adding riscv,aclint-mtimer as a
> fallback compatible allows direct reuse of existing OpenSBI driver.
> 
> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
> ---
>  Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml b/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml
> index cf7c82e980f6..c9429a2fa364 100644
> --- a/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml
> +++ b/Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml
> @@ -21,6 +21,10 @@ properties:
>            - enum:
>                - anlogic,dr1v90-aclint-mtimer
>            - const: nuclei,ux900-aclint-mtimer
> +      - items:
> +          - enum:
> +              - spacemit,k3-aclint-mtimer
> +          - const: riscv,aclint-mtimer
>  

Drop the generic riscv compatible as Linux only accepts ratified spec.
But this ACLINT is already archived and will not be ratified.

The request also applies to patch 2, 3.

>    reg:
>      items:
> 
> -- 
> 2.55.0
> 

Regards,
Inochi

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH RFC 5/7] irqchip/aclint-sswi: Add generic riscv,aclint-sswi match
  2026-07-28 16:36 ` [PATCH RFC 5/7] irqchip/aclint-sswi: Add generic riscv,aclint-sswi match Junhui Liu
@ 2026-07-28 22:14   ` Inochi Amaoto
  0 siblings, 0 replies; 11+ messages in thread
From: Inochi Amaoto @ 2026-07-28 22:14 UTC (permalink / raw)
  To: Junhui Liu, Daniel Lezcano, Thomas Gleixner, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti, Yixun Lan, Inochi Amaoto,
	Samuel Holland, Anup Patel, Guodong Xu
  Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
	Inochi Amaoto

On Wed, Jul 29, 2026 at 12:36:31AM +0800, Junhui Liu wrote:
> Add match entry for the generic "riscv,aclint-sswi" compatible string.
> This allows future SoCs with standard ACLINT SSWI implementations to
> directly reuse the driver via the generic fallback compatible (at least
> until hardware-specific quirks are identified).
> 
> 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..2bd40c3ea288 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(riscv_sswi, "riscv,aclint-sswi", generic_aclint_sswi_early_probe);
>  

Again, use vendor specific name for irqchip declaration.

>  /* THEAD variant */
>  #define THEAD_C9XX_CSR_SXSTATUS			0x5c0
> 
> -- 
> 2.55.0
> 

Reagrds,
Inochi

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH RFC 7/7] riscv: dts: spacemit: k3: Add ACLINT MSWI and MTIMER nodes
  2026-07-28 16:36 ` [PATCH RFC 7/7] riscv: dts: spacemit: k3: Add ACLINT MSWI and MTIMER nodes Junhui Liu
@ 2026-07-28 22:15   ` Inochi Amaoto
  0 siblings, 0 replies; 11+ messages in thread
From: Inochi Amaoto @ 2026-07-28 22:15 UTC (permalink / raw)
  To: Junhui Liu, Daniel Lezcano, Thomas Gleixner, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti, Yixun Lan, Inochi Amaoto,
	Samuel Holland, Anup Patel, Guodong Xu
  Cc: linux-kernel, devicetree, linux-riscv, spacemit, Conor Dooley,
	Inochi Amaoto

On Wed, Jul 29, 2026 at 12:36:33AM +0800, Junhui Liu wrote:
> The SpacemiT K3 SoC provides ACLINT MSWI and MTIMER controllers. Add
> these nodes to complete the ACLINT description in the Device Tree for
> M-mode firmware such as OpenSBI.
> 
> Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
> ---
>  arch/riscv/boot/dts/spacemit/k3.dtsi | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
> index 5fb719f79467..ecb5f4fcd8fd 100644
> --- a/arch/riscv/boot/dts/spacemit/k3.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
> @@ -1303,5 +1303,24 @@ maplic: interrupt-controller@f1800000 {
>  			riscv,num-sources = <512>;
>  			status = "reserved";
>  		};
> +
> +		aclint_mswi: interrupt-controller@f1810000 {
> +			compatible = "spacemit,k3-aclint-mswi", "riscv,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", "riscv,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>;
> +		};
>  	};
>  };
> 
> -- 
> 2.55.0
> 

Squash this patch into the previous one, it is the same device.

Regards,
Inochi

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-07-28 22:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-28 16:36 [PATCH RFC 0/7] spacemit: k3: Replace bad CLINT node with ACLINT nodes Junhui Liu
2026-07-28 16:36 ` [PATCH RFC 1/7] dt-bindings: timer: thead,c900-aclint-mtimer: Add SpacemiT K3 Junhui Liu
2026-07-28 22:13   ` Inochi Amaoto
2026-07-28 16:36 ` [PATCH RFC 2/7] dt-bindings: interrupt-controller: thead,c900-aclint-mswi: " Junhui Liu
2026-07-28 16:36 ` [PATCH RFC 3/7] dt-bindings: interrupt-controller: thead,c900-aclint-sswi: " Junhui Liu
2026-07-28 16:36 ` [PATCH RFC 4/7] dt-bindings: timer: sifive,clint: Mark spacemit,k3-clint as deprecated Junhui Liu
2026-07-28 16:36 ` [PATCH RFC 5/7] irqchip/aclint-sswi: Add generic riscv,aclint-sswi match Junhui Liu
2026-07-28 22:14   ` Inochi Amaoto
2026-07-28 16:36 ` [PATCH RFC 6/7] riscv: dts: spacemit: k3: Fix SSWI node misidentified as CLINT Junhui Liu
2026-07-28 16:36 ` [PATCH RFC 7/7] riscv: dts: spacemit: k3: Add ACLINT MSWI and MTIMER nodes Junhui Liu
2026-07-28 22:15   ` Inochi Amaoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox