Linux C-SKY architecture development
 help / color / mirror / Atom feed
* [PATCH 0/3] irqchip/aclint-sswi: XuanTie C9XX generic probe and csky compatible
@ 2026-11-29  3:25 GUO Ren (XuanTie)
  2026-11-29  3:25 ` [PATCH 1/3] irqchip/aclint-sswi: Use generic probe for the XuanTie C9XX variant GUO Ren (XuanTie)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: GUO Ren (XuanTie) @ 2026-11-29  3:25 UTC (permalink / raw)
  To: Thomas Gleixner, Radu Rendec, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Inochi Amaoto, Samuel Holland,
	Vladimir Kondratiev, Chen Wang
  Cc: linux-riscv, linux-kernel, devicetree, linux-csky,
	GUO Ren (XuanTie)

This series cleans up the XuanTie C9XX support in the aclint-sswi
driver and adds the csky,c900-aclint-sswi compatible.

Patch 1 drops the XuanTie C9XX specific probe: its sxstatus.CLINTEE
check is redundant because the firmware (OpenSBI/zsbl) always sets
CLINTEE before exposing the SSWI device in the device tree, so the
generic probe can be used like the other vendors.

Patches 2 and 3 add the csky,c900-aclint-sswi compatible to the
binding and the driver; thead,c900-aclint-sswi is deprecated.

Signed-off-by: GUO Ren (XuanTie) <guoren@kernel.org>
---
GUO Ren (XuanTie) (3):
      irqchip/aclint-sswi: Use generic probe for the XuanTie C9XX variant
      dt-bindings: interrupt-controller: Add csky,c900-aclint-sswi compatible
      irqchip/aclint-sswi: Add csky,c900-aclint-sswi support

 .../thead,c900-aclint-sswi.yaml                    |  4 ++-
 drivers/irqchip/irq-aclint-sswi.c                  | 32 ++--------------------
 2 files changed, 5 insertions(+), 31 deletions(-)
---
base-commit: 8d7fe9885c62fc9a95bf55d9db244d9672a8aadc
change-id: 20261129-sswi-643f81d4ea01

Best regards,
--  
GUO Ren (XuanTie) <guoren@kernel.org>


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

* [PATCH 1/3] irqchip/aclint-sswi: Use generic probe for the XuanTie C9XX variant
  2026-11-29  3:25 [PATCH 0/3] irqchip/aclint-sswi: XuanTie C9XX generic probe and csky compatible GUO Ren (XuanTie)
@ 2026-11-29  3:25 ` GUO Ren (XuanTie)
  2026-11-29  3:25 ` [PATCH 2/3] dt-bindings: interrupt-controller: Add csky,c900-aclint-sswi compatible GUO Ren (XuanTie)
  2026-11-29  3:25 ` [PATCH 3/3] irqchip/aclint-sswi: Add csky,c900-aclint-sswi support GUO Ren (XuanTie)
  2 siblings, 0 replies; 4+ messages in thread
From: GUO Ren (XuanTie) @ 2026-11-29  3:25 UTC (permalink / raw)
  To: Thomas Gleixner, Radu Rendec, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Inochi Amaoto, Samuel Holland,
	Vladimir Kondratiev, Chen Wang
  Cc: linux-riscv, linux-kernel, devicetree, linux-csky,
	GUO Ren (XuanTie)

The XuanTie C9XX specific probe refuses to register the SSWI device
unless the sxstatus.CLINTEE bit is set. The check was added because
the XuanTie C9XX CLINT S-mode extension requires the M-mode firmware
to set mxstatus.CLINTEE, otherwise writes to the SSWI registers do
not generate supervisor software interrupts [1].

In practice, the firmware (OpenSBI/zsbl) always sets CLINTEE before
exposing the SSWI device in the device tree, so the presence of a
"thead,c900-aclint-sswi" node already implies that SSWI is usable and
the kernel-side check is redundant. The MIPS P8700, Nuclei UX900 and
SpacemiT K3 variants have no such vendor checks and use the generic
probe directly.

Drop the XuanTie C9XX specific probe and point "thead,c900-aclint-sswi"
at generic_aclint_sswi_early_probe() to align with the other vendors.

Link: https://lore.kernel.org/all/35d288d3-56dd-4018-8b98-78311c29a25d@sifive.com/ [1]
Signed-off-by: GUO Ren (XuanTie) <guoren@kernel.org>
---
 drivers/irqchip/irq-aclint-sswi.c | 31 +------------------------------
 1 file changed, 1 insertion(+), 30 deletions(-)

diff --git a/drivers/irqchip/irq-aclint-sswi.c b/drivers/irqchip/irq-aclint-sswi.c
index 34572db94f3d..f48f042dccdf 100644
--- a/drivers/irqchip/irq-aclint-sswi.c
+++ b/drivers/irqchip/irq-aclint-sswi.c
@@ -180,33 +180,4 @@ 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
-#define THEAD_C9XX_SXSTATUS_CLINTEE		BIT(17)
-
-static int __init thead_aclint_sswi_probe(struct fwnode_handle *fwnode)
-{
-	int rc;
-
-	/* If it is T-HEAD CPU, check whether SSWI is enabled */
-	if (riscv_cached_mvendorid(0) == THEAD_VENDOR_ID &&
-	    !(csr_read(THEAD_C9XX_CSR_SXSTATUS) & THEAD_C9XX_SXSTATUS_CLINTEE))
-		return -ENOTSUPP;
-
-	rc = aclint_sswi_probe(fwnode);
-	if (rc)
-		return rc;
-
-	/* Announce that SSWI is providing IPIs */
-	pr_info("providing IPIs using THEAD ACLINT SSWI\n");
-
-	return 0;
-}
-
-static int __init thead_aclint_sswi_early_probe(struct device_node *node,
-						struct device_node *parent)
-{
-	return thead_aclint_sswi_probe(&node->fwnode);
-}
-IRQCHIP_DECLARE(thead_aclint_sswi, "thead,c900-aclint-sswi", thead_aclint_sswi_early_probe);
+IRQCHIP_DECLARE(thead_aclint_sswi, "thead,c900-aclint-sswi", generic_aclint_sswi_early_probe);

-- 
2.43.0


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

* [PATCH 2/3] dt-bindings: interrupt-controller: Add csky,c900-aclint-sswi compatible
  2026-11-29  3:25 [PATCH 0/3] irqchip/aclint-sswi: XuanTie C9XX generic probe and csky compatible GUO Ren (XuanTie)
  2026-11-29  3:25 ` [PATCH 1/3] irqchip/aclint-sswi: Use generic probe for the XuanTie C9XX variant GUO Ren (XuanTie)
@ 2026-11-29  3:25 ` GUO Ren (XuanTie)
  2026-11-29  3:25 ` [PATCH 3/3] irqchip/aclint-sswi: Add csky,c900-aclint-sswi support GUO Ren (XuanTie)
  2 siblings, 0 replies; 4+ messages in thread
From: GUO Ren (XuanTie) @ 2026-11-29  3:25 UTC (permalink / raw)
  To: Thomas Gleixner, Radu Rendec, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Inochi Amaoto, Samuel Holland,
	Vladimir Kondratiev, Chen Wang
  Cc: linux-riscv, linux-kernel, devicetree, linux-csky,
	GUO Ren (XuanTie)

Add the "csky,c900-aclint-sswi" compatible for the XuanTie C9XX SSWI
device. The "thead,c900-aclint-sswi" compatible is deprecated.

Signed-off-by: GUO Ren (XuanTie) <guoren@kernel.org>
---
 .../bindings/interrupt-controller/thead,c900-aclint-sswi.yaml         | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 0b34ed5b4639..edaf3af49912 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-sswi.yaml
+++ b/Documentation/devicetree/bindings/interrupt-controller/thead,c900-aclint-sswi.yaml
@@ -18,13 +18,15 @@ description:
 
   Following variants of the SSWI ACLINT supported, using dedicated
   compatible string
-  - THEAD C900
+  - THEAD C900 (deprecated)
   - MIPS P8700
+  - C-SKY C900
 
 properties:
   compatible:
     oneOf:
       - enum:
+          - csky,c900-aclint-sswi
           - mips,p8700-aclint-sswi
           - spacemit,k3-aclint-sswi
       - items:

-- 
2.43.0


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

* [PATCH 3/3] irqchip/aclint-sswi: Add csky,c900-aclint-sswi support
  2026-11-29  3:25 [PATCH 0/3] irqchip/aclint-sswi: XuanTie C9XX generic probe and csky compatible GUO Ren (XuanTie)
  2026-11-29  3:25 ` [PATCH 1/3] irqchip/aclint-sswi: Use generic probe for the XuanTie C9XX variant GUO Ren (XuanTie)
  2026-11-29  3:25 ` [PATCH 2/3] dt-bindings: interrupt-controller: Add csky,c900-aclint-sswi compatible GUO Ren (XuanTie)
@ 2026-11-29  3:25 ` GUO Ren (XuanTie)
  2 siblings, 0 replies; 4+ messages in thread
From: GUO Ren (XuanTie) @ 2026-11-29  3:25 UTC (permalink / raw)
  To: Thomas Gleixner, Radu Rendec, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Inochi Amaoto, Inochi Amaoto, Samuel Holland,
	Vladimir Kondratiev, Chen Wang
  Cc: linux-riscv, linux-kernel, devicetree, linux-csky,
	GUO Ren (XuanTie)

Add a match entry for the "csky,c900-aclint-sswi" compatible of the
XuanTie C9XX SSWI device. It is identical to the device matched by
the deprecated "thead,c900-aclint-sswi" compatible, so use the
generic probe.

Signed-off-by: GUO Ren (XuanTie) <guoren@kernel.org>
---
 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 f48f042dccdf..9dc2b31f880c 100644
--- a/drivers/irqchip/irq-aclint-sswi.c
+++ b/drivers/irqchip/irq-aclint-sswi.c
@@ -181,3 +181,4 @@ IRQCHIP_DECLARE(mips_p8700_sswi, "mips,p8700-aclint-sswi", generic_aclint_sswi_e
 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);
 IRQCHIP_DECLARE(thead_aclint_sswi, "thead,c900-aclint-sswi", generic_aclint_sswi_early_probe);
+IRQCHIP_DECLARE(csky_aclint_sswi, "csky,c900-aclint-sswi", generic_aclint_sswi_early_probe);

-- 
2.43.0


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

end of thread, other threads:[~2026-11-29  3:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29  3:25 [PATCH 0/3] irqchip/aclint-sswi: XuanTie C9XX generic probe and csky compatible GUO Ren (XuanTie)
2026-11-29  3:25 ` [PATCH 1/3] irqchip/aclint-sswi: Use generic probe for the XuanTie C9XX variant GUO Ren (XuanTie)
2026-11-29  3:25 ` [PATCH 2/3] dt-bindings: interrupt-controller: Add csky,c900-aclint-sswi compatible GUO Ren (XuanTie)
2026-11-29  3:25 ` [PATCH 3/3] irqchip/aclint-sswi: Add csky,c900-aclint-sswi support GUO Ren (XuanTie)

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