All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guo Ren <guoren@kernel.org>
To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: dlan@kernel.org, devicetree@vger.kernel.org,
	spacemit@lists.linux.dev, junhui.liu@pigmoral.tech,
	"GUO Ren (XuanTie)" <guoren@kernel.org>,
	stable@vger.kernel.org, Guodong Xu <docular.xu@gmail.com>
Subject: [PATCH V2] riscv: dts: spacemit: k3: fix IMSIC num-guest-ids
Date: Mon, 17 Aug 2026 03:30:38 +0000	[thread overview]
Message-ID: <20260817033038.2286436-1-guoren@kernel.org> (raw)

From: "GUO Ren (XuanTie)" <guoren@kernel.org>

The initial K3 device tree used generic/placeholder values for the
IMSIC guest configuration:

  riscv,num-guest-ids    = <511>;

According to the SpacemiT K3 User Manual this values is incorrect
for the X100 cores:

 - Advanced Interrupt Architecture (AIA):
    - M-mode MSI: 512
    - S-mode MSI: 512
    - VS-mode MSI: 64

Therefore, S-mode IMSIC (simsic) needs num-guest-ids = 63.

Fixes: 56f37e391a62 ("riscv: dts: spacemit: add initial support for K3 SoC")
Cc: stable@vger.kernel.org
Cc: Guodong Xu <docular.xu@gmail.com>
Cc: Yixun Lan <dlan@kernel.org>
Signed-off-by: GUO Ren (XuanTie) <guoren@kernel.org>
---
V2:
 - Drop the riscv,guest-index-bits change for simsic: the property
   describes the number of guest index bits in the MSI target address,
   and the per-hart stride on K3 is 0x40000 = 2^(6 + 12), so 6 is
   correct as is.
 - Drop the mimsic changes: already fixed by Junhui.
 - Reword the subject and commit log accordingly.
---
 arch/riscv/boot/dts/spacemit/k3.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index 19fc9b49668e..4a4a9ec7c981 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -1129,7 +1129,7 @@ simsic: interrupt-controller@e0400000 {
 			msi-controller;
 			riscv,guest-index-bits = <6>;
 			riscv,hart-index-bits = <4>;
-			riscv,num-guest-ids = <511>;
+			riscv,num-guest-ids = <63>;
 			riscv,num-ids = <511>;
 		};
 
-- 
2.43.0


WARNING: multiple messages have this Message-ID (diff)
From: Guo Ren <guoren@kernel.org>
To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: dlan@kernel.org, devicetree@vger.kernel.org,
	spacemit@lists.linux.dev, junhui.liu@pigmoral.tech,
	"GUO Ren (XuanTie)" <guoren@kernel.org>,
	stable@vger.kernel.org, Guodong Xu <docular.xu@gmail.com>
Subject: [PATCH V2] riscv: dts: spacemit: k3: fix IMSIC num-guest-ids
Date: Mon, 17 Aug 2026 03:30:38 +0000	[thread overview]
Message-ID: <20260817033038.2286436-1-guoren@kernel.org> (raw)

From: "GUO Ren (XuanTie)" <guoren@kernel.org>

The initial K3 device tree used generic/placeholder values for the
IMSIC guest configuration:

  riscv,num-guest-ids    = <511>;

According to the SpacemiT K3 User Manual this values is incorrect
for the X100 cores:

 - Advanced Interrupt Architecture (AIA):
    - M-mode MSI: 512
    - S-mode MSI: 512
    - VS-mode MSI: 64

Therefore, S-mode IMSIC (simsic) needs num-guest-ids = 63.

Fixes: 56f37e391a62 ("riscv: dts: spacemit: add initial support for K3 SoC")
Cc: stable@vger.kernel.org
Cc: Guodong Xu <docular.xu@gmail.com>
Cc: Yixun Lan <dlan@kernel.org>
Signed-off-by: GUO Ren (XuanTie) <guoren@kernel.org>
---
V2:
 - Drop the riscv,guest-index-bits change for simsic: the property
   describes the number of guest index bits in the MSI target address,
   and the per-hart stride on K3 is 0x40000 = 2^(6 + 12), so 6 is
   correct as is.
 - Drop the mimsic changes: already fixed by Junhui.
 - Reword the subject and commit log accordingly.
---
 arch/riscv/boot/dts/spacemit/k3.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index 19fc9b49668e..4a4a9ec7c981 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -1129,7 +1129,7 @@ simsic: interrupt-controller@e0400000 {
 			msi-controller;
 			riscv,guest-index-bits = <6>;
 			riscv,hart-index-bits = <4>;
-			riscv,num-guest-ids = <511>;
+			riscv,num-guest-ids = <63>;
 			riscv,num-ids = <511>;
 		};
 
-- 
2.43.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

             reply	other threads:[~2026-08-17  3:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17  3:30 Guo Ren [this message]
2026-08-17  3:30 ` [PATCH V2] riscv: dts: spacemit: k3: fix IMSIC num-guest-ids Guo Ren
2026-08-17  8:50 ` Yixun Lan
2026-08-17  8:50   ` Yixun Lan
2026-08-17 14:29 ` Junhui Liu
2026-08-17 14:29   ` Junhui Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260817033038.2286436-1-guoren@kernel.org \
    --to=guoren@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@kernel.org \
    --cc=docular.xu@gmail.com \
    --cc=junhui.liu@pigmoral.tech \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=spacemit@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.