riscv: spacemit: Add SpacemiT K3 SoC and K3 Pico-ITX board
Subsystems (8)
v4 cover riscv: spacemit: Add SpacemiT K3 SoC and K3 Pico-ITX board
This series introduces basic support for the SpacemiT K3 SoC and the K3 Pico-ITX evaluation board.
This series (starting from v2) also adds descriptions about ISA extensions mandated by the RVA23 Profile Version 1.0 into riscv/extensions.yaml. There are extensive discussions about how to handle these new extensions in v2. In v3 (now v4), here is my best understading of what I think we have reached consensus on.
At v3, Samuel Holland shared his opinion regarding how "supm" should be handled [3]. He suggests removing "supm" from devicetrees not targeting U-mode. I did that in Patch 10/11 of v3 with k3.dtsi. Samuel also notes that "supm" could make sense as a binding for devicetrees targeting U-mode. Considering there are other changes suggested in [2] and [3], I would prefer to start a separate patchset dedicated to "supm".
Among others, major change in v4 is adding m-mode imsic and aplic nodes into k3.dtsi (Patch 10/11) to better represent the hardware.
Hi, Conor
For the binding riscv/extensions.ymal, here's what changed in v3 (no change in v4):
1. Dropped the patch of adding "supm" into extensions.yaml. At the same time, I will start another patchset which implements the strategy outlined by Conor in Link [2] and by Samuel in Link [3].
2. Dropped the dependency checks for "sha" on "h", "shcounterenw", and 6 others. "sha" implies these extensions, and it should be allowed to be declared independently. Like "a" implies "zaamo" and "zalrsc".
3. Enchanced the dependency check of "ziccamoa" on "a". Specifically,
- added the dependency check of "ziccamoa" on "zaamo" or on "a".
- added the dependency check of "za64rs" on "zalrsc" or on "a".
- added the dependency check of "ziccrse" on "zalrsc" or "a".
The commit message of this patch is updated too, to better explain the relationship between "ziccamoa", "za64rs", "ziccrse" and "a".
4. Enhanced checking dependency of "b" and "zba", "zbb", "zbs", making the dependency check in both directions, as discussed in [4]. Since "b" was ratified much later than its component extensions (zba/zbb/zbs), existing software and kernels expect these explicit strings. This bidirectional check ensures cores declaring "b" remain compatible with older software that only recognizes zba/zbb/zbs.
Thank you for your review.
Because the K3 uart compatible string patch (Patch 5 in v2) has been applied in tty.git, the entire series now rebased on top of linux-next,
tag: next-20260109.
The SpacemiT K3 is an SoC featuring 8 SpacemiT X100 RISC-V cores. The X100 is a 4-issue, out-of-order core compliant with the RVA23 profile, targeting high-performance scenarios. [1]
The K3 Pico-ITX is an evaluation board built around the K3 SoC.
From an RVA23 profile compliance perspective, the X100 supports all mandatory extensions required by RVA23U64 and RVA23S64.
Changes in v4:
- Patch 5:
Adjust maintainers list in alphabetic order.
Declare spacemit,k3-pico-itx as an enum, which could save future
code change when adding new boards.
- Patch 10:
Fix missing blank space after comma in simsic compatible. Add m-mode imsic and aplic nodes, per suggestion received from Samuel
Holland.
Adjust node properties order in nodes simsic, saplic, mimsic, maplic to
follow the DTS coding style.
- Link to v3: https://lore.kernel.org/r/[email protected]
Other Changes in v3 include:
- Patch 1:
Acked-by: Krzysztof Kozlowski
- Patch 4:
Acked-by: Krzysztof Kozlowski
- Dropped Patch 5 "dt-bindings: serial: 8250: add SpacemiT K3 UART compatible" as it has been applied to tty-next.
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Patch 1:
Fixed alphanumeric sorting order of compatible strings (swapped x100 and
x60) as per Krzysztof's feedback.
Update commit message with more information about X100 featurs per
Yixun's feedback.
- Patch 4:
Fixed the order to keep things alphabetically.
- Patch 6:
Use "one blank space" between name and email address.
- Patch 7 ~ 11:
New patches. Add description of RVA23 mandatory extensions into riscv
binding YAML file.
- Patch 12 (Patch 7 in v1):
Removed aliases node.
Updated 'riscv,isa-extensions' with new extension strings available
- Patch 13 (Patch 8 in v1):
Updated the memory address to the hardware truth.
Added aliases node in board dts.
- Patch 1,2,3,5: Add Reviewed-by and Acked-by collected.
Link to v1: https://lore.kernel.org/r/[email protected]
---
Guodong Xu (11):
dt-bindings: riscv: add SpacemiT X100 CPU compatible
dt-bindings: timer: add SpacemiT K3 CLINT
dt-bindings: interrupt-controller: add SpacemiT K3 APLIC
dt-bindings: interrupt-controller: add SpacemiT K3 IMSIC
dt-bindings: riscv: spacemit: add K3 and Pico-ITX board bindings
dt-bindings: riscv: Add B ISA extension description
dt-bindings: riscv: Add descriptions for Za64rs, Ziccamoa, Ziccif, and Zicclsm
dt-bindings: riscv: Add Ssccptr, Sscounterenw, Sstvala, Sstvecd, Ssu64xl
dt-bindings: riscv: Add Sha and its comprised extensions
riscv: dts: spacemit: add initial device tree of SpacemiT K3 SoC
riscv: dts: spacemit: add SpacemiT K3 Pico-ITX board device tree
.../bindings/interrupt-controller/riscv,aplic.yaml | 1 + .../interrupt-controller/riscv,imsics.yaml | 1 + Documentation/devicetree/bindings/riscv/cpus.yaml | 1 + .../devicetree/bindings/riscv/extensions.yaml | 169 ++++++ .../devicetree/bindings/riscv/spacemit.yaml | 5 + .../devicetree/bindings/timer/sifive,clint.yaml | 1 + arch/riscv/boot/dts/spacemit/Makefile | 1 + arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 38 ++ arch/riscv/boot/dts/spacemit/k3.dtsi | 590 +++++++++++++++++++++ 9 files changed, 807 insertions(+)
---
base-commit: 31d167f54de93f14fa8e4bc6cbc4adaf7019fd94
change-id: 20251216-k3-basic-dt-cd9540061989
Best regards,
Signature · 1 line
Guodong Xu <[email protected]>
PATCH v4 1/11 dt-bindings: riscv: add SpacemiT X100 CPU compatible
Add compatible string for the SpacemiT X100 core. [1]
The X100 is a 64-bit RVA23-compliant RISC-V core from SpacemiT. X100 supports the RISC-V vector and hypervisor extensions and all mandatory extersions as required by the RVA23U64 and RVA23S64 profiles, per the definition in 'RVA23 Profile, Version 1.0'. [2]
From a microarchieture viewpoint, the X100 features a 4-issue out-of-order pipeline.
X100 is used in SpacemiT K3 SoC.
---
v4: No change.
v3: Added Acked-by from Krzysztof.
v2: Fixed alphanumeric sorting of compatible strings, put x100 before x60,
as per Krzysztof's feedback.
Added reviewed-by from Yixun and Heinrich.
Updated the commit message to provide more information about X100.
--- Documentation/devicetree/bindings/riscv/cpus.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/riscv/cpus.yaml +1 -0
@@ -61,6 +61,7 @@ properties: - sifive,u7 - sifive,u74 - sifive,u74-mc + - spacemit,x100 - spacemit,x60 - thead,c906 - thead,c908
Signature · 1 line
2.43.0
Re: [PATCH v4 01/11] dt-bindings: riscv: add SpacemiT X100 CPU compatible
Quoted 10 lines · Guodong Xu
Add compatible string for the SpacemiT X100 core. [1]
The X100 is a 64-bit RVA23-compliant RISC-V core from SpacemiT. X100 supports the RISC-V vector and hypervisor extensions and all mandatory extersions as required by the RVA23U64 and RVA23S64 profiles, per the definition in 'RVA23 Profile, Version 1.0'. [2]
Quoted 1 line
From a microarchieture viewpoint, the X100 features a 4-issue
out-of-order pipeline.
Quoted 8 lines
X100 is used in SpacemiT K3 SoC.
Reviewed-by Yixun Lan <[email protected]>Reviewed-by Heinrich Schuchardt <[email protected]>Signed-off-by Guodong Xu <[email protected]>
(just for completeness, since I acked the older version)
- Paul
PATCH v4 2/11 dt-bindings: timer: add SpacemiT K3 CLINT
In reply to Guodong XuAdd compatible string for SpacemiT K3 CLINT.
---
v4: No change.
v3: No change.
v2: Add Conor's Acked-by.
--- Documentation/devicetree/bindings/timer/sifive,clint.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/timer/sifive,clint.yaml +1 -0
@@ -33,6 +33,7 @@ properties: - eswin,eic7700-clint # ESWIN EIC7700 - 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
Signature · 1 line
2.43.0
PATCH v4 3/11 dt-bindings: interrupt-controller: add SpacemiT K3 APLIC
In reply to Guodong XuAdd compatible string for SpacemiT K3 APLIC.
---
v4: No change.
v3: No change.
v2: Add Conor's Acked-by.
--- Documentation/devicetree/bindings/interrupt-controller/riscv,aplic.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/interrupt-controller/riscv,aplic.yaml +1 -0
@@ -28,6 +28,7 @@ properties: items: - enum: - qemu,aplic + - spacemit,k3-aplic - const: riscv,aplic reg:
Signature · 1 line
2.43.0
PATCH v4 4/11 dt-bindings: interrupt-controller: add SpacemiT K3 IMSIC
In reply to Guodong XuAdd compatible string for SpacemiT K3 IMSIC.
---
v4: No change.
v3: Add Acked-by from Krzysztof.
v2: Fix the order to keep things alphabetically.
--- Documentation/devicetree/bindings/interrupt-controller/riscv,imsics.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/interrupt-controller/riscv,imsics.yaml +1 -0
@@ -48,6 +48,7 @@ properties: items: - enum: - qemu,imsics + - spacemit,k3-imsics - const: riscv,imsics reg:
Signature · 1 line
2.43.0
PATCH v4 5/11 dt-bindings: riscv: spacemit: add K3 and Pico-ITX board bindings
In reply to Guodong XuAdd DT binding documentation for the SpacemiT K3 SoC and the board Pico-ITX which is a 2.5-inch single-board computer.
---
v4: Adjust maintainers list in alphabetic order.
Declare spacemit,k3-pico-itx as an enum, which can save future
code change when adding new boards.
v3: No change.
v2: Use one-blank-space between name and email address.
--- Documentation/devicetree/bindings/riscv/spacemit.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/riscv/spacemit.yaml +5 -0
@@ -7,6 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: SpacemiT SoC-based boards maintainers: + - Guodong Xu <[email protected]> - Yangyu Chen <[email protected]> - Yixun Lan <[email protected]>
@@ -26,6 +27,10 @@ properties: - xunlong,orangepi-r2s - xunlong,orangepi-rv2 - const: spacemit,k1 + - items: + - enum: + - spacemit,k3-pico-itx + - const: spacemit,k3 additionalProperties: true
Signature · 1 line
2.43.0
Re: [PATCH v4 05/11] dt-bindings: riscv: spacemit: add K3 and Pico-ITX board bindings
Hi Guodong,
Quoted 4 lines · Guodong Xu
Add DT binding documentation for the SpacemiT K3 SoC and the board Pico-ITX which is a 2.5-inch single-board computer.
Signed-off-by Guodong Xu <[email protected]>
Quoted 37 lines
---
v4: Adjust maintainers list in alphabetic order.
Declare spacemit,k3-pico-itx as an enum, which can save future
code change when adding new boards.
v3: No change.
v2: Use one-blank-space between name and email address.--- Documentation/devicetree/bindings/riscv/spacemit.yaml | 5 +++++ 1 file changed, 5 insertions(+)Documentation/devicetree/bindings/riscv/spacemit.yaml +5
-0@@ -7,6 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: SpacemiT SoC-based boards maintainers: + - Guodong Xu <[email protected]> - Yangyu Chen <[email protected]> - Yixun Lan <[email protected]>@@ -26,6 +27,10 @@ properties: - xunlong,orangepi-r2s - xunlong,orangepi-rv2 - const: spacemit,k1 + - items: + - enum: + - spacemit,k3-pico-itx + - const: spacemit,k3 additionalProperties: trueSignature · 2 lines
-- 2.43.0
Signature · 1 line
Yixun Lan (dlan)
Re: [PATCH v4 05/11] dt-bindings: riscv: spacemit: add K3 and Pico-ITX board bindings
In reply to Guodong XuQuoted 4 lines · Guodong Xu
Add DT binding documentation for the SpacemiT K3 SoC and the board Pico-ITX which is a 2.5-inch single-board computer.
Signed-off-by Guodong Xu <[email protected]>
PATCH v4 6/11 dt-bindings: riscv: Add B ISA extension description
In reply to Guodong XuAdd description of the single-letter B extension for Bit Manipulation. B is mandatory for RVA23U64.
The B extension is ratified in the 20240411 version of the unprivileged ISA specification. According to the ratified spec, the B standard extension comprises instructions provided by the Zba, Zbb, and Zbs extensions.
Add two-way dependency check to enforce that B implies Zba/Zbb/Zbs; and when Zba/Zbb/Zbs (all of them) are specified, then B must be added too.
The reason why B/Zba/Zbb/Zbs must coexist at the same time is that unlike other single-letter extensions, B was ratified (Apr/2024) much later than its component extensions Zba/Zbb/Zbs (Jun/2021).
When "b" is specified, zba/zbb/zbs must be present to ensure backward compatibility with existing software and kernels that only look for the explicit component strings.
When all three components zba/zbb/zbs are specified, "b" should also be present. Making "b" mandatory when all three components are present.
Existing devicetrees with zba/zbb/zbs but without "b" will generate warnings that can be fixed in follow-up patches.
---
v4: No change.
v3: Update the commit message to explain the retionale why B and
Zba/Zbb/Zbs should all exist in DT.
v2: New patch.
--- .../devicetree/bindings/riscv/extensions.yaml | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +31 -0
@@ -109,6 +109,13 @@ properties: The standard C extension for compressed instructions, as ratified in the 20191213 version of the unprivileged ISA specification. + - const: b + description: + The standard B extension for bit manipulation instructions, as + ratified in the 20240411 version of the unprivileged ISA + specification. The B standard extension comprises instructions + provided by the Zba, Zbb, and Zbs extensions. + - const: v description: The standard V extension for vector operations, as ratified
@@ -752,6 +759,30 @@ properties: then: contains: const: f + # B comprises Zba, Zbb, and Zbs + - if: + contains: + const: b + then: + allOf: + - contains: + const: zba + - contains: + const: zbb + - contains: + const: zbs + # Zba, Zbb, Zbs together require B + - if: + allOf: + - contains: + const: zba + - contains: + const: zbb + - contains: + const: zbs + then: + contains: + const: b # Zcb depends on Zca - if: contains:
Signature · 1 line
2.43.0
Re: [PATCH v4 06/11] dt-bindings: riscv: Add B ISA extension description
Quoted 19 lines · Guodong Xu
Add description of the single-letter B extension for Bit Manipulation. B is mandatory for RVA23U64.
The B extension is ratified in the 20240411 version of the unprivileged ISA specification. According to the ratified spec, the B standard extension comprises instructions provided by the Zba, Zbb, and Zbs extensions.
Add two-way dependency check to enforce that B implies Zba/Zbb/Zbs; and when Zba/Zbb/Zbs (all of them) are specified, then B must be added too.
The reason why B/Zba/Zbb/Zbs must coexist at the same time is that unlike other single-letter extensions, B was ratified (Apr/2024) much later than its component extensions Zba/Zbb/Zbs (Jun/2021).
When "b" is specified, zba/zbb/zbs must be present to ensure backward compatibility with existing software and kernels that only look for the explicit component strings.
Quoted 5 lines
When all three components zba/zbb/zbs are specified, "b" should also be present. Making "b" mandatory when all three components are present.
Existing devicetrees with zba/zbb/zbs but without "b" will generate warnings that can be fixed in follow-up patches.
Are you going to send these fixup patches for other devicetrees? The majority appear to be other spacemit devices.
Re: [PATCH v4 06/11] dt-bindings: riscv: Add B ISA extension description
Hi, Conor
Quoted 21 lines · Conor Dooley
Quoted 19 lines · Guodong Xu
Add description of the single-letter B extension for Bit Manipulation. B is mandatory for RVA23U64.
The B extension is ratified in the 20240411 version of the unprivileged ISA specification. According to the ratified spec, the B standard extension comprises instructions provided by the Zba, Zbb, and Zbs extensions.
Add two-way dependency check to enforce that B implies Zba/Zbb/Zbs; and when Zba/Zbb/Zbs (all of them) are specified, then B must be added too.
The reason why B/Zba/Zbb/Zbs must coexist at the same time is that unlike other single-letter extensions, B was ratified (Apr/2024) much later than its component extensions Zba/Zbb/Zbs (Jun/2021).
When "b" is specified, zba/zbb/zbs must be present to ensure backward compatibility with existing software and kernels that only look for the explicit component strings.
Quoted 8 lines
Quoted 5 lines
When all three components zba/zbb/zbs are specified, "b" should also be present. Making "b" mandatory when all three components are present.
Existing devicetrees with zba/zbb/zbs but without "b" will generate warnings that can be fixed in follow-up patches.
Are you going to send these fixup patches for other devicetrees? The majority appear to be other spacemit devices.
Yes, I will. My check shows that these three dtsi files need to be updated to include the newly ratified "b" extension:
arch/riscv/boot/dts/anlogic/dr1v90.dtsiarch/riscv/boot/dts/sophgo/sg2044-cpus.dtsiarch/riscv/boot/dts/spacemit/k1.dtsi
I will start a follow up patch to update these dtsi files. Basically, adding "b" into both the "riscv,isa-extensions" and "riscv,isa" (when available) fields.
Thank you for your review.
Best regards,
Guodong Xu
PATCH v4 7/11 dt-bindings: riscv: Add descriptions for Za64rs, Ziccamoa, Ziccif, and Zicclsm
In reply to Guodong XuAdd descriptions for four extensions: Za64rs, Ziccamoa, Ziccif, and Zicclsm. These extensions are ratified in RISC-V Profiles Version 1.0 (commit b1d806605f87 "Updated to ratified state.").
They are introduced as new extension names for existing features and regulate implementation details for RISC-V Profile compliance. According to RISC-V Profiles Version 1.0 and RVA23 Profiles Version 1.0, they are mandatory for the following profiles:
- za64rs: Mandatory in RVA22U64, RVA23U64
- ziccamoa: Mandatory in RVA20U64, RVA22U64, RVA23U64
- ziccif: Mandatory in RVA20U64, RVA22U64, RVA23U64
- zicclsm: Mandatory in RVA20U64, RVA22U64, RVA23U64
Ziccrse specifies the main memory must support "RsrvEventual", which is one (totally there are four) of the support level for Load-Reserved/ Store-Conditional (LR/SC) atomic instructions. Thus it depends on Zalrsc.
Ziccamoa specifies the main memory must support AMOArithmetic, among the four levels of PMA support defined for AMOs in the A extension. Thus it depends on Zaamo.
Za64rs defines reservation sets are contiguous, naturally aligned, and a maximum of 64 bytes. Za64rs is consumed by two extensions: Zalrsc and Zawrs. Zawrs itself depends on Zalrsc too.
Based on the relationship that "A" = Zaamo + Zalrsc, add the following dependencies checks:
Za64rs -> Zalrsc or A
Ziccrse -> Zalrsc or A
Ziccamoa -> Zaamo or A
---
v4: No change.
v3: Update the commit message to explain the relationship of Za64rs,
Ziccrse, Ziccamoa, Zalrsc and A.
Add dependency checks.
v2: New patch.
--- .../devicetree/bindings/riscv/extensions.yaml | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +49 -0
@@ -240,6 +240,12 @@ properties: as ratified at commit 4a69197e5617 ("Update to ratified state") of riscv-svvptc. + - const: za64rs + description: + The standard Za64rs extension for reservation set size of at most + 64 bytes, as ratified in RISC-V Profiles Version 1.0, with commit + b1d806605f87 ("Updated to ratified state.") + - const: zaamo description: | The standard Zaamo extension for atomic memory operations as
@@ -381,6 +387,27 @@ properties: in commit 64074bc ("Update version numbers for Zfh/Zfinx") of riscv-isa-manual. + - const: ziccamoa + description: + The standard Ziccamoa extension for main memory (cacheability and + coherence) must support all atomics in A, as ratified in RISC-V + Profiles Version 1.0, with commit b1d806605f87 ("Updated to + ratified state.") + + - const: ziccif + description: + The standard Ziccif extension for main memory (cacheability and + coherence) instruction fetch atomicity, as ratified in RISC-V + Profiles Version 1.0, with commit b1d806605f87 ("Updated to + ratified state.") + + - const: zicclsm + description: + The standard Zicclsm extension for main memory (cacheability and + coherence) must support misaligned loads and stores, as ratified + in RISC-V Profiles Version 1.0, with commit b1d806605f87 ("Updated + to ratified state.") + - const: ziccrse description: The standard Ziccrse extension which provides forward progress
@@ -783,6 +810,18 @@ properties: then: contains: const: b + # Za64rs and Ziccrse depend on Zalrsc or A + - if: + contains: + anyOf: + - const: za64rs + - const: ziccrse + then: + oneOf: + - contains: + const: zalrsc + - contains: + const: a # Zcb depends on Zca - if: contains:
@@ -824,6 +863,16 @@ properties: then: contains: const: f + # Ziccamoa depends on Zaamo or A + - if: + contains: + const: ziccamoa + then: + oneOf: + - contains: + const: zaamo + - contains: + const: a # Zvfbfmin depends on V or Zve32f - if: contains:
Signature · 1 line
2.43.0
Re: [PATCH v4 07/11] dt-bindings: riscv: Add descriptions for Za64rs, Ziccamoa, Ziccif, and Zicclsm
PATCH v4 8/11 dt-bindings: riscv: Add Ssccptr, Sscounterenw, Sstvala, Sstvecd, Ssu64xl
In reply to Guodong XuAdd descriptions for five new extensions: Ssccptr, Sscounterenw, Sstvala, Sstvecd, and Ssu64xl. These extensions are ratified in RISC-V Profiles Version 1.0 (commit b1d806605f87 "Updated to ratified state.").
They are introduced as new extension names for existing features and regulate implementation details for RISC-V Profile compliance. According to RISC-V Profiles Version 1.0 and RVA23 Profiles Version 1.0, their requirement status are:
- Ssccptr: Mandatory in RVA20S64, RVA22S64, RVA23S64
- Sscounterenw: Mandatory in RVA22S64, RVA23S64
- Sstvala: Mandatory in RVA20S64, RVA22S64, RVA23S64
- Sstvecd: Mandatory in RVA20S64, RVA22S64, RVA23S64
- Ssu64xl: Optional in RVA20S64, RVA22S64; Mandatory in RVA23S64
---
v4: No change.
v3: No change.
v2: New patch.
--- .../devicetree/bindings/riscv/extensions.yaml | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +32 -0
@@ -161,12 +161,26 @@ properties: behavioural changes to interrupts as frozen at commit ccbddab ("Merge pull request #42 from riscv/jhauser-2023-RC4") of riscv-aia. + - const: ssccptr + description: | + The standard Ssccptr extension for main memory (cacheability and + coherence) hardware page-table reads, as ratified in RISC-V + Profiles Version 1.0, with commit b1d806605f87 ("Updated to + ratified state.") + - const: sscofpmf description: | The standard Sscofpmf supervisor-level extension for count overflow and mode-based filtering as ratified at commit 01d1df0 ("Add ability to manually trigger workflow. (#2)") of riscv-count-overflow. + - const: sscounterenw + description: | + The standard Sscounterenw extension for support writable enables + in scounteren for any supported counter, as ratified in RISC-V + Profiles Version 1.0, with commit b1d806605f87 ("Updated to + ratified state.") + - const: ssnpm description: | The standard Ssnpm extension for next-mode pointer masking as
@@ -179,6 +193,24 @@ properties: ratified at commit 3f9ed34 ("Add ability to manually trigger workflow. (#2)") of riscv-time-compare. + - const: sstvala + description: | + The standard Sstvala extension for stval provides all needed values + as ratified in RISC-V Profiles Version 1.0, with commit b1d806605f87 + ("Updated to ratified state.") + + - const: sstvecd + description: | + The standard Sstvecd extension for stvec supports Direct mode as + ratified in RISC-V Profiles Version 1.0, with commit b1d806605f87 + ("Updated to ratified state.") + + - const: ssu64xl + description: | + The standard Ssu64xl extension for UXLEN=64 must be supported, as + ratified in RISC-V Profiles Version 1.0, with commit b1d806605f87 + ("Updated to ratified state.") + - const: svade description: | The standard Svade supervisor-level extension for SW-managed PTE A/D
Signature · 1 line
2.43.0
Re: [PATCH v4 08/11] dt-bindings: riscv: Add Ssccptr, Sscounterenw, Sstvala, Sstvecd, Ssu64xl
PATCH v4 9/11 dt-bindings: riscv: Add Sha and its comprised extensions
In reply to Guodong XuAdd descriptions for the Sha extension and the seven extensions it
comprises: Shcounterenw, Shgatpa, Shtvala, Shvsatpa, Shvstvala, Shvstvecd, and Ssstateen.
Sha is ratified in the RVA23 Profiles Version 1.0 (commit 0273f3c921b6 "rva23/rvb23 ratified") as a new profile-defined extension that captures the full set of features that are mandated to be supported along with the H extension.
Extensions Shcounterenw, Shgatpa, Shtvala, Shvsatpa, Shvstvala, Shvstvecd, and Ssstateen are ratified in the RISC-V Profiles Version 1.0 (commit b1d806605f87 "Updated to ratified state").
The requirement status for Sha and its comprised extension in RISC-V Profiles are:
- Sha: Mandatory in RVA23S64
- H: Optional in RVA22S64; Mandatory in RVA23S64
- Shcounterenw: Optional in RVA22S64; Mandatory in RVA23S64
- Shgatpa: Optional in RVA22S64; Mandatory in RVA23S64
- Shtvala: Optional in RVA22S64; Mandatory in RVA23S64
- Shvsatpa: Optional in RVA22S64; Mandatory in RVA23S64
- Shvstvala: Optional in RVA22S64; Mandatory in RVA23S64
- Shvstvecd: Optional in RVA22S64; Mandatory in RVA23S64
- Ssstateen: Optional in RVA22S64; Mandatory in RVA23S64
---
v4: No change.
v3: Drop dependency check for Sha. Both Sha and the extensions it
implies are allowed to co-exist in DT.
v2: New patch.
--- .../devicetree/bindings/riscv/extensions.yaml | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +57 -0
@@ -129,6 +129,57 @@ properties: Document Version 20211203. # multi-letter extensions, sorted alphanumerically + - const: sha + description: | + The standard Sha extension for augmented hypervisor extension as + ratified in RVA23 Profiles Version 1.0, with commit 0273f3c921b6 + ("rva23/rvb23 ratified"). + + Sha captures the full set of features that are mandated to be + supported along with the H extension. Sha comprises the following + extensions: H, Shcounterenw, Shgatpa, Shtvala, Shvsatpa, Shvstvala, + Shvstvecd, and Ssstateen. + + - const: shcounterenw + description: | + The standard Shcounterenw extension for support writable enables + in hcounteren for any supported counter, as ratified in RISC-V + Profiles Version 1.0, with commit b1d806605f87 ("Updated to + ratified state.") + + - const: shgatpa + description: | + The standard Shgatpa extension indicates that for each supported + virtual memory scheme SvNN supported in satp, the corresponding + hgatp SvNNx4 mode must be supported. The hgatp mode Bare must + also be supported. It is ratified in RISC-V Profiles Version 1.0, + with commit b1d806605f87 ("Updated to ratified state.") + + - const: shtvala + description: | + The standard Shtvala extension for htval be written with the + faulting guest physical address in all circumstances permitted by + the ISA. It is ratified in RISC-V Profiles Version 1.0, with + commit b1d806605f87 ("Updated to ratified state.") + + - const: shvsatpa + description: | + The standard Shvsatpa extension for vsatp supporting all translation + modes supported in satp, as ratified in RISC-V Profiles Version 1.0, + with commit b1d806605f87 ("Updated to ratified state.") + + - const: shvstvala + description: | + The standard Shvstvala extension for vstval provides all needed + values as ratified in RISC-V Profiles Version 1.0, with commit + b1d806605f87 ("Updated to ratified state.") + + - const: shvstvecd + description: | + The standard Shvstvecd extension for vstvec supporting Direct mode, + as ratified in RISC-V Profiles Version 1.0, with commit b1d806605f87 + ("Updated to ratified state.") + - const: smaia description: | The standard Smaia supervisor-level extension for the advanced
@@ -187,6 +238,12 @@ properties: ratified at commit d70011dde6c2 ("Update to ratified state") of riscv-j-extension. + - const: ssstateen + description: | + The standard Ssstateen extension for supervisor-mode view of the + state-enable extension, as ratified in RISC-V Profiles Version 1.0, + with commit b1d806605f87 ("Updated to ratified state.") + - const: sstc description: | The standard Sstc supervisor-level extension for time compare as
Signature · 1 line
2.43.0
Re: [PATCH v4 09/11] dt-bindings: riscv: Add Sha and its comprised extensions
Quoted 25 lines · Guodong Xu
Add descriptions for the Sha extension and the seven extensions it
comprises: Shcounterenw, Shgatpa, Shtvala, Shvsatpa, Shvstvala, Shvstvecd, and Ssstateen.Sha is ratified in the RVA23 Profiles Version 1.0 (commit
0273f3c921b6"rva23/rvb23 ratified") as a new profile-defined extension that captures the full set of features that are mandated to be supported along with the H extension.Extensions Shcounterenw, Shgatpa, Shtvala, Shvsatpa, Shvstvala, Shvstvecd, and Ssstateen are ratified in the RISC-V Profiles Version 1.0 (commit
b1d806605f87"Updated to ratified state").The requirement status for Sha and its comprised extension in RISC-V Profiles are:
- Sha: Mandatory in RVA23S64
- H: Optional in RVA22S64; Mandatory in RVA23S64
- Shcounterenw: Optional in RVA22S64; Mandatory in RVA23S64
- Shgatpa: Optional in RVA22S64; Mandatory in RVA23S64
- Shtvala: Optional in RVA22S64; Mandatory in RVA23S64
- Shvsatpa: Optional in RVA22S64; Mandatory in RVA23S64
- Shvstvala: Optional in RVA22S64; Mandatory in RVA23S64
- Shvstvecd: Optional in RVA22S64; Mandatory in RVA23S64
- Ssstateen: Optional in RVA22S64; Mandatory in RVA23S64
Quoted 1 line
Signed-off-by Guodong Xu <[email protected]>
PATCH v4 10/11 riscv: dts: spacemit: add initial device tree of SpacemiT K3 SoC
In reply to Guodong XuSpacemiT K3 is equipped with 8 X100 cores, which are RVA23 compliant. Add nodes of uarts, timer and interrupt-controllers.
---
v4: Fix missing blank space after commas in compatible string.
Add m-mode imsic and aplic node.
Reorder properties in simsic, saplic, mimsic, and maplic nodes
to match DTS coding style.
v3: Remove "supm" from the riscv,isa-extensions list.
v2: Remove aliases from k3.dtsi, they should be in board DTS.
Updated riscv,isa-extensions with new extensions from the extensions.yaml.
--- arch/riscv/boot/dts/spacemit/k3.dtsi | 590 +++++++++++++++++++++++++++++++++++ 1 file changed, 590 insertions(+)
arch/riscv/boot/dts/spacemit/k3.dtsi new file +590 -0
@@ -0,0 +1,590 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (c) 2025 SpacemiT (Hangzhou) Technology Co. Ltd + * Copyright (c) 2025 Guodong Xu <[email protected]> + */ + +#include <dt-bindings/interrupt-controller/irq.h> + +/dts-v1/; + +/ { + #address-cells = <2>; + #size-cells = <2>; + model = "SpacemiT K3"; + compatible = "spacemit,k3"; + + cpus: cpus { + #address-cells = <1>; + #size-cells = <0>; + timebase-frequency = <24000000>; + + cpu_0: cpu@0 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <0>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache0>; + mmu-type = "riscv,sv39"; + + cpu0_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_1: cpu@1 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <1>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache0>; + mmu-type = "riscv,sv39"; + + cpu1_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_2: cpu@2 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <2>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache0>; + mmu-type = "riscv,sv39"; + + cpu2_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_3: cpu@3 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <3>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache0>; + mmu-type = "riscv,sv39"; + + cpu3_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_4: cpu@4 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <4>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache1>; + mmu-type = "riscv,sv39"; + + cpu4_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_5: cpu@5 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <5>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache1>; + mmu-type = "riscv,sv39"; + + cpu5_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_6: cpu@6 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <6>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache1>; + mmu-type = "riscv,sv39"; + + cpu6_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_7: cpu@7 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <7>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache1>; + mmu-type = "riscv,sv39"; + + cpu7_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + l2_cache0: cache-controller-0 { + compatible = "cache"; + cache-block-size = <64>; + cache-level = <2>; + cache-size = <4194304>; + cache-sets = <4096>; + cache-unified; + }; + + l2_cache1: cache-controller-1 { + compatible = "cache"; + cache-block-size = <64>; + cache-level = <2>; + cache-size = <4194304>; + cache-sets = <4096>; + cache-unified; + }; + + cpu-map { + cluster0 { + core0 { + cpu = <&cpu_0>; + }; + core1 { + cpu = <&cpu_1>; + }; + core2 { + cpu = <&cpu_2>; + }; + core3 { + cpu = <&cpu_3>; + }; + }; + + cluster1 { + core0 { + cpu = <&cpu_4>; + }; + core1 { + cpu = <&cpu_5>; + }; + core2 { + cpu = <&cpu_6>; + }; + core3 { + cpu = <&cpu_7>; + }; + }; + }; + }; + + soc: soc { + compatible = "simple-bus"; + interrupt-parent = <&saplic>; + #address-cells = <2>; + #size-cells = <2>; + dma-noncoherent; + ranges; + + uart0: serial@d4017000 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017000 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <42 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart2: serial@d4017100 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017100 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <44 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart3: serial@d4017200 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017200 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <45 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart4: serial@d4017300 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017300 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <46 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart5: serial@d4017400 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017400 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <47 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart6: serial@d4017500 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017500 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <48 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart7: serial@d4017600 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017600 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <49 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart8: serial@d4017700 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017700 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <50 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart9: serial@d4017800 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017800 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <51 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart10: serial@d401f000 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd401f000 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <281 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + simsic: interrupt-controller@e0400000 { + compatible = "spacemit,k3-imsics", "riscv,imsics"; + reg = <0x0 0xe0400000 0x0 0x200000>; + #interrupt-cells = <0>; + #msi-cells = <0>; + interrupt-controller; + interrupts-extended = <&cpu0_intc 9>, <&cpu1_intc 9>, + <&cpu2_intc 9>, <&cpu3_intc 9>, + <&cpu4_intc 9>, <&cpu5_intc 9>, + <&cpu6_intc 9>, <&cpu7_intc 9>; + msi-controller; + riscv,guest-index-bits = <6>; + riscv,hart-index-bits = <4>; + riscv,num-guest-ids = <511>; + riscv,num-ids = <511>; + }; + + saplic: interrupt-controller@e0804000 { + compatible = "spacemit,k3-aplic", "riscv,aplic"; + reg = <0x0 0xe0804000 0x0 0x4000>; + #interrupt-cells = <2>; + interrupt-controller; + msi-parent = <&simsic>; + 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>; + }; + + mimsic: interrupt-controller@f1000000 { + compatible = "spacemit,k3-imsics", "riscv,imsics"; + reg = <0x0 0xf1000000 0x0 0x10000>; + #interrupt-cells = <0>; + #msi-cells = <0>; + interrupt-controller; + interrupts-extended = <&cpu0_intc 11>, <&cpu1_intc 11>, + <&cpu2_intc 11>, <&cpu3_intc 11>, + <&cpu4_intc 11>, <&cpu5_intc 11>, + <&cpu6_intc 11>, <&cpu7_intc 11>; + msi-controller; + riscv,guest-index-bits = <6>; + riscv,hart-index-bits = <4>; + riscv,num-guest-ids = <511>; + riscv,num-ids = <511>; + + status = "disabled"; + }; + + maplic: interrupt-controller@f1800000 { + compatible = "spacemit,k3-aplic", "riscv,aplic"; + reg = <0x0 0xf1800000 0x0 0x4000>; + #interrupt-cells = <2>; + interrupt-controller; + msi-parent = <&mimsic>; + riscv,children = <&saplic>; + riscv,delegate = <&saplic 1 512>; + riscv,num-sources = <512>; + + status = "disabled"; + }; + }; +};
Signature · 1 line
2.43.0
Re: [PATCH v4 10/11] riscv: dts: spacemit: add initial device tree of SpacemiT K3 SoC
Quoted 67 lines · Guodong Xu
SpacemiT K3 is equipped with 8 X100 cores, which are RVA23 compliant. Add nodes of uarts, timer and interrupt-controllers.
Signed-off-by Guodong Xu <[email protected]>---
v4: Fix missing blank space after commas in compatible string.
Add m-mode imsic and aplic node.
Reorder properties in simsic, saplic, mimsic, and maplic nodes
to match DTS coding style.
v3: Remove "supm" from the riscv,isa-extensions list.
v2: Remove aliases fromk3.dtsi, they should be in board DTS.
Updated riscv,isa-extensions with new extensions from theextensions.yaml.--- arch/riscv/boot/dts/spacemit/k3.dtsi | 590 +++++++++++++++++++++++++++++++++++ 1 file changed, 590 insertions(+)arch/riscv/boot/dts/spacemit/k3.dtsi new file +45
-0@@ -0,0 +1,590 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (c) 2025 SpacemiT (Hangzhou) Technology Co. Ltd + * Copyright (c) 2025 Guodong Xu <[email protected]> + */ + +#include <dt-bindings/interrupt-controller/irq.h> + +/dts-v1/; + +/ { + #address-cells = <2>; + #size-cells = <2>; + model = "SpacemiT K3"; + compatible = "spacemit,k3"; + + cpus: cpus { + #address-cells = <1>; + #size-cells = <0>; + timebase-frequency = <24000000>; + + cpu_0: cpu@0 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <0>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>;
arch/riscv/boot/dts/spacemit/k3.dtsi line 54
Quoted 10 lines
arch/riscv/boot/dts/spacemit/k3.dtsi new file +9
-0+ riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache0>; + mmu-type = "riscv,sv39";
I think this should be riscv,sv48? IIRC K3 supports it.
Regards,
Inochi
Quoted 541 lines
arch/riscv/boot/dts/spacemit/k3.dtsi new file +536
-0+ + cpu0_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_1: cpu@1 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <1>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache0>; + mmu-type = "riscv,sv39"; + + cpu1_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_2: cpu@2 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <2>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache0>; + mmu-type = "riscv,sv39"; + + cpu2_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_3: cpu@3 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <3>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache0>; + mmu-type = "riscv,sv39"; + + cpu3_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_4: cpu@4 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <4>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache1>; + mmu-type = "riscv,sv39"; + + cpu4_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_5: cpu@5 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <5>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache1>; + mmu-type = "riscv,sv39"; + + cpu5_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_6: cpu@6 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <6>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache1>; + mmu-type = "riscv,sv39"; + + cpu6_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + cpu_7: cpu@7 { + compatible = "spacemit,x100", "riscv"; + device_type = "cpu"; + reg = <7>; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "f", "d", "c", "b", "v", "h", + "sha", "shcounterenw", "shgatpa", "shtvala", + "shvsatpa", "shvstvala", "shvstvecd", "smaia", + "smstateen", "ssaia", "ssccptr", "sscofpmf", + "sscounterenw", "ssnpm", "ssstateen", "sstc", + "sstvala", "sstvecd", "ssu64xl", "svade", + "svinval", "svnapot", "svpbmt", "za64rs", + "zawrs", "zba", "zbb", "zbc", "zbs", "zca", + "zcb", "zcd", "zcmop", "zfa", "zfbfmin", + "zfh", "zfhmin", "zicbom", "zicbop", "zicboz", + "ziccamoa", "ziccif", "zicclsm", "zicntr", + "zicond", "zicsr", "zifencei", "zihintntl", + "zihintpause", "zihpm", "zimop", "zkt", "zvbb", + "zvbc", "zvfbfmin", "zvfbfwma", "zvfh", + "zvfhmin", "zvkb", "zvkg", "zvkn", "zvknc", + "zvkned", "zvkng", "zvknha", "zvknhb", "zvks", + "zvksc", "zvksed", "zvksg", "zvksh", "zvkt"; + riscv,cbom-block-size = <64>; + riscv,cbop-block-size = <64>; + riscv,cboz-block-size = <64>; + i-cache-block-size = <64>; + i-cache-size = <65536>; + i-cache-sets = <256>; + d-cache-block-size = <64>; + d-cache-size = <65536>; + d-cache-sets = <256>; + next-level-cache = <&l2_cache1>; + mmu-type = "riscv,sv39"; + + cpu7_intc: interrupt-controller { + compatible = "riscv,cpu-intc"; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + l2_cache0: cache-controller-0 { + compatible = "cache"; + cache-block-size = <64>; + cache-level = <2>; + cache-size = <4194304>; + cache-sets = <4096>; + cache-unified; + }; + + l2_cache1: cache-controller-1 { + compatible = "cache"; + cache-block-size = <64>; + cache-level = <2>; + cache-size = <4194304>; + cache-sets = <4096>; + cache-unified; + }; + + cpu-map { + cluster0 { + core0 { + cpu = <&cpu_0>; + }; + core1 { + cpu = <&cpu_1>; + }; + core2 { + cpu = <&cpu_2>; + }; + core3 { + cpu = <&cpu_3>; + }; + }; + + cluster1 { + core0 { + cpu = <&cpu_4>; + }; + core1 { + cpu = <&cpu_5>; + }; + core2 { + cpu = <&cpu_6>; + }; + core3 { + cpu = <&cpu_7>; + }; + }; + }; + }; + + soc: soc { + compatible = "simple-bus"; + interrupt-parent = <&saplic>; + #address-cells = <2>; + #size-cells = <2>; + dma-noncoherent; + ranges; + + uart0: serial@d4017000 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017000 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <42 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart2: serial@d4017100 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017100 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <44 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart3: serial@d4017200 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017200 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <45 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart4: serial@d4017300 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017300 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <46 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart5: serial@d4017400 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017400 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <47 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart6: serial@d4017500 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017500 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <48 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart7: serial@d4017600 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017600 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <49 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart8: serial@d4017700 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017700 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <50 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart9: serial@d4017800 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd4017800 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <51 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + uart10: serial@d401f000 { + compatible = "spacemit,k3-uart", "intel,xscale-uart"; + reg = <0x0 0xd401f000 0x0 0x100>; + reg-shift = <2>; + reg-io-width = <4>; + clock-frequency = <14700000>; + interrupts = <281 IRQ_TYPE_LEVEL_HIGH>; + + status = "disabled"; + }; + + simsic: interrupt-controller@e0400000 { + compatible = "spacemit,k3-imsics", "riscv,imsics"; + reg = <0x0 0xe0400000 0x0 0x200000>; + #interrupt-cells = <0>; + #msi-cells = <0>; + interrupt-controller; + interrupts-extended = <&cpu0_intc 9>, <&cpu1_intc 9>, + <&cpu2_intc 9>, <&cpu3_intc 9>, + <&cpu4_intc 9>, <&cpu5_intc 9>, + <&cpu6_intc 9>, <&cpu7_intc 9>; + msi-controller; + riscv,guest-index-bits = <6>; + riscv,hart-index-bits = <4>; + riscv,num-guest-ids = <511>; + riscv,num-ids = <511>; + }; + + saplic: interrupt-controller@e0804000 { + compatible = "spacemit,k3-aplic", "riscv,aplic"; + reg = <0x0 0xe0804000 0x0 0x4000>; + #interrupt-cells = <2>; + interrupt-controller; + msi-parent = <&simsic>; + 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>; + }; + + mimsic: interrupt-controller@f1000000 { + compatible = "spacemit,k3-imsics", "riscv,imsics"; + reg = <0x0 0xf1000000 0x0 0x10000>; + #interrupt-cells = <0>; + #msi-cells = <0>; + interrupt-controller; + interrupts-extended = <&cpu0_intc 11>, <&cpu1_intc 11>, + <&cpu2_intc 11>, <&cpu3_intc 11>, + <&cpu4_intc 11>, <&cpu5_intc 11>, + <&cpu6_intc 11>, <&cpu7_intc 11>; + msi-controller; + riscv,guest-index-bits = <6>; + riscv,hart-index-bits = <4>; + riscv,num-guest-ids = <511>; + riscv,num-ids = <511>; + + status = "disabled"; + }; + + maplic: interrupt-controller@f1800000 { + compatible = "spacemit,k3-aplic", "riscv,aplic"; + reg = <0x0 0xf1800000 0x0 0x4000>; + #interrupt-cells = <2>; + interrupt-controller; + msi-parent = <&mimsic>; + riscv,children = <&saplic>; + riscv,delegate = <&saplic 1 512>; + riscv,num-sources = <512>; + + status = "disabled"; + }; + }; +};Signature · 2 lines
-- 2.43.0
Re: [PATCH v4 10/11] riscv: dts: spacemit: add initial device tree of SpacemiT K3 SoC
Hi Guodong,
Quoted 23 lines · Inochi Amaoto
Quoted 22 lines · Guodong Xu
SpacemiT K3 is equipped with 8 X100 cores, which are RVA23 compliant. Add nodes of uarts, timer and interrupt-controllers.
Signed-off-by Guodong Xu <[email protected]>---
v4: Fix missing blank space after commas in compatible string.
Add m-mode imsic and aplic node.
Reorder properties in simsic, saplic, mimsic, and maplic nodes
to match DTS coding style.
v3: Remove "supm" from the riscv,isa-extensions list.
v2: Remove aliases fromk3.dtsi, they should be in board DTS.
Updated riscv,isa-extensions with new extensions from theextensions.yaml.--- arch/riscv/boot/dts/spacemit/k3.dtsi | 590 +++++++++++++++++++++++++++++++++++ 1 file changed, 590 insertions(+)arch/riscv/boot/dts/spacemit/k3.dtsi new file +0
-0@@ -0,0 +1,590 @@
...
Quoted 7 lines
arch/riscv/boot/dts/spacemit/k3.dtsi line 54
Quoted 4 lines
arch/riscv/boot/dts/spacemit/k3.dtsi new file +3
-0+ d-cache-sets = <256>; + next-level-cache = <&l2_cache0>; + mmu-type = "riscv,sv39";I think this should be riscv,sv48? IIRC K3 supports it.
I would second the idea here, if the underlying hardware support sv48, there is no reason we should limit it in DTS, DT should reflect the actual hardware.. if user still prefer to use sv39 for simplicity, a "no4lvl" command line argument can be passed.. see
arch/riscv/mm/init.c +860 -> set_satp_mode()
Signature · 1 line
Yixun Lan (dlan)
Re: [PATCH v4 10/11] riscv: dts: spacemit: add initial device tree of SpacemiT K3 SoC
Hi, Yixun and Inochi
Quoted 21 lines · Yixun Lan
Hi Guodong,
Quoted 17 lines · Inochi Amaoto
Quoted 16 lines · Guodong Xu
SpacemiT K3 is equipped with 8 X100 cores, which are RVA23 compliant. Add nodes of uarts, timer and interrupt-controllers.
Signed-off-by Guodong Xu <[email protected]>---
v4: Fix missing blank space after commas in compatible string.
Add m-mode imsic and aplic node.
Reorder properties in simsic, saplic, mimsic, and maplic nodes
to match DTS coding style.
v3: Remove "supm" from the riscv,isa-extensions list.
v2: Remove aliases fromk3.dtsi, they should be in board DTS.
Updated riscv,isa-extensions with new extensions from theextensions.yaml.--- arch/riscv/boot/dts/spacemit/k3.dtsi | 590 +++++++++++++++++++++++++++++++++++ 1 file changed, 590 insertions(+)
Quoted 13 lines
Quoted 6 lines
Quoted 6 lines
arch/riscv/boot/dts/spacemit/k3.dtsi new file +0
-0@@ -0,0 +1,590 @@...
Quoted 6 lines
arch/riscv/boot/dts/spacemit/k3.dtsi line 54
Quoted 4 lines
arch/riscv/boot/dts/spacemit/k3.dtsi new file +3
-0+ d-cache-sets = <256>; + next-level-cache = <&l2_cache0>; + mmu-type = "riscv,sv39";I think this should be riscv,sv48? IIRC K3 supports it.
You are right that the underlying X100 IP core is capable of supporting both SV39 and SV48. However, not K3.
Quoted 6 lines
Quoted 1 line
I would second the idea here, if the underlying hardware support sv48, there is no reason we should limit it in DTS, DT should reflect the actual hardware.. if user still prefer to use sv39 for simplicity, a "no4lvl" command line argument can be passed.. see
arch/riscv/mm/init.c+860 ->set_satp_mode()
I have double-checked with SpacemiT, according to SpacemiT, while the X100 core itself supports both SV39 and SV48, when it was integrated into the K3 SoC, it was specifically configured to support only SV39.
In this case, the K3 SoC's MMU is configured for SV39 only, so mmu-type = "riscv,sv39" is the correct representation.
Best regards,
Guodong Xu
Quoted 3 lines
--
Yixun Lan (dlan)
Re: [PATCH v4 10/11] riscv: dts: spacemit: add initial device tree of SpacemiT K3 SoC
In reply to Guodong XuQuoted 21 lines
arch/riscv/boot/dts/spacemit/k3.dtsi new file +21
-0+ mimsic: interrupt-controller@f1000000 { + compatible = "spacemit,k3-imsics", "riscv,imsics"; + reg = <0x0 0xf1000000 0x0 0x10000>; + #interrupt-cells = <0>; + #msi-cells = <0>; + interrupt-controller; + interrupts-extended = <&cpu0_intc 11>, <&cpu1_intc 11>, + <&cpu2_intc 11>, <&cpu3_intc 11>, + <&cpu4_intc 11>, <&cpu5_intc 11>, + <&cpu6_intc 11>, <&cpu7_intc 11>; + msi-controller; + riscv,guest-index-bits = <6>; + riscv,hart-index-bits = <4>; + riscv,num-guest-ids = <511>; + riscv,num-ids = <511>; + + status = "disabled"; + }; + + maplic: interrupt-controller@f1800000 { + compatible = "spacemit,k3-aplic", "riscv,aplic";
arch/riscv/boot/dts/spacemit/k3.dtsi line 588
Quoted 10 lines
arch/riscv/boot/dts/spacemit/k3.dtsi new file +10
-0+ reg = <0x0 0xf1800000 0x0 0x4000>; + #interrupt-cells = <2>; + interrupt-controller; + msi-parent = <&mimsic>; + riscv,children = <&saplic>; + riscv,delegate = <&saplic 1 512>; + riscv,num-sources = <512>; + + status = "disabled"; + };
from reading the chatter on v3 I think the right status here may be "reserved", for elements that are reserved by firmware. But I could be mistaken.
Kind regards,
Maud
Re: [PATCH v4 10/11] riscv: dts: spacemit: add initial device tree of SpacemiT K3 SoC
Quoted 29 lines · Maud Spierings
Quoted 29 lines
arch/riscv/boot/dts/spacemit/k3.dtsi new file +28
-0+ mimsic: interrupt-controller@f1000000 { + compatible = "spacemit,k3-imsics", "riscv,imsics"; + reg = <0x0 0xf1000000 0x0 0x10000>; + #interrupt-cells = <0>; + #msi-cells = <0>; + interrupt-controller; + interrupts-extended = <&cpu0_intc 11>, <&cpu1_intc 11>, + <&cpu2_intc 11>, <&cpu3_intc 11>, + <&cpu4_intc 11>, <&cpu5_intc 11>, + <&cpu6_intc 11>, <&cpu7_intc 11>; + msi-controller; + riscv,guest-index-bits = <6>; + riscv,hart-index-bits = <4>; + riscv,num-guest-ids = <511>; + riscv,num-ids = <511>; + + status = "disabled"; + }; + + maplic: interrupt-controller@f1800000 { + compatible = "spacemit,k3-aplic", "riscv,aplic"; + reg = <0x0 0xf1800000 0x0 0x4000>; + #interrupt-cells = <2>; + interrupt-controller; + msi-parent = <&mimsic>; + riscv,children = <&saplic>; + riscv,delegate = <&saplic 1 512>; + riscv,num-sources = <512>;
Quoted 8 lines
arch/riscv/boot/dts/spacemit/k3.dtsi line 418
Quoted 3 lines
arch/riscv/boot/dts/spacemit/k3.dtsi new file +3
-0+ + status = "disabled"; + };from reading the chatter on v3 I think the right status here may be "reserved", for elements that are reserved by firmware. But I could be mistaken.
Thanks Maud. Good catch. I think you are right, both M-mode maplic and mimsic should be listed as "reserved" to signify that they are intended to be used in OpenSBI, not the S-mode kernel.
I will fix that in the next version.
BR,
Guodong Xu
Quoted 3 lines
Kind regards,
Maud
PATCH v4 11/11 riscv: dts: spacemit: add SpacemiT K3 Pico-ITX board device tree
In reply to Guodong XuK3 Pico-ITX is a 2.5-inch single-board computer equipted with a SpacemiT K3 SoC.
This minimal device tree enables booting into a serial console with UART output.
---
v4: No change.
v3: No change.
v2: Add aliases node in this board DT.
Update the memory node to reflect the hardware truth. Address
starts at 0x100000000 (4G) boundary.
--- arch/riscv/boot/dts/spacemit/Makefile | 1 + arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 38 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+)
arch/riscv/boot/dts/spacemit/Makefile +1 -0
@@ -4,3 +4,4 @@ dtb-$(CONFIG_ARCH_SPACEMIT) += k1-milkv-jupiter.dtb dtb-$(CONFIG_ARCH_SPACEMIT) += k1-musepi-pro.dtb dtb-$(CONFIG_ARCH_SPACEMIT) += k1-orangepi-r2s.dtb dtb-$(CONFIG_ARCH_SPACEMIT) += k1-orangepi-rv2.dtb +dtb-$(CONFIG_ARCH_SPACEMIT) += k3-pico-itx.dtb
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts new file +38 -0
@@ -0,0 +1,38 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (c) 2025 SpacemiT (Hangzhou) Technology Co. Ltd + * Copyright (c) 2025 Guodong Xu <[email protected]> + */ + +#include "k3.dtsi" + +/ { + model = "SpacemiT K3 Pico-ITX"; + compatible = "spacemit,k3-pico-itx", "spacemit,k3"; + + aliases { + serial0 = &uart0; + serial2 = &uart2; + serial3 = &uart3; + serial4 = &uart4; + serial5 = &uart5; + serial6 = &uart6; + serial7 = &uart7; + serial8 = &uart8; + serial9 = &uart9; + serial10 = &uart10; + }; + + chosen { + stdout-path = "serial0"; + }; + + memory@100000000 { + device_type = "memory"; + reg = <0x1 0x00000000 0x4 0x00000000>; + }; +}; + +&uart0 { + status = "okay"; +};
Signature · 1 line
2.43.0
Re: [PATCH v4 11/11] riscv: dts: spacemit: add SpacemiT K3 Pico-ITX board device tree
Hi Guodong,
I have a minor comment for the subject, it's kind of little bit redundant.. so, how about (also apply to patch 10):
[PATCH v4 10/11] riscv: dts: spacemit: add initial support for K3 SoC [PATCH v4 11/11] riscv: dts: spacemit: add K3 Pico-ITX board support
Quoted 33 lines · Guodong Xu
K3 Pico-ITX is a 2.5-inch single-board computer equipted with a SpacemiT K3 SoC.
This minimal device tree enables booting into a serial console with UART output.
Signed-off-by Guodong Xu <[email protected]>---
v4: No change.
v3: No change.
v2: Add aliases node in this board DT.
Update the memory node to reflect the hardware truth. Address
starts at0x100000000(4G) boundary.--- arch/riscv/boot/dts/spacemit/Makefile | 1 + arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 38 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+)arch/riscv/boot/dts/spacemit/Makefile +1
-0@@ -4,3 +4,4 @@ dtb-$(CONFIG_ARCH_SPACEMIT) += k1-milkv-jupiter.dtb dtb-$(CONFIG_ARCH_SPACEMIT) += k1-musepi-pro.dtb dtb-$(CONFIG_ARCH_SPACEMIT) += k1-orangepi-r2s.dtb dtb-$(CONFIG_ARCH_SPACEMIT) += k1-orangepi-rv2.dtb +dtb-$(CONFIG_ARCH_SPACEMIT) += k3-pico-itx.dtbarch/riscv/boot/dts/spacemit/k3-pico-itx.dts new file +0
-0
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts line 4
Quoted 4 lines
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts new file +4
-0@@ -0,0 +1,38 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (c) 2025 SpacemiT (Hangzhou) Technology Co. Ltd + * Copyright (c) 2025 Guodong Xu <[email protected]>
strictly, should update to cover current year - which is 2026 now
Quoted 10 lines
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts new file +10
-0+ */ + +#include "k3.dtsi" + +/ { + model = "SpacemiT K3 Pico-ITX"; + compatible = "spacemit,k3-pico-itx", "spacemit,k3"; + + aliases { + serial0 = &uart0;
..
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts line 23
Quoted 9 lines
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts new file +9
-0+ serial2 = &uart2; + serial3 = &uart3; + serial4 = &uart4; + serial5 = &uart5; + serial6 = &uart6; + serial7 = &uart7; + serial8 = &uart8; + serial9 = &uart9; + serial10 = &uart10;
I think we only add aliases for devices which actually enabled
Quoted 19 lines
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts new file +15
-0+ }; + + chosen { + stdout-path = "serial0"; + }; + + memory@100000000 { + device_type = "memory"; + reg = <0x1 0x00000000 0x4 0x00000000>; + }; +}; + +&uart0 { + status = "okay"; +};Signature · 2 lines
-- 2.43.0
Signature · 1 line
Yixun Lan (dlan)
Re: [PATCH v4 11/11] riscv: dts: spacemit: add SpacemiT K3 Pico-ITX board device tree
Hi, Yixun
Quoted 8 lines · Yixun Lan
Hi Guodong,
I have a minor comment for the subject, it's kind of little bit redundant.. so, how about (also apply to patch 10):
[PATCH v4 10/11] riscv: dts: spacemit: add initial support for K3 SoC [PATCH v4 11/11] riscv: dts: spacemit: add K3 Pico-ITX board support
Thanks for the review. Sure, I can do it that way.
Quoted 32 lines · Guodong Xu
Quoted 30 lines
K3 Pico-ITX is a 2.5-inch single-board computer equipted with a SpacemiT K3 SoC.
This minimal device tree enables booting into a serial console with UART output.
Signed-off-by Guodong Xu <[email protected]>---
v4: No change.
v3: No change.
v2: Add aliases node in this board DT.
Update the memory node to reflect the hardware truth. Address
starts at0x100000000(4G) boundary.--- arch/riscv/boot/dts/spacemit/Makefile | 1 + arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 38 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+)arch/riscv/boot/dts/spacemit/Makefile +1
-0@@ -4,3 +4,4 @@ dtb-$(CONFIG_ARCH_SPACEMIT) += k1-milkv-jupiter.dtb dtb-$(CONFIG_ARCH_SPACEMIT) += k1-musepi-pro.dtb dtb-$(CONFIG_ARCH_SPACEMIT) += k1-orangepi-r2s.dtb dtb-$(CONFIG_ARCH_SPACEMIT) += k1-orangepi-rv2.dtb +dtb-$(CONFIG_ARCH_SPACEMIT) += k3-pico-itx.dtbarch/riscv/boot/dts/spacemit/k3-pico-itx.dts new file +0
-0
Quoted 8 lines
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts line 4
Quoted 7 lines
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts new file +4
-0@@ -0,0 +1,38 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (c) 2025 SpacemiT (Hangzhou) Technology Co. Ltd + * Copyright (c) 2025 Guodong Xu <[email protected]>strictly, should update to cover current year - which is 2026 now
Yes, that's a mistake. Happy New Year, 2026!
I will fix that.
Quoted 21 lines
Quoted 11 lines
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts new file +10
-0+ */ + +#include "k3.dtsi" + +/ { + model = "SpacemiT K3 Pico-ITX"; + compatible = "spacemit,k3-pico-itx", "spacemit,k3"; + + aliases { + serial0 = &uart0;..
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts line 23
Quoted 9 lines
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts new file +9
-0+ serial2 = &uart2; + serial3 = &uart3; + serial4 = &uart4; + serial5 = &uart5; + serial6 = &uart6; + serial7 = &uart7; + serial8 = &uart8; + serial9 = &uart9; + serial10 = &uart10;
Quoted 1 line
I think we only add aliases for devices which actually enabled
Sure. I see your point.
There are different styles existing in the kernel dts. like sophgo, and thead. I checked th1520-lichee-pi-4a.dts, which has aliases for serial0-5, but only enables uart0 actually.
However, for SpacemiT convention, and several others, I see a different style. In k1 boards, both k1-milkv-jupiter.dts and k1-bananapi-f3.dts only have the serial0 alias, with only uart0 enabled.
For SpacemiT K3 boards, to follow the convention, I will remove the unused aliases and fix that in my next version.
Best regards,
Guodong Xu
Quoted 24 lines
Quoted 18 lines
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts new file +15
-1+ }; + + chosen { + stdout-path = "serial0"; + }; + + memory@100000000 { + device_type = "memory"; + reg = <0x1 0x00000000 0x4 0x00000000>; + }; +}; + +&uart0 { + status = "okay"; +}; --Quoted 2 lines
2.43.0
--
Yixun Lan (dlan)
Quoted 8 lines · Guodong Xu
Hi, Conor
For the binding riscv/extensions.ymal, here's what changed in v3 (no change in v4):
1. Dropped the patch of adding "supm" into
extensions.yaml. At the same time, I will start another patchset which implements the strategy outlined by Conor in Link [2] and by Samuel in Link [3].
Okay, that seems reasonable to separate out.
Quoted 12 lines
2. Dropped the dependency checks for "sha" on "h", "shcounterenw", and 6 others. "sha" implies these extensions, and it should be allowed to be declared independently. Like "a" implies "zaamo" and "zalrsc".
3. Enchanced the dependency check of "ziccamoa" on "a". Specifically,
- added the dependency check of "ziccamoa" on "zaamo" or on "a".
- added the dependency check of "za64rs" on "zalrsc" or on "a".
- added the dependency check of "ziccrse" on "zalrsc" or "a".
The commit message of this patch is updated too, to better explain the relationship between "ziccamoa", "za64rs", "ziccrse" and "a".
Quoted 6 lines
4. Enhanced checking dependency of "b" and "zba", "zbb", "zbs", making the dependency check in both directions, as discussed in [4]. Since "b" was ratified much later than its component extensions (zba/zbb/zbs), existing software and kernels expect these explicit strings. This bidirectional check ensures cores declaring "b" remain compatible with older software that only recognizes zba/zbb/zbs.
This I asked about in the relevant patch, I would like to know what your plan for adding the "b"s is.
Spacemit folks, I assume you weren't planning on taking the extensions.yaml stuff via your tree? If you weren't, I'll grab it once the question about b is answered.
Hi Conor,
Quoted 35 lines · Conor Dooley
Quoted 8 lines · Guodong Xu
Hi, Conor
For the binding riscv/extensions.ymal, here's what changed in v3 (no change in v4):
1. Dropped the patch of adding "supm" into
extensions.yaml. At the same time, I will start another patchset which implements the strategy outlined by Conor in Link [2] and by Samuel in Link [3].Okay, that seems reasonable to separate out.
Quoted 12 lines
2. Dropped the dependency checks for "sha" on "h", "shcounterenw", and 6 others. "sha" implies these extensions, and it should be allowed to be declared independently. Like "a" implies "zaamo" and "zalrsc".
3. Enchanced the dependency check of "ziccamoa" on "a". Specifically,
- added the dependency check of "ziccamoa" on "zaamo" or on "a".
- added the dependency check of "za64rs" on "zalrsc" or on "a".
- added the dependency check of "ziccrse" on "zalrsc" or "a".
The commit message of this patch is updated too, to better explain the relationship between "ziccamoa", "za64rs", "ziccrse" and "a".Quoted 6 lines
4. Enhanced checking dependency of "b" and "zba", "zbb", "zbs", making the dependency check in both directions, as discussed in [4]. Since "b" was ratified much later than its component extensions (zba/zbb/zbs), existing software and kernels expect these explicit strings. This bidirectional check ensures cores declaring "b" remain compatible with older software that only recognizes zba/zbb/zbs.
This I asked about in the relevant patch, I would like to know what your plan for adding the "b"s is.
..
Quoted 3 lines
Spacemit folks, I assume you weren't planning on taking the
extensions.yamlstuff via your tree? If you weren't, I'll grab it once the question about b is answered.
sure, please take extension stuff which are patches 6-9, for 1-5, it's all about adding support for SpacemiT K3 SoC, to avoid petential conflicts, I wouldn't mind if you also taking them? then I can handle the rest 10,11 for DT
Signature · 1 line
Yixun Lan (dlan)
Quoted 38 lines · Yixun Lan
Hi Conor,
Quoted 32 lines · Conor Dooley
Quoted 8 lines · Guodong Xu
Hi, Conor
For the binding riscv/extensions.ymal, here's what changed in v3 (no change in v4):
1. Dropped the patch of adding "supm" into
extensions.yaml. At the same time, I will start another patchset which implements the strategy outlined by Conor in Link [2] and by Samuel in Link [3].Okay, that seems reasonable to separate out.
Quoted 12 lines
2. Dropped the dependency checks for "sha" on "h", "shcounterenw", and 6 others. "sha" implies these extensions, and it should be allowed to be declared independently. Like "a" implies "zaamo" and "zalrsc".
3. Enchanced the dependency check of "ziccamoa" on "a". Specifically,
- added the dependency check of "ziccamoa" on "zaamo" or on "a".
- added the dependency check of "za64rs" on "zalrsc" or on "a".
- added the dependency check of "ziccrse" on "zalrsc" or "a".
The commit message of this patch is updated too, to better explain the relationship between "ziccamoa", "za64rs", "ziccrse" and "a".Quoted 6 lines
4. Enhanced checking dependency of "b" and "zba", "zbb", "zbs", making the dependency check in both directions, as discussed in [4]. Since "b" was ratified much later than its component extensions (zba/zbb/zbs), existing software and kernels expect these explicit strings. This bidirectional check ensures cores declaring "b" remain compatible with older software that only recognizes zba/zbb/zbs.
Quoted 3 lines
This I asked about in the relevant patch, I would like to know what your plan for adding the "b"s is.
Quoted 8 lines
..
Quoted 3 lines
Spacemit folks, I assume you weren't planning on taking the
extensions.yamlstuff via your tree? If you weren't, I'll grab it once the question about b is answered.sure, please take extension stuff which are patches 6-9, for 1-5, it's all about adding support for SpacemiT K3 SoC, to avoid petential conflicts, I wouldn't mind if you also taking them? then I can handle the rest 10,11 for DT
Stuff for spacemit is either for you or for the relevant subsystem maintainers. You're probably safe enough taking the timer/interrupt-controller stuff if the maintainers don't apply it in a reasonable period, it's not abnormal for those in particular to go via the platform maintainer in my experience. Just be clear that you have done so. I'm only interested in taking 6-9.
Quoted 48 lines · Conor Dooley
Quoted 38 lines · Yixun Lan
Hi Conor,
Quoted 32 lines · Conor Dooley
Quoted 8 lines · Guodong Xu
Hi, Conor
For the binding riscv/extensions.ymal, here's what changed in v3 (no change in v4):
1. Dropped the patch of adding "supm" into
extensions.yaml. At the same time, I will start another patchset which implements the strategy outlined by Conor in Link [2] and by Samuel in Link [3].Okay, that seems reasonable to separate out.
Quoted 12 lines
2. Dropped the dependency checks for "sha" on "h", "shcounterenw", and 6 others. "sha" implies these extensions, and it should be allowed to be declared independently. Like "a" implies "zaamo" and "zalrsc".
3. Enchanced the dependency check of "ziccamoa" on "a". Specifically,
- added the dependency check of "ziccamoa" on "zaamo" or on "a".
- added the dependency check of "za64rs" on "zalrsc" or on "a".
- added the dependency check of "ziccrse" on "zalrsc" or "a".
The commit message of this patch is updated too, to better explain the relationship between "ziccamoa", "za64rs", "ziccrse" and "a".Quoted 6 lines
4. Enhanced checking dependency of "b" and "zba", "zbb", "zbs", making the dependency check in both directions, as discussed in [4]. Since "b" was ratified much later than its component extensions (zba/zbb/zbs), existing software and kernels expect these explicit strings. This bidirectional check ensures cores declaring "b" remain compatible with older software that only recognizes zba/zbb/zbs.
Quoted 3 lines
This I asked about in the relevant patch, I would like to know what your plan for adding the "b"s is.
Quoted 8 lines
..
Quoted 3 lines
Spacemit folks, I assume you weren't planning on taking the
extensions.yamlstuff via your tree? If you weren't, I'll grab it once the question about b is answered.sure, please take extension stuff which are patches 6-9, for 1-5, it's all about adding support for SpacemiT K3 SoC, to avoid petential conflicts, I wouldn't mind if you also taking them? then I can handle the rest 10,11 for DT
Quoted 6 lines
Stuff for spacemit is either for you or for the relevant subsystem maintainers. You're probably safe enough taking the timer/interrupt-controller stuff if the maintainers don't apply it in a reasonable period, it's not abnormal for those in particular to go via the platform maintainer in my experience. Just be clear that you have done so. I'm only interested in taking 6-9.
Hi Conor,
Ok, I got, thank you!
Hi Paul Walmsley,
I assume you're responsible for more general riscv stuff with your
effective maintainer hat, so do you mind if I take patches 1-5 via SpacemiT SoC tree? I think the potential conflicts should be low and easy to fix.
Or, in the other hand, just let me know which patches you would like
to take, then I will handle the rest. Thanks
Signature · 1 line
Yixun Lan (dlan)
Rob Herring
maintainerQuoted 59 lines · Yixun Lan
Quoted 48 lines · Conor Dooley
Quoted 38 lines · Yixun Lan
Hi Conor,
Quoted 32 lines · Conor Dooley
Quoted 8 lines · Guodong Xu
Hi, Conor
For the binding riscv/extensions.ymal, here's what changed in v3 (no change in v4):
1. Dropped the patch of adding "supm" into
extensions.yaml. At the same time, I will start another patchset which implements the strategy outlined by Conor in Link [2] and by Samuel in Link [3].Okay, that seems reasonable to separate out.
Quoted 12 lines
2. Dropped the dependency checks for "sha" on "h", "shcounterenw", and 6 others. "sha" implies these extensions, and it should be allowed to be declared independently. Like "a" implies "zaamo" and "zalrsc".
3. Enchanced the dependency check of "ziccamoa" on "a". Specifically,
- added the dependency check of "ziccamoa" on "zaamo" or on "a".
- added the dependency check of "za64rs" on "zalrsc" or on "a".
- added the dependency check of "ziccrse" on "zalrsc" or "a".
The commit message of this patch is updated too, to better explain the relationship between "ziccamoa", "za64rs", "ziccrse" and "a".Quoted 6 lines
4. Enhanced checking dependency of "b" and "zba", "zbb", "zbs", making the dependency check in both directions, as discussed in [4]. Since "b" was ratified much later than its component extensions (zba/zbb/zbs), existing software and kernels expect these explicit strings. This bidirectional check ensures cores declaring "b" remain compatible with older software that only recognizes zba/zbb/zbs.
Quoted 3 lines
This I asked about in the relevant patch, I would like to know what your plan for adding the "b"s is.
Quoted 8 lines
..
Quoted 3 lines
Spacemit folks, I assume you weren't planning on taking the
extensions.yamlstuff via your tree? If you weren't, I'll grab it once the question about b is answered.sure, please take extension stuff which are patches 6-9, for 1-5, it's all about adding support for SpacemiT K3 SoC, to avoid petential conflicts, I wouldn't mind if you also taking them? then I can handle the rest 10,11 for DT
Quoted 6 lines
Stuff for spacemit is either for you or for the relevant subsystem maintainers. You're probably safe enough taking the timer/interrupt-controller stuff if the maintainers don't apply it in a reasonable period, it's not abnormal for those in particular to go via the platform maintainer in my experience. Just be clear that you have done so. I'm only interested in taking 6-9.
Hi Conor,
Ok, I got, thank you!
Quoted 6 lines
Hi Paul Walmsley,
I assume you're responsible for more general riscv stuff with your
effective maintainer hat, so do you mind if I take patches 1-5 via SpacemiT SoC tree? I think the potential conflicts should be low and easy to fix.
Or, in the other hand, just let me know which patches you would like
to take, then I will handle the rest. Thanks
Paul would generally only ever take patch 1. You can take 1-5. The timer and interrupt-controller bindings tend to not get picked up by the subsystem unless there are driver changes too.
Rob
Quoted 33 lines · Conor Dooley
Quoted 8 lines · Guodong Xu
Hi, Conor
For the binding riscv/extensions.ymal, here's what changed in v3 (no change in v4):
1. Dropped the patch of adding "supm" into
extensions.yaml. At the same time, I will start another patchset which implements the strategy outlined by Conor in Link [2] and by Samuel in Link [3].Okay, that seems reasonable to separate out.
Quoted 12 lines
2. Dropped the dependency checks for "sha" on "h", "shcounterenw", and 6 others. "sha" implies these extensions, and it should be allowed to be declared independently. Like "a" implies "zaamo" and "zalrsc".
3. Enchanced the dependency check of "ziccamoa" on "a". Specifically,
- added the dependency check of "ziccamoa" on "zaamo" or on "a".
- added the dependency check of "za64rs" on "zalrsc" or on "a".
- added the dependency check of "ziccrse" on "zalrsc" or "a".
The commit message of this patch is updated too, to better explain the relationship between "ziccamoa", "za64rs", "ziccrse" and "a".Quoted 6 lines
4. Enhanced checking dependency of "b" and "zba", "zbb", "zbs", making the dependency check in both directions, as discussed in [4]. Since "b" was ratified much later than its component extensions (zba/zbb/zbs), existing software and kernels expect these explicit strings. This bidirectional check ensures cores declaring "b" remain compatible with older software that only recognizes zba/zbb/zbs.
Quoted 2 lines
This I asked about in the relevant patch, I would like to know what your plan for adding the "b"s is.
Thanks for confirming the above. Yes, I will start a follow up patch to update the dtsi files related to the "b" extension.
Best regards,
Guodong Xu
Quoted 4 lines
Spacemit folks, I assume you weren't planning on taking the
extensions.yamlstuff via your tree? If you weren't, I'll grab it once the question about b is answered.
Re: (subset) [PATCH v4 00/11] riscv: spacemit: Add SpacemiT K3 SoC and K3 Pico-ITX board
In reply to Guodong XuFrom: Conor Dooley <[email protected]>
Quoted 10 lines · Guodong Xu
This series introduces basic support for the SpacemiT K3 SoC and the K3 Pico-ITX evaluation board.
This series (starting from v2) also adds descriptions about ISA extensions mandated by the RVA23 Profile Version 1.0 into
riscv/extensions.yaml. There are extensive discussions about how to handle these new extensions in v2. In v3 (now v4), here is my best understading of what I think we have reached consensus on.[...]
Applied 6-9 to riscv-dt-for-next :)
[06/11] dt-bindings: riscv: Add B ISA extension description
https://git.kernel.org/conor/c/0cdb7fc1879b [07/11] dt-bindings: riscv: Add descriptions for Za64rs, Ziccamoa, Ziccif, and Zicclsm https://git.kernel.org/conor/c/b321256a4f36 [08/11] dt-bindings: riscv: Add Ssccptr, Sscounterenw, Sstvala, Sstvecd, Ssu64xl https://git.kernel.org/conor/c/c712413333f8 [09/11] dt-bindings: riscv: Add Sha and its comprised extensions https://git.kernel.org/conor/c/89febd6a0276
Thanks,
Conor.