riscv: spacemit: Add SpacemiT K3 SoC and K3 Pico-ITX board
Subsystems (8)
v2 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. These additions are implemented in Patches 7 through 11.
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.
This v2 series includes:
- DT bindings for SpacemiT X100 core, K3 SoC, and Pico-ITX board.
- DT bindings for K3 integrated peripherals: CLINT, APLIC, IMSIC, and UART.
- Initial Device Tree for K3 SoC and Pico-ITX board.
- Add DT bindings for mandatory extensions of RVA23.
This series has been rebased to v6.19-rc2.
Patches 7 and 8 from the v1 series have been renumbered to Patches 12 and 13.
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 (13):
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: serial: 8250: add SpacemiT K3 UART compatible
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
dt-bindings: riscv: Add Supm extension description
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 | 180 +++++++ .../devicetree/bindings/riscv/spacemit.yaml | 4 + Documentation/devicetree/bindings/serial/8250.yaml | 1 + .../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 | 548 +++++++++++++++++++++ 10 files changed, 776 insertions(+)
---
base-commit: 9448598b22c50c8a5bb77a9103e2d49f134c9578
change-id: 20251216-k3-basic-dt-cd9540061989
Best regards,
Signature · 1 line
Guodong Xu <[email protected]>
PATCH v2 1/13 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.
---
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 v2 01/13] dt-bindings: riscv: add SpacemiT X100 CPU compatible
Quoted 12 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.
X100 is used in SpacemiT K3 SoC.
Quoted 8 lines
Reviewed-by Yixun Lan <[email protected]>Reviewed-by Heinrich Schuchardt <[email protected]>Signed-off-by Guodong Xu <[email protected]>---
v2: Fixed alphanumeric sorting of compatible strings, put x100 before x60,
as per Krzysztof's feedback.
Best regards,
Krzysztof
PATCH v2 2/13 dt-bindings: timer: add SpacemiT K3 CLINT
In reply to Guodong XuAdd compatible string for SpacemiT K3 CLINT.
---
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 v2 3/13 dt-bindings: interrupt-controller: add SpacemiT K3 APLIC
In reply to Guodong XuAdd compatible string for SpacemiT K3 APLIC.
---
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 v2 4/13 dt-bindings: interrupt-controller: add SpacemiT K3 IMSIC
In reply to Guodong XuAdd compatible string for SpacemiT K3 IMSIC.
---
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
Re: [PATCH v2 04/13] dt-bindings: interrupt-controller: add SpacemiT K3 IMSIC
Quoted 5 lines · Guodong Xu
Add compatible string for SpacemiT K3 IMSIC.
Signed-off-by Guodong Xu <[email protected]>---
v2: Fix the order to keep things alphabetically.
Best regards,
Krzysztof
PATCH v2 5/13 dt-bindings: serial: 8250: add SpacemiT K3 UART compatible
In reply to Guodong XuThe SpacemiT K3 UART controller is compatible with the Intel XScale UART. Add K3 UART binding and allow describing it with a fixed clock-frequency for now.
The clocks and clock-names properties will be made mandatory in a future patch, once the K3 clock driver and device tree are merged.
---
v2: Add Conor's Acked-by.
--- Documentation/devicetree/bindings/serial/8250.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/serial/8250.yaml +1 -0
@@ -160,6 +160,7 @@ properties: - enum: - mrvl,mmp-uart - spacemit,k1-uart + - spacemit,k3-uart - const: intel,xscale-uart - items: - enum:
Signature · 1 line
2.43.0
PATCH v2 6/13 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.
---
v2: Use one-blank-space between name and email address.
--- Documentation/devicetree/bindings/riscv/spacemit.yaml | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/riscv/spacemit.yaml +4 -0
@@ -9,6 +9,7 @@ title: SpacemiT SoC-based boards maintainers: - Yangyu Chen <[email protected]> - Yixun Lan <[email protected]> + - Guodong Xu <[email protected]> description: SpacemiT SoC-based boards
@@ -26,6 +27,9 @@ properties: - xunlong,orangepi-r2s - xunlong,orangepi-rv2 - const: spacemit,k1 + - items: + - const: spacemit,k3-pico-itx + - const: spacemit,k3 additionalProperties: true
Signature · 1 line
2.43.0
PATCH v2 7/13 dt-bindings: riscv: Add B ISA extension description
In reply to Guodong XuAdd description of the single-letter "B" extennsion 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.
Hence add a schema check rule to enforce that B implies Zba, Zbb and Zbs.
---
v2: New patch.
--- .../devicetree/bindings/riscv/extensions.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +19 -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
@@ -735,6 +742,18 @@ properties: then: contains: const: f + # b comprises the following extensions + - if: + contains: + const: b + then: + allOf: + - contains: + const: zba + - contains: + const: zbb + - contains: + const: zbs # Zcb depends on Zca - if: contains:
Signature · 1 line
2.43.0
Re: [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description
Quoted 36 lines · Guodong Xu
Add description of the single-letter "B" extennsion 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.
Hence add a schema check rule to enforce that B implies Zba, Zbb and Zbs.
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +7
-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
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 748
Quoted 7 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +4
-0@@ -735,6 +742,18 @@ properties: then: contains: const: f + # b comprises the following extensions + - if: + contains: + const: b
What's the value in adding b, if it depends on having all 3 of the components defined individually too? Currently all "superset" types of extensions are permitted without their component parts also being defined, this doesn't follow convention and therefore needs to be explained.
You obviously need this construct because the kernel does not understand "b", and even if you added support for interpreting "b" to the kernel this is probably still needed to make sure the ABI is maintained for anything importing a devicetree from the kernel.
Quoted 15 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +8
-0+ then: + allOf: + - contains: + const: zba + - contains: + const: zbb + - contains: + const: zbs # Zcb depends on Zca - if: contains:Signature · 2 lines
-- 2.43.0
Re: [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description
Hi, Conor
Quoted 51 lines · Conor Dooley
Quoted 36 lines · Guodong Xu
Add description of the single-letter "B" extennsion 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.
Hence add a schema check rule to enforce that B implies Zba, Zbb and Zbs.
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +7
-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 ratifiedDocumentation/devicetree/bindings/riscv/extensions.yaml properties: · line 748
Quoted 7 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +4
-0@@ -735,6 +742,18 @@ properties: then: contains: const: f + # b comprises the following extensions + - if: + contains: + const: bWhat's the value in adding b, if it depends on having all 3 of the components defined individually too? Currently all "superset" types of extensions are permitted without their component parts also being defined, this doesn't follow convention and therefore needs to be explained.
Quoted 4 lines
You obviously need this construct because the kernel does not understand "b", and even if you added support for interpreting "b" to the kernel this is probably still needed to make sure the ABI is maintained for anything importing a devicetree from the kernel.
Yes, exactly. Unlike other single-letter extensions, "b" was ratified (Apr/2024) much later than its components zba/zbb/zbs (Jun/2021). Existing software and the kernel already expect these explicit component strings, so enforcing this dependency ensures cores declaring "b" will also be correctly understood by older software that only looks for zba/zbb/zbs.
I will update the commit message in v3 to clearly explain this reasoning. Does it sound good to you?
Thank you for the review.
BR,
Guodong Xu
Quoted 16 lines
Quoted 16 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +8
-1+ then: + allOf: + - contains: + const: zba + - contains: + const: zbb + - contains: + const: zbs # Zcb depends on Zca - if: contains: --2.43.0
Re: [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description
Quoted 66 lines · Guodong Xu
Hi, Conor
Quoted 51 lines · Conor Dooley
Quoted 36 lines · Guodong Xu
Add description of the single-letter "B" extennsion 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.
Hence add a schema check rule to enforce that B implies Zba, Zbb and Zbs.
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +7
-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 ratifiedDocumentation/devicetree/bindings/riscv/extensions.yaml properties: · line 748
Quoted 7 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +4
-0@@ -735,6 +742,18 @@ properties: then: contains: const: f + # b comprises the following extensions + - if: + contains: + const: bWhat's the value in adding b, if it depends on having all 3 of the components defined individually too? Currently all "superset" types of extensions are permitted without their component parts also being defined, this doesn't follow convention and therefore needs to be explained.
Quoted 4 lines
You obviously need this construct because the kernel does not understand "b", and even if you added support for interpreting "b" to the kernel this is probably still needed to make sure the ABI is maintained for anything importing a devicetree from the kernel.
Yes, exactly. Unlike other single-letter extensions, "b" was ratified (Apr/2024) much later than its components zba/zbb/zbs (Jun/2021). Existing software and the kernel already expect these explicit component strings, so enforcing this dependency ensures cores declaring "b" will also be correctly understood by older software that only looks for zba/zbb/zbs.
Quoted 3 lines
I will update the commit message in v3 to clearly explain this reasoning.
Does it sound good to you?
Ye, sounds good.
Re: [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description
In reply to Guodong XuQuoted 59 lines · Guodong Xu
Hi, Conor
Quoted 51 lines · Conor Dooley
Quoted 36 lines · Guodong Xu
Add description of the single-letter "B" extennsion 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.
Hence add a schema check rule to enforce that B implies Zba, Zbb and Zbs.
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +7
-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 ratifiedDocumentation/devicetree/bindings/riscv/extensions.yaml properties: · line 748
Quoted 7 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +4
-0@@ -735,6 +742,18 @@ properties: then: contains: const: f + # b comprises the following extensions + - if: + contains: + const: bWhat's the value in adding b, if it depends on having all 3 of the components defined individually too? Currently all "superset" types of extensions are permitted without their component parts also being defined, this doesn't follow convention and therefore needs to be explained.
Quoted 4 lines
You obviously need this construct because the kernel does not understand "b", and even if you added support for interpreting "b" to the kernel this is probably still needed to make sure the ABI is maintained for anything importing a devicetree from the kernel.
Quoted 6 lines
Yes, exactly. Unlike other single-letter extensions, "b" was ratified (Apr/2024) much later than its components zba/zbb/zbs (Jun/2021). Existing software and the kernel already expect these explicit component strings, so enforcing this dependency ensures cores declaring "b" will also be correctly understood by older software that only looks for zba/zbb/zbs.
I might be misunderstanding you, but I don't think extension "b" should *require* the other three extensions. Instead, the "b" extension should be considered *equivalent* to the other three. That's what I understand it to mean, anyway.
https://github.com/riscv/riscv-b
There's no point in supporting "b" in devicetree to represent the others if it also requires the others to be present.
I think that, instead, "b", "zba", "zbb", and "zbs" should all be allowed.
I might even go further and harden the requirement, saying that if you specify "b" you should *not* specify "zba", "zbb", or "zbs". But that might not be normal practice, and it's not necessary because they aren't in conflict.
-Alex
Quoted 25 lines
I will update the commit message in v3 to clearly explain this reasoning. Does it sound good to you?
Thank you for the review.
BR,
Guodong XuQuoted 16 lines
Quoted 16 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +8
-1+ then: + allOf: + - contains: + const: zba + - contains: + const: zbb + - contains: + const: zbs # Zcb depends on Zca - if: contains: --2.43.0
Re: [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description
Hi, Alex
Quoted 68 lines · Alex Elder
Quoted 59 lines · Guodong Xu
Hi, Conor
Quoted 51 lines · Conor Dooley
Quoted 36 lines · Guodong Xu
Add description of the single-letter "B" extennsion 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.
Hence add a schema check rule to enforce that B implies Zba, Zbb and Zbs.
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +7
-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 ratifiedDocumentation/devicetree/bindings/riscv/extensions.yaml properties: · line 748
Quoted 7 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +4
-0@@ -735,6 +742,18 @@ properties: then: contains: const: f + # b comprises the following extensions + - if: + contains: + const: bWhat's the value in adding b, if it depends on having all 3 of the components defined individually too? Currently all "superset" types of extensions are permitted without their component parts also being defined, this doesn't follow convention and therefore needs to be explained.
Quoted 4 lines
You obviously need this construct because the kernel does not understand "b", and even if you added support for interpreting "b" to the kernel this is probably still needed to make sure the ABI is maintained for anything importing a devicetree from the kernel.
Quoted 6 lines
Yes, exactly. Unlike other single-letter extensions, "b" was ratified (Apr/2024) much later than its components zba/zbb/zbs (Jun/2021). Existing software and the kernel already expect these explicit component strings, so enforcing this dependency ensures cores declaring "b" will also be correctly understood by older software that only looks for zba/zbb/zbs.
Quoted 3 lines
I might be misunderstanding you, but I don't think extension "b" should *require* the other three extensions. Instead, the "b" extension should be considered *equivalent* to the other three.
You are correct in saying they are equivalent.
Quoted 11 lines
That's what I understand it to mean, anyway.
https://github.com/riscv/riscv-bThere's no point in supporting "b" in devicetree to represent the others if it also requires the others to be present.
I think that, instead, "b", "zba", "zbb", and "zbs" should all be allowed.
I might even go further and harden the requirement, saying that if you specify "b" you should *not* specify "zba", "zbb", or "zbs".
Historical reasons here. "b" came too late. The chip vendors have published cores with "zba", "zbb", and "zbs"already.
That's a migration bridge to require "b" must be listed together with the other three.
BR,
Guodong
Quoted 31 lines
But that might not be normal practice, and it's not necessary because they aren't in conflict.
-Alex
Quoted 25 lines
I will update the commit message in v3 to clearly explain this reasoning. Does it sound good to you?
Thank you for the review.
BR,
Guodong XuQuoted 16 lines
Quoted 16 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +8
-1+ then: + allOf: + - contains: + const: zba + - contains: + const: zbb + - contains: + const: zbs # Zcb depends on Zca - if: contains: --2.43.0
Re: [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description
Quoted 9 lines · Guodong Xu
Quoted 9 lines
That's what I understand it to mean, anyway.
https://github.com/riscv/riscv-bThere's no point in supporting "b" in devicetree to represent the others if it also requires the others to be present.
I think that, instead, "b", "zba", "zbb", and "zbs" should all be allowed.
Quoted 7 lines
Quoted 2 lines
I might even go further and harden the requirement, saying that if you specify "b" you should*not* specify "zba", "zbb", or "zbs".
Historical reasons here. "b" came too late. The chip vendors have published cores with "zba", "zbb", and "zbs"already.
That's a migration bridge to require "b" must be listed together with the other three.
Are you saying "b" has already been included with "zba", "zbb", and "zbs" in an existing DTS file?
What I'm suggesting is that (unless someone has already done this in a DTS file), there is no reason to require "b" *and* the other three. You should allow either "b" *or* all of the other three, not both. That would support older platforms as well as newer ones that use the more concise "b" only.
-Alex
Re: [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description
Quoted 13 lines · Alex Elder
Quoted 11 lines · Guodong Xu
Quoted 11 lines
That's what I understand it to mean, anyway.
https://github.com/riscv/riscv-bThere's no point in supporting "b" in devicetree to represent the others if it also requires the others to be present.
I think that, instead, "b", "zba", "zbb", and "zbs" should all be allowed.
I might even go further and harden the requirement, saying that if you specify "b" you should*not* specify "zba", "zbb", or "zbs".
Quoted 8 lines
Quoted 5 lines
Historical reasons here. "b" came too late. The chip vendors have published cores with "zba", "zbb", and "zbs"already.
That's a migration bridge to require "b" must be listed together with the other three.
Are you saying "b" has already been included with "zba", "zbb", and "zbs" in an existing DTS file?
The risc-v ratification timeline is:
"b" was ratified in Apr/2024, which is about 2 years later than its components zba/zbb/zbs (these were ratified in Jun/2021).
I can do this in linux kernel, writing a dts file which contains only "b", but no zba/zbb/zbs. The linux kernel can correctly extend "b" to zba/zbb/zbs.
ps: after I or somebody adds the logic into cpufeature.c.
However, the problem is with the older software who reuse kernel's DTS files, and recognizes only 'zba/zbb/zbs'. (If you search in the riscv/boot/dts, you will notice a lot platforms supports zba/zbb/zbs.)
When there is only "b", these older software may just disable the features related to 'zba/zbb/zbs', because when they developed their feature, "b" doesn't exist yet.
Hopefully I explained the logic clear this time.
BR,
Guodong
Quoted 8 lines
What I'm suggesting is that (unless someone has already done this in a DTS file), there is no reason to require "b" *and* the other three. You should allow either "b" *or* all of the other three, not both. That would support older platforms as well as newer ones that use the more concise "b" only.
-Alex
Re: [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description
Quoted 24 lines · Guodong Xu
Quoted 13 lines · Alex Elder
Quoted 11 lines · Guodong Xu
Quoted 11 lines
That's what I understand it to mean, anyway.
https://github.com/riscv/riscv-bThere's no point in supporting "b" in devicetree to represent the others if it also requires the others to be present.
I think that, instead, "b", "zba", "zbb", and "zbs" should all be allowed.
I might even go further and harden the requirement, saying that if you specify "b" you should*not* specify "zba", "zbb", or "zbs".
Quoted 8 lines
Quoted 5 lines
Historical reasons here. "b" came too late. The chip vendors have published cores with "zba", "zbb", and "zbs"already.
That's a migration bridge to require "b" must be listed together with the other three.
Are you saying "b" has already been included with "zba", "zbb", and "zbs" in an existing DTS file?
Quoted 7 lines
The risc-v ratification timeline is:
"b" was ratified in Apr/2024, which is about 2 years later than its components zba/zbb/zbs (these were ratified in Jun/2021).I can do this in linux kernel, writing a dts file which contains only "b", but no zba/zbb/zbs. The linux kernel can correctly extend "b" to zba/zbb/zbs.
ps: after I or somebody adds the logic intocpufeature.c.
Yes, this part I understand. (Yes, do that...)
Quoted 7 lines
However, the problem is with the older software who reuse kernel's DTS files, and recognizes only 'zba/zbb/zbs'. (If you search in the riscv/boot/dts, you will notice a lot platforms supports zba/zbb/zbs.)
When there is only "b", these older software may just disable the features related to 'zba/zbb/zbs', because when they developed their feature, "b" doesn't exist yet.
Yes, old DTS files can and will continue to specify "zba+zbb+zbs". But those old DTS files are not expected to be changed to replace "zba+zbb+zbs" with just "h".
Once "cpufeature.c" supports the "h" extension, the software supports either one: "h" or "zba+zbb+zbs".
The key point I'm trying to make is that the binding should not require "zba+zbb+zbs" to supplied *on top of* the "h" in the list of CPU extensions. Only one or the other should be sufficient. And I think your binding was saying "if "h" then required "zba+zbb+zbs".
Quoted 1 line
Hopefully I explained the logic clear this time.
I think you have done your best. I hope I'm not just being dense.
-Alex
Quoted 11 lines
BR,
GuodongQuoted 8 lines
What I'm suggesting is that (unless someone has already done this in a DTS file), there is no reason to require "b" *and* the other three. You should allow either "b" *or* all of the other three, not both. That would support older platforms as well as newer ones that use the more concise "b" only.
-Alex
Re: [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description
In reply to Alex ElderQuoted 67 lines · Alex Elder
Quoted 59 lines · Guodong Xu
Hi, Conor
Quoted 51 lines · Conor Dooley
Quoted 36 lines · Guodong Xu
Add description of the single-letter "B" extennsion 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.
Hence add a schema check rule to enforce that B implies Zba, Zbb and Zbs.
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +7
-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 ratifiedDocumentation/devicetree/bindings/riscv/extensions.yaml properties: · line 748
Quoted 7 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +4
-0@@ -735,6 +742,18 @@ properties: then: contains: const: f + # b comprises the following extensions + - if: + contains: + const: bWhat's the value in adding b, if it depends on having all 3 of the components defined individually too? Currently all "superset" types of extensions are permitted without their component parts also being defined, this doesn't follow convention and therefore needs to be explained.
Quoted 4 lines
You obviously need this construct because the kernel does not understand "b", and even if you added support for interpreting "b" to the kernel this is probably still needed to make sure the ABI is maintained for anything importing a devicetree from the kernel.
Quoted 6 lines
Yes, exactly. Unlike other single-letter extensions, "b" was ratified (Apr/2024) much later than its components zba/zbb/zbs (Jun/2021). Existing software and the kernel already expect these explicit component strings, so enforcing this dependency ensures cores declaring "b" will also be correctly understood by older software that only looks for zba/zbb/zbs.
Quoted 8 lines
I might be misunderstanding you, but I don't think extension "b" should *require* the other three extensions. Instead, the "b" extension should be considered *equivalent* to the other three. That's what I understand it to mean, anyway.
https://github.com/riscv/riscv-bThere's no point in supporting "b" in devicetree to represent the others if it also requires the others to be present.
The dependency can be go both ways, to also make specifying "b" mandatory when the three components are. That probably produces the most helpful devicetree ultimately.
Quoted 7 lines
I think that, instead, "b", "zba", "zbb", and "zbs" should all be allowed.
I might even go further and harden the requirement, saying that if you specify "b" you should *not* specify "zba", "zbb", or "zbs". But that might not be normal practice, and it's not necessary because they aren't in conflict.
I disagree completely with this "even further", since that's potentially actively harmful to importers of kernel devicetrees.
If "b" is to be allowed, I'm only in favour if having it requires the component parts.
Re: [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description
Quoted 74 lines · Conor Dooley
Quoted 73 lines · Alex Elder
Quoted 59 lines · Guodong Xu
Hi, Conor
Quoted 51 lines · Conor Dooley
Quoted 36 lines · Guodong Xu
Add description of the single-letter "B" extennsion 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.
Hence add a schema check rule to enforce that B implies Zba, Zbb and Zbs.
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +7
-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 ratifiedDocumentation/devicetree/bindings/riscv/extensions.yaml properties: · line 748
Quoted 7 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +4
-0@@ -735,6 +742,18 @@ properties: then: contains: const: f + # b comprises the following extensions + - if: + contains: + const: bWhat's the value in adding b, if it depends on having all 3 of the components defined individually too? Currently all "superset" types of extensions are permitted without their component parts also being defined, this doesn't follow convention and therefore needs to be explained.
Quoted 4 lines
You obviously need this construct because the kernel does not understand "b", and even if you added support for interpreting "b" to the kernel this is probably still needed to make sure the ABI is maintained for anything importing a devicetree from the kernel.
Quoted 6 lines
Yes, exactly. Unlike other single-letter extensions, "b" was ratified (Apr/2024) much later than its components zba/zbb/zbs (Jun/2021). Existing software and the kernel already expect these explicit component strings, so enforcing this dependency ensures cores declaring "b" will also be correctly understood by older software that only looks for zba/zbb/zbs.
I might be misunderstanding you, but I don't think extension "b" should *require* the other three extensions. Instead, the "b" extension should be considered *equivalent* to the other three. That's what I understand it to mean, anyway.
https://github.com/riscv/riscv-b
Quoted 6 lines
Quoted 2 lines
There's no point in supporting "b" in devicetree to represent the others if it also requires the others to be present.
The dependency can be go both ways, to also make specifying "b" mandatory when the three components are. That probably produces the most helpful devicetree ultimately.
What about DT files that specified zba+zbb+zbs before "b" was ratified?
Quoted 10 lines
Quoted 7 lines
I think that, instead, "b", "zba", "zbb", and "zbs" should all be allowed.
I might even go further and harden the requirement, saying that if you specify "b" you should *not* specify "zba", "zbb", or "zbs". But that might not be normal practice, and it's not necessary because they aren't in conflict.
I disagree completely with this "even further", since that's potentially actively harmful to importers of kernel devicetrees.
This is related to one of the things I mentioned to Rob that I wanted to discuss.
This type of "equivalent" extension is problematic for DT, or I guess, it doesn't really add any value. I'm sure the people ratifying "b" to be equivalent to "zba+zbb+zbs" intend for it to simplify how the supported extensions are represented.
But it actually complicates things for DT. If you're going to support just "b" (which would be simpler and more concise) then there needs to be logic that treats the two possibilities as equivalent. But old software won't recognize new DT files that contain only the newer (e.g. "b") extension.
So I agree, there's active harm in doing what I suggested.
But why even bother supporting "b" if you have to *also* support "zba+zbb+zbs" if you use it? It adds the possibility of new errors ("b" without "zbs", for example), while not really enabling or representing anything new.
Quoted 2 lines
If "b" is to be allowed, I'm only in favour if having it requires the component parts.
I'd opt for ignoring the "b" extension, and any other "simplified" extensions that simply represent a specific set of other extensions and nothing more. At least for DT.
That said, this "rule" would have to be followed/agreed to by all users of DT.
-Alex
Re: [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description
Quoted 78 lines · Alex Elder
Quoted 77 lines · Conor Dooley
Quoted 75 lines · Alex Elder
Quoted 59 lines · Guodong Xu
Hi, Conor
Quoted 51 lines · Conor Dooley
Quoted 36 lines · Guodong Xu
Add description of the single-letter "B" extennsion 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.
Hence add a schema check rule to enforce that B implies Zba, Zbb and Zbs.
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +7
-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 ratifiedDocumentation/devicetree/bindings/riscv/extensions.yaml properties: · line 748
Quoted 7 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +4
-0@@ -735,6 +742,18 @@ properties: then: contains: const: f + # b comprises the following extensions + - if: + contains: + const: bWhat's the value in adding b, if it depends on having all 3 of the components defined individually too? Currently all "superset" types of extensions are permitted without their component parts also being defined, this doesn't follow convention and therefore needs to be explained.
Quoted 4 lines
You obviously need this construct because the kernel does not understand "b", and even if you added support for interpreting "b" to the kernel this is probably still needed to make sure the ABI is maintained for anything importing a devicetree from the kernel.
Quoted 6 lines
Yes, exactly. Unlike other single-letter extensions, "b" was ratified (Apr/2024) much later than its components zba/zbb/zbs (Jun/2021). Existing software and the kernel already expect these explicit component strings, so enforcing this dependency ensures cores declaring "b" will also be correctly understood by older software that only looks for zba/zbb/zbs.
I might be misunderstanding you, but I don't think extension "b" should *require* the other three extensions. Instead, the "b" extension should be considered *equivalent* to the other three. That's what I understand it to mean, anyway.
https://github.com/riscv/riscv-bThere's no point in supporting "b" in devicetree to represent the others if it also requires the others to be present.
Quoted 6 lines
Quoted 3 lines
The dependency can be go both ways, to also make specifying "b" mandatory when the three components are. That probably produces the most helpful devicetree ultimately.
What about DT files that specified zba+zbb+zbs before "b" was ratified?
They'd generate a warning, which can then be fixed. That's fine to do, a warning in linux-next doesn't harm anyone. Updating devicetrees in ways that don't change their meaning but provide extra value is not a problem in my book.
Quoted 25 lines
Quoted 10 lines
Quoted 7 lines
I think that, instead, "b", "zba", "zbb", and "zbs" should all be allowed.
I might even go further and harden the requirement, saying that if you specify "b" you should *not* specify "zba", "zbb", or "zbs". But that might not be normal practice, and it's not necessary because they aren't in conflict.
I disagree completely with this "even further", since that's potentially actively harmful to importers of kernel devicetrees.
This is related to one of the things I mentioned to Rob that I wanted to discuss.
This type of "equivalent" extension is problematic for DT, or I guess, it doesn't really add any value. I'm sure the people ratifying "b" to be equivalent to "zba+zbb+zbs" intend for it to simplify how the supported extensions are represented.
But it actually complicates things for DT. If you're going to support just "b" (which would be simpler and more concise) then there needs to be logic that treats the two possibilities as equivalent. But old software won't recognize new DT files that contain only the newer (e.g. "b") extension.
Quoted 6 lines
So I agree, there's active harm in doing what I suggested.
But why even bother supporting "b" if you have to *also* support "zba+zbb+zbs" if you use it? It adds the possibility of new errors ("b" without "zbs", for example), while not really enabling or representing anything new.
That was my first question after all! Ultimately I'd really err on the side of adding it because people will expect to be able to use it and because, in terms of kernel support, it will be useful for ACPI systems.
Re: [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description
Quoted 17 lines · Conor Dooley
Quoted 16 lines · Alex Elder
Quoted 15 lines · Conor Dooley
Quoted 14 lines · Alex Elder
Quoted 13 lines · Guodong Xu
Hi, Conor
Quoted 10 lines · Conor Dooley
Quoted 8 lines · Guodong Xu
Add description of the single-letter "B" extennsion 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.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Hence add a schema check rule to enforce that B implies Zba, Zbb and Zbs.
Signed-off-by Guodong Xu <[email protected]>---
. . .
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines
The dependency can be go both ways, to also make specifying "b" mandatory when the three components are. That probably produces the most helpful devicetree ultimately.
What about DT files that specified zba+zbb+zbs before "b" was ratified?
They'd generate a warning, which can then be fixed. That's fine to do, a warning in linux-next doesn't harm anyone. Updating devicetrees in ways that don't change their meaning but provide extra value is not a problem in my book.
OK.
. . .
Quoted 8 lines
Quoted 4 lines
But why even bother supporting "b" if you have to *also* support "zba+zbb+zbs" if you use it? It adds the possibility of new errors ("b" without "zbs", for example), while not really enabling or representing anything new.
That was my first question after all! Ultimately I'd really err on the side of adding it because people will expect to be able to use it and because, in terms of kernel support, it will be useful for ACPI systems.
I think it's too bad these "equivalent" extensions can't be used to simplify things.
I really dislike requiring the both a simpler extension *and* the others that it represents/implies.
But practically speaking you're probably right. People will expect to be able to use them. DT tools will then point out what's missing, and the list of extensions supported by a given CPU will just grow and grow and grow.
-Alex
Re: [PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description
Quoted 5 lines · Alex Elder
I think it's too bad these "equivalent" extensions can't be used to simplify things.
I really dislike requiring the both a simpler extension *and* the others that it represents/implies.
They generally have been done they way you'd expect, this one just differs because b is being added much later on rather than at the same time.
PATCH v2 8/13 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
Since Ziccamoa depends on the 'A' extension, add a schema check to enforce this dependency.
---
v2: New patch.
--- .../devicetree/bindings/riscv/extensions.yaml | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +34 -0
@@ -237,6 +237,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
@@ -378,6 +384,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
@@ -795,6 +822,13 @@ properties: then: contains: const: f + # Ziccamoa depends on A + - if: + contains: + const: ziccamoa + then: + contains: + const: a # Zvfbfmin depends on V or Zve32f - if: contains:
Signature · 1 line
2.43.0
Re: [PATCH v2 08/13] dt-bindings: riscv: Add descriptions for Za64rs, Ziccamoa, Ziccif, and Zicclsm
Quoted 3 lines · Guodong Xu
Add 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.").
I think stating the RISC-V profiles commit ID here (in the commit header) is good.
I do *not* think it's necessary to include it in the descriptions for the extensions, below, but I seem to be late to the party in expressing this opinion...
That commit ID is related to this repository:
https://github.com/riscv/riscv-profiles.git
I have a few other comments below but generally I think what you did looks good. I have one overall question though.
Quoted 9 lines
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
I did not verify your statements about where these are optional and mandatory, but I assume they're correct.
Quoted 2 lines
Since Ziccamoa depends on the 'A' extension, add a schema check to enforce this dependency.
All of these extensions are related to atomic operations, right? Don't *all* of them (not just Ziccamoa) depend on the A extension? Furthermore, the A extension is already mandated by RVA23U64, so is it really necessary to add this logic?
Quoted 12 lines
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +0
-0
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 244
Quoted 8 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +5
-0@@ -237,6 +237,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.")
The more complete description says:
Reservation sets are contiguous, naturally aligned, and a maximum of 64 bytes.
But as I read on (below) I suppose using the more succinct description from the glossary might be best, forcing people who care to go look at the reference documents.
Quoted 5 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +1
-0+ - const: zaamo description: | The standard Zaamo extension for atomic memory operations as
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 392
Quoted 9 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +6
-0@@ -378,6 +384,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.")
Similar comment here (but also with a similar caveat):
Main memory regions with both the cacheability and coherence PMAs must support all atomics in A.
And I might say "the A extension", but maybe that's a bad idea.
Quoted 19 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +15
-0+ + - 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
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 825
Quoted 4 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +1
-0@@ -795,6 +822,13 @@ properties: then: contains: const: f + # Ziccamoa depends on A
Maybe more than just depends on the A extension.
-Alex
Quoted 10 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +6
-0+ - if: + contains: + const: ziccamoa + then: + contains: + const: a # Zvfbfmin depends on V or Zve32f - if: contains:
Re: [PATCH v2 08/13] dt-bindings: riscv: Add descriptions for Za64rs, Ziccamoa, Ziccif, and Zicclsm
Hi, Alex, Conor
Quoted 13 lines · Alex Elder
Quoted 3 lines · Guodong Xu
Add 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.").I think stating the RISC-V profiles commit ID here (in the commit header) is good.
I do *not* think it's necessary to include it in the descriptions for the extensions, below, but I seem to be late to the party in expressing this opinion...
Quoted 9 lines
That commit ID is related to this repository:
https://github.com/riscv/riscv-profiles.gitI have a few other comments below but generally I think what you did looks good. I have one overall question though.
Quoted 3 lines
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
Thank you for the review.
Together with the filenames, I also listed the Version numbers.
These are officially released versions of profile documents. I mean they won't be changed without modifying the version number.
Quoted 9 lines
Quoted 6 lines
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, RVA23U64I did not verify your statements about where these are optional and mandatory, but I assume they're correct.
Yes they are correct. As far as what stated in the two profile documents.
Quoted 6 lines
Quoted 3 lines
Since Ziccamoa depends on the 'A' extension, add a schema check to enforce this dependency.
All of these extensions are related to atomic operations, right? Don't *all* of them (not just Ziccamoa) depend on the A extension?
Za64rs and Zicclsm: no, they are not 'A'. They are cache related.
Ziccrse and Ziccamoa: yes, they are 'A' related.
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.
And in RVA profiles, two named features (exts) are added:
Ziccrse: which further define the level of LR/SC operations being supported.
Ziccamoa: which further define the level of AMOs instructions being supported.
We already know that "A" = Zaamo + Zalrsc;
In summary, the dependencies among these extensions are:
Ziccrse -> Zalrsc -> A;
Ziccamoa -> Zaamo -> A;
Quoted 2 lines
Furthermore, the A extension is already mandated by RVA23U64, so is it really necessary to add this logic?
Hi, Conor
What do you think? I am kind of agree with Alex to remove the schema checking logic.
Leaving the dependency check to riscv/cpufeature.c, let the .validate call do the job. If you agree, I can remove the schema checking logic on Ziccamoa and A in my next version.
Btw, cpufeature.c validate() deserves another patch/patchset. I'll be happy to add that if we reach a consensus here.
Quoted 25 lines
Quoted 14 lines
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +0
-0Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 244
Quoted 8 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +5
-0@@ -237,6 +237,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.")The more complete description says:
Quoted 5 lines
Reservation sets are contiguous, naturally aligned, and a maximum of 64 bytes.
But as I read on (below) I suppose using the more succinct description from the glossary might be best, forcing people who care to go look
That is exactly what I am doing.
Quoted 10 lines
at the reference documents.
Quoted 8 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +1
-0+ - const: zaamo description: | The standard Zaamo extension for atomic memory operations as@@ -378,6 +384,27 @@ properties: in commit 64074bc ("Update version numbers for Zfh/Zfinx") of riscv-isa-manual.
Quoted 9 lines
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 392
Quoted 6 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +6
-0+ - 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.")Similar comment here (but also with a similar caveat):
I am using what the RVA23 Profile defines:
"Ziccamoa: Main memory supports all atomics in A"
I prefer to keep it as is.
BR,
Guodong
Quoted 44 lines
Main memory regions with both the cacheability and coherence PMAs must support all atomics in A.
And I might say "the A extension", but maybe that's a bad idea.
Quoted 19 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +15
-0+ + - 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 progressDocumentation/devicetree/bindings/riscv/extensions.yaml properties: · line 825
Quoted 4 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +1
-0@@ -795,6 +822,13 @@ properties: then: contains: const: f + # Ziccamoa depends on AMaybe more than just depends on the A extension.
-Alex
Quoted 10 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +6
-0+ - if: + contains: + const: ziccamoa + then: + contains: + const: a # Zvfbfmin depends on V or Zve32f - if: contains:
Re: [PATCH v2 08/13] dt-bindings: riscv: Add descriptions for Za64rs, Ziccamoa, Ziccif, and Zicclsm
Quoted 46 lines · Guodong Xu
Hi, Alex, Conor
Quoted 13 lines · Alex Elder
Quoted 3 lines · Guodong Xu
Add 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.").I think stating the RISC-V profiles commit ID here (in the commit header) is good.
I do *not* think it's necessary to include it in the descriptions for the extensions, below, but I seem to be late to the party in expressing this opinion...
Quoted 9 lines
That commit ID is related to this repository:
https://github.com/riscv/riscv-profiles.gitI have a few other comments below but generally I think what you did looks good. I have one overall question though.
Quoted 3 lines
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
Thank you for the review.
Together with the filenames, I also listed the Version numbers.
These are officially released versions of profile documents. I mean they won't be changed without modifying the version number.
Quoted 9 lines
Quoted 6 lines
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, RVA23U64I did not verify your statements about where these are optional and mandatory, but I assume they're correct.
Yes they are correct. As far as what stated in the two profile documents.
Quoted 1 line
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Since Ziccamoa depends on the 'A' extension, add a schema check to enforce this dependency.
All of these extensions are related to atomic operations, right? Don't *all* of them (not just Ziccamoa) depend on the A extension?
Za64rs and Zicclsm: no, they are not 'A'. They are cache related.
Isn't a Za64rs reservation set related to atomic operations, though? They are related to load-reserved/store conditional instructions, which are introduced in the atomic instructions section.
I was mistaken about Zicclsm, that's related to unaligned accesses, but does not apply to atomic operations.
Quoted 20 lines
Ziccrse and Ziccamoa: yes, they are 'A' related.
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.
And in RVA profiles, two named features (exts) are added:
Ziccrse: which further define the level of LR/SC operations being supported.
Ziccamoa: which further define the level of AMOs instructions being supported.We already know that "A" = Zaamo + Zalrsc;
In summary, the dependencies among these extensions are:
Ziccrse -> Zalrsc -> A;
Ziccamoa -> Zaamo -> A;Quoted 2 lines
Furthermore, the A extension is already mandated by RVA23U64, so is it really necessary to add this logic?
Quoted 8 lines
Hi, Conor
What do you think? I am kind of agree with Alex to remove the schema checking logic.
Leaving the dependency check to
riscv/cpufeature.c, let the .validate call do the job. If you agree, I can remove the schema checking logic on Ziccamoa and A in my next version.
Yes I think this is a better way to handle it. Conor?
Quoted 2 lines
Btw,
cpufeature.cvalidate()deserves another patch/patchset. I'll be happy to add that if we reach a consensus here.
Yes I think you should do this once there is concensus.
Quoted 54 lines
Quoted 26 lines
Quoted 15 lines
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +0
-0Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 244
Quoted 8 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +5
-0@@ -237,6 +237,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.")The more complete description says:
Quoted 5 lines
Reservation sets are contiguous, naturally aligned, and a maximum of 64 bytes.
But as I read on (below) I suppose using the more succinct description from the glossary might be best, forcing people who care to go look
That is exactly what I am doing.
Quoted 10 lines
at the reference documents.
Quoted 8 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +1
-0+ - const: zaamo description: | The standard Zaamo extension for atomic memory operations as@@ -378,6 +384,27 @@ properties: in commit 64074bc ("Update version numbers for Zfh/Zfinx") of riscv-isa-manual.Quoted 9 lines
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 392
Quoted 6 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +6
-0+ - 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.")Similar comment here (but also with a similar caveat):
Quoted 4 lines
I am using what the RVA23 Profile defines:
"Ziccamoa: Main memory supports all atomics in A"I prefer to keep it as is.
That's fine. I don't think I felt strongly about any of the things I said about the exact wording used here.
Thanks.
-Alex
Quoted 47 lines
BR,
GuodongQuoted 44 lines
Main memory regions with both the cacheability and coherence PMAs must support all atomics in A.
And I might say "the A extension", but maybe that's a bad idea.
Quoted 19 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +15
-0+ + - 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 progressDocumentation/devicetree/bindings/riscv/extensions.yaml properties: · line 825
Quoted 4 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +1
-0@@ -795,6 +822,13 @@ properties: then: contains: const: f + # Ziccamoa depends on AMaybe more than just depends on the A extension.
-Alex
Quoted 10 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +6
-0+ - if: + contains: + const: ziccamoa + then: + contains: + const: a # Zvfbfmin depends on V or Zve32f - if: contains:
Re: [PATCH v2 08/13] dt-bindings: riscv: Add descriptions for Za64rs, Ziccamoa, Ziccif, and Zicclsm
Quoted 55 lines · Alex Elder
Quoted 53 lines · Guodong Xu
Hi, Alex, Conor
Quoted 13 lines · Alex Elder
Quoted 3 lines · Guodong Xu
Add 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.").I think stating the RISC-V profiles commit ID here (in the commit header) is good.
I do *not* think it's necessary to include it in the descriptions for the extensions, below, but I seem to be late to the party in expressing this opinion...
Quoted 9 lines
That commit ID is related to this repository:
https://github.com/riscv/riscv-profiles.gitI have a few other comments below but generally I think what you did looks good. I have one overall question though.
Quoted 3 lines
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
Thank you for the review.
Together with the filenames, I also listed the Version numbers.
These are officially released versions of profile documents. I mean they won't be changed without modifying the version number.
Quoted 9 lines
Quoted 6 lines
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, RVA23U64I did not verify your statements about where these are optional and mandatory, but I assume they're correct.
Yes they are correct. As far as what stated in the two profile documents.
Quoted 6 lines
Quoted 3 lines
Since Ziccamoa depends on the 'A' extension, add a schema check to enforce this dependency.
All of these extensions are related to atomic operations, right? Don't *all* of them (not just Ziccamoa) depend on the A extension?
Quoted 6 lines
Quoted 1 line
Za64rs and Zicclsm: no, they are not 'A'. They are cache related.
Isn't a Za64rs reservation set related to atomic operations, though? They are related to load-reserved/store conditional instructions, which are introduced in the atomic instructions section.
Yes, you are right. Let me update the relationship:
Za64rs defines a hard's reservation set implementation detail.
It is consumed by two extensions: Zalrsc and Zawrs.
Za64rs -> Zalrsc -> A
Za64rs -> Zawrs -> Zalrsc -> A
I would say maybe all these relationships deserve to be validated in cpufeature.c (so far, they are not.)
BR,
Guodong Xu
Quoted 156 lines
I was mistaken about Zicclsm, that's related to unaligned accesses, but does not apply to atomic operations.
Quoted 20 lines
Ziccrse and Ziccamoa: yes, they are 'A' related.
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.
And in RVA profiles, two named features (exts) are added:
Ziccrse: which further define the level of LR/SC operations being supported.
Ziccamoa: which further define the level of AMOs instructions being supported.We already know that "A" = Zaamo + Zalrsc;
In summary, the dependencies among these extensions are:
Ziccrse -> Zalrsc -> A;
Ziccamoa -> Zaamo -> A;Quoted 2 lines
Furthermore, the A extension is already mandated by RVA23U64, so is it really necessary to add this logic?
Quoted 8 lines
Hi, Conor
What do you think? I am kind of agree with Alex to remove the schema checking logic.
Leaving the dependency check to
riscv/cpufeature.c, let the .validate call do the job. If you agree, I can remove the schema checking logic on Ziccamoa and A in my next version.Yes I think this is a better way to handle it. Conor?
Quoted 2 lines
Btw,
cpufeature.cvalidate()deserves another patch/patchset. I'll be happy to add that if we reach a consensus here.Yes I think you should do this once there is concensus.
Quoted 54 lines
Quoted 26 lines
Quoted 15 lines
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +0
-0Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 244
Quoted 8 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +5
-0@@ -237,6 +237,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.")The more complete description says:
Quoted 5 lines
Reservation sets are contiguous, naturally aligned, and a maximum of 64 bytes.
But as I read on (below) I suppose using the more succinct description from the glossary might be best, forcing people who care to go look
That is exactly what I am doing.
Quoted 10 lines
at the reference documents.
Quoted 8 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +1
-0+ - const: zaamo description: | The standard Zaamo extension for atomic memory operations as@@ -378,6 +384,27 @@ properties: in commit 64074bc ("Update version numbers for Zfh/Zfinx") of riscv-isa-manual.Quoted 9 lines
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 392
Quoted 6 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +6
-0+ - 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.")Similar comment here (but also with a similar caveat):
Quoted 4 lines
I am using what the RVA23 Profile defines:
"Ziccamoa: Main memory supports all atomics in A"I prefer to keep it as is.
That's fine. I don't think I felt strongly about any of the things I said about the exact wording used here.
Thanks.
-Alex
Quoted 47 lines
BR,
GuodongQuoted 44 lines
Main memory regions with both the cacheability and coherence PMAs must support all atomics in A.
And I might say "the A extension", but maybe that's a bad idea.
Quoted 19 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +15
-0+ + - 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 progressDocumentation/devicetree/bindings/riscv/extensions.yaml properties: · line 825
Quoted 4 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +1
-0@@ -795,6 +822,13 @@ properties: then: contains: const: f + # Ziccamoa depends on AMaybe more than just depends on the A extension.
-Alex
Quoted 10 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +6
-0+ - if: + contains: + const: ziccamoa + then: + contains: + const: a # Zvfbfmin depends on V or Zve32f - if: contains:
PATCH v2 9/13 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
---
v2: New patch.
--- .../devicetree/bindings/riscv/extensions.yaml | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +32 -0
@@ -160,12 +160,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
@@ -178,6 +192,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 v2 09/13] dt-bindings: riscv: Add Ssccptr, Sscounterenw, Sstvala, Sstvecd, Ssu64xl
Quoted 9 lines · Guodong Xu
Add 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:
Quoted 5 lines
- 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
Again, I did not verify your statements about where these are optional and mandatory, but I assume they're correct.
Quoted 24 lines
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +7
-0@@ -160,12 +160,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: |
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 181
Quoted 10 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +6
-0The 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.")
Maybe you should just copy the text from the RVA23 specification for all of these. So something like:
For any hpmcounter that is not read-only zero, the corresponding bit in scounteren must be writable. This was ratified in the RISC-V Profiles specification version 1.0, with commit ...
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 199
Quoted 13 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +6
-0+ - const: ssnpm description: | The standard Ssnpm extension for next-mode pointer masking as@@ -178,6 +192,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.")
Or alternative to the full text in the spec, you could copy over the abbreviated description listed in the glossary at the end instead. Something like:
stval provides all needed values. This was ratified in...
-Alex
Quoted 17 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +13
-0+ + - 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
Re: [PATCH v2 09/13] dt-bindings: riscv: Add Ssccptr, Sscounterenw, Sstvala, Sstvecd, Ssu64xl
Hi, Alex
Quoted 11 lines · Alex Elder
Quoted 9 lines · Guodong Xu
Add 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:
Quoted 8 lines
Quoted 5 lines
- 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 RVA23S64Again, I did not verify your statements about where these are optional and mandatory, but I assume they're correct.
Thanks for the review.
As mentioned in my response to patch 8, the requirement status for these extensions is clearly defined in the RISC-V Profiles specification(s) which I mentioned above.
I have verified these details against the official document to ensure accuracy.
The extension descriptions are included in the commit message to provide necessary background information.
Quoted 29 lines
Quoted 29 lines
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +7
-0@@ -160,12 +160,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.
Quoted 4 lines
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 179
Quoted 4 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +4
-0+ - const: sscounterenw + description: | + The standard Sscounterenw extension for support writable enables + in scounteren for any supported counter, as ratified in RISC-V
Here, I used the abbreviated version. See below.
Quoted 10 lines
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 181
Quoted 2 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +2
-0+ Profiles Version 1.0, with commit b1d806605f87 ("Updated to + ratified state.")Maybe you should just copy the text from the RVA23 specification for all of these. So something like:
For any hpmcounter that is not read-only zero, the corresponding bit in scounteren must be writable. This was ratified in the RISC-V Profiles specification version 1.0, with commit ...
As you noticed, the RVA23 Profile v1.0 provides two versions of explanation for Sscounterenw:
"Sscounterenw: For any hpmcounter that is not read-only zero, the corresponding bit in scounteren must be writable"
"Sscounterenw: Support writeable enables for any supported counter"
BR,
Guodong Xu
Quoted 40 lines
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 199
Quoted 13 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +6
-0+ - const: ssnpm description: | The standard Ssnpm extension for next-mode pointer masking as@@ -178,6 +192,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.")Or alternative to the full text in the spec, you could copy over the abbreviated description listed in the glossary at the end instead. Something like:
stval provides all needed values. This was ratified in...
-Alex
Quoted 17 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +13
-0+ + - 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
Re: [PATCH v2 09/13] dt-bindings: riscv: Add Ssccptr, Sscounterenw, Sstvala, Sstvecd, Ssu64xl
Quoted 23 lines · Guodong Xu
Hi, Alex
Quoted 11 lines · Alex Elder
Quoted 9 lines · Guodong Xu
Add 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:
Quoted 8 lines
Quoted 5 lines
- 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 RVA23S64Again, I did not verify your statements about where these are optional and mandatory, but I assume they're correct.
Quoted 8 lines
Thanks for the review.
As mentioned in my response to patch 8, the requirement status for these extensions is clearly defined in the RISC-V Profiles specification(s) which I mentioned above.
I have verified these details against the official document to ensure accuracy.
Right, my comment here was just to be transparent that *I* did not check this, and am trusting that what you said is right. Thanks for confirming.
-Alex
Quoted 99 lines
The extension descriptions are included in the commit message to provide necessary background information.
Quoted 29 lines
Quoted 29 lines
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +7
-0@@ -160,12 +160,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.Quoted 4 lines
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 179
Quoted 4 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +4
-0+ - const: sscounterenw + description: | + The standard Sscounterenw extension for support writable enables + in scounteren for any supported counter, as ratified in RISC-VHere, I used the abbreviated version. See below.
Quoted 10 lines
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 181
Quoted 2 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +2
-0+ Profiles Version 1.0, with commit b1d806605f87 ("Updated to + ratified state.")Maybe you should just copy the text from the RVA23 specification for all of these. So something like:
For any hpmcounter that is not read-only zero, the corresponding bit in scounteren must be writable. This was ratified in the RISC-V Profiles specification version 1.0, with commit ...
As you noticed, the RVA23 Profile v1.0 provides two versions of explanation for Sscounterenw:
"Sscounterenw: For any hpmcounter that is not read-only zero, the corresponding bit in scounteren must be writable"
"Sscounterenw: Support writeable enables for any supported counter"BR,
Guodong XuQuoted 40 lines
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 199
Quoted 13 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +6
-0+ - const: ssnpm description: | The standard Ssnpm extension for next-mode pointer masking as@@ -178,6 +192,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.")Or alternative to the full text in the spec, you could copy over the abbreviated description listed in the glossary at the end instead. Something like:
stval provides all needed values. This was ratified in...
-Alex
Quoted 17 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +13
-0+ + - 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
PATCH v2 10/13 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
Add schema checks to enforce that Sha implies the presence of all its comprised extensions.
---
v2: New patch.
--- .../devicetree/bindings/riscv/extensions.yaml | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +79 -0
@@ -128,6 +128,57 @@ properties: version of the privileged ISA specification. # 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
@@ -186,6 +237,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
@@ -813,6 +870,28 @@ properties: const: zbb - contains: const: zbs + # sha comprises the following extensions + - if: + contains: + const: sha + then: + allOf: + - contains: + const: h + - contains: + const: shcounterenw + - contains: + const: shgatpa + - contains: + const: shtvala + - contains: + const: shvsatpa + - contains: + const: shvstvala + - contains: + const: shvstvecd + - contains: + const: ssstateen # Zcb depends on Zca - if: contains:
Signature · 1 line
2.43.0
Re: [PATCH v2 10/13] 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 2 lines
Add schema checks to enforce that Sha implies the presence of all its comprised extensions.
Like patch 7 in your series, I *think* what you're doing in trying to imply the presence of these other extensions is actually requiring all those extensions to be present *in addition* to just "Sha". I don't think that's what we want.
-Alex
Quoted 112 lines
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +79
-0@@ -128,6 +128,57 @@ properties: version of the privileged ISA specification. # 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@@ -186,6 +237,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@@ -813,6 +870,28 @@ properties: const: zbb - contains: const: zbs + # sha comprises the following extensions + - if: + contains: + const: sha + then: + allOf: + - contains: + const: h + - contains: + const: shcounterenw + - contains: + const: shgatpa + - contains: + const: shtvala + - contains: + const: shvsatpa + - contains: + const: shvstvala + - contains: + const: shvstvecd + - contains: + const: ssstateen # Zcb depends on Zca - if: contains:
Re: [PATCH v2 10/13] dt-bindings: riscv: Add Sha and its comprised extensions
Hi, Alex
Quoted 27 lines · Alex Elder
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 8 lines
Quoted 2 lines
Add schema checks to enforce that Sha implies the presence of all its comprised extensions.
Like patch 7 in your series, I *think* what you're doing in trying to imply the presence of these other extensions is actually requiring all those extensions to be present *in addition* to just "Sha". I don't think that's what we want.
I tend to think this schema check block should be removed. Conor expressed similar design logic in his comments to my Patch 7/13 of v2 series.
If there is no objection, I will remove it.
BR,
Guodong
Quoted 116 lines
-Alex
Quoted 112 lines
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +79
-0@@ -128,6 +128,57 @@ properties: version of the privileged ISA specification. # 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@@ -186,6 +237,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@@ -813,6 +870,28 @@ properties: const: zbb - contains: const: zbs + # sha comprises the following extensions + - if: + contains: + const: sha + then: + allOf: + - contains: + const: h + - contains: + const: shcounterenw + - contains: + const: shgatpa + - contains: + const: shtvala + - contains: + const: shvsatpa + - contains: + const: shvstvala + - contains: + const: shvstvecd + - contains: + const: ssstateen # Zcb depends on Zca - if: contains:
Re: [PATCH v2 10/13] dt-bindings: riscv: Add Sha and its comprised extensions
Quoted 39 lines · Guodong Xu
Hi, Alex
Quoted 27 lines · Alex Elder
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 RVA23S64Quoted 8 lines
Quoted 2 lines
Add schema checks to enforce that Sha implies the presence of all its comprised extensions.
Like patch 7 in your series, I *think* what you're doing in trying to imply the presence of these other extensions is actually requiring all those extensions to be present *in addition* to just "Sha". I don't think that's what we want.
Quoted 4 lines
I tend to think this schema check block should be removed. Conor expressed similar design logic in his comments to my Patch 7/13 of v2 series.
If there is no objection, I will remove it.
Sounds good. -Alex
Quoted 120 lines
BR,
GuodongQuoted 116 lines
-Alex
Quoted 112 lines
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- .../devicetree/bindings/riscv/extensions.yaml | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +79
-0@@ -128,6 +128,57 @@ properties: version of the privileged ISA specification. # 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@@ -186,6 +237,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@@ -813,6 +870,28 @@ properties: const: zbb - contains: const: zbs + # sha comprises the following extensions + - if: + contains: + const: sha + then: + allOf: + - contains: + const: h + - contains: + const: shcounterenw + - contains: + const: shgatpa + - contains: + const: shtvala + - contains: + const: shvsatpa + - contains: + const: shvstvala + - contains: + const: shvstvecd + - contains: + const: ssstateen # Zcb depends on Zca - if: contains:
PATCH v2 11/13 dt-bindings: riscv: Add Supm extension description
In reply to Guodong XuAdd description for the Supm extension. Supm indicates support for pointer masking in user mode. Supm is mandatory for RVA23S64.
The Supm extension is ratified in commit d70011dde6c2 ("Update to ratified state") of riscv-j-extension.
Supm depends on either Smnpm or Ssnpm, so add a schema check to enforce this dependency.
---
v2: New patch.
--- Documentation/devicetree/bindings/riscv/extensions.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +16 -0
@@ -267,6 +267,12 @@ properties: ratified in RISC-V Profiles Version 1.0, with commit b1d806605f87 ("Updated to ratified state.") + - const: supm + description: | + The standard Supm extension for pointer masking support in user + mode as ratified at commit d70011dde6c2 ("Update to ratified state") + of riscv-j-extension. + - const: svade description: | The standard Svade supervisor-level extension for SW-managed PTE A/D
@@ -892,6 +898,16 @@ properties: const: shvstvecd - contains: const: ssstateen + # Supm depends on either Smnpm or Ssnpm + - if: + contains: + const: supm + then: + anyOf: + - contains: + const: smnpm + - contains: + const: ssnpm # Zcb depends on Zca - if: contains:
Signature · 1 line
2.43.0
Re: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description
Quoted 21 lines · Guodong Xu
Add description for the Supm extension. Supm indicates support for pointer masking in user mode. Supm is mandatory for RVA23S64.
The Supm extension is ratified in commit
d70011dde6c2("Update to ratified state") of riscv-j-extension.Supm depends on either Smnpm or Ssnpm, so add a schema check to enforce this dependency.
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- Documentation/devicetree/bindings/riscv/extensions.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +0
-0
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 274
Quoted 8 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +5
-0@@ -267,6 +267,12 @@ properties: ratified in RISC-V Profiles Version 1.0, with commit b1d806605f87 ("Updated to ratified state.") + - const: supm + description: | + The standard Supm extension for pointer masking support in user + mode as ratified at commit d70011dde6c2 ("Update to ratified state") + of riscv-j-extension.
I'm not yet convinced that this makes sense as this describes how the consumer of the devicetree behaves not the hardware. How the hardware behaves is already described by smnpn and ssnpm. I'd really like to see some commentary from Samuel Holland on either this or on
https://lore.kernel.org/all/20251222-dimmer-wooing-db29fe925498@spud/
before I'd be happy with this change.
Quoted 25 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +11
-0+ - const: svade description: | The standard Svade supervisor-level extension for SW-managed PTE A/D@@ -892,6 +898,16 @@ properties: const: shvstvecd - contains: const: ssstateen + # Supm depends on either Smnpm or Ssnpm + - if: + contains: + const: supm + then: + anyOf: + - contains: + const: smnpm + - contains: + const: ssnpm # Zcb depends on Zca - if: contains:Signature · 2 lines
-- 2.43.0
Re: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description
In reply to Guodong XuQuoted 8 lines · Guodong Xu
Add description for the Supm extension. Supm indicates support for pointer masking in user mode. Supm is mandatory for RVA23S64.
The Supm extension is ratified in commit
d70011dde6c2("Update to ratified state") of riscv-j-extension.Supm depends on either Smnpm or Ssnpm, so add a schema check to enforce this dependency.
I have the same general question on this, about whether it's really necessary for the DT binding to enforce these requirements. The RISC-V specifications are what truly defines their meaning, so I don't really see why the DT framework should need to enforce them. (That said, I'm sure there are other cases where DT enforces things it shouldn't have to.)
And now, having looked at these added binding definitions (in patches 07 through 11 in this series), I wonder what exactly is required for them to be accepted. For the most part these seem to just be defining how the extensions specified for RISC-V are to be expressed in DT files. It seems to be a fairly straightforward copy from the ratified specification(s) to the YAML format.
Who need to sign off on it? Conor? Paul? DT maintainers?
Thanks.
-Alex
Quoted 42 lines
Signed-off-by Guodong Xu <[email protected]>---
v2: New patch.--- Documentation/devicetree/bindings/riscv/extensions.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +16
-0@@ -267,6 +267,12 @@ properties: ratified in RISC-V Profiles Version 1.0, with commit b1d806605f87 ("Updated to ratified state.") + - const: supm + description: | + The standard Supm extension for pointer masking support in user + mode as ratified at commit d70011dde6c2 ("Update to ratified state") + of riscv-j-extension. + - const: svade description: | The standard Svade supervisor-level extension for SW-managed PTE A/D@@ -892,6 +898,16 @@ properties: const: shvstvecd - contains: const: ssstateen + # Supm depends on either Smnpm or Ssnpm + - if: + contains: + const: supm + then: + anyOf: + - contains: + const: smnpm + - contains: + const: ssnpm # Zcb depends on Zca - if: contains:
Rob Herring
maintainerRe: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description
Quoted 10 lines · Alex Elder
Quoted 8 lines · Guodong Xu
Add description for the Supm extension. Supm indicates support for pointer masking in user mode. Supm is mandatory for RVA23S64.
The Supm extension is ratified in commit
d70011dde6c2("Update to ratified state") of riscv-j-extension.Supm depends on either Smnpm or Ssnpm, so add a schema check to enforce this dependency.
Quoted 6 lines
I have the same general question on this, about whether it's really necessary for the DT binding to enforce these requirements. The RISC-V specifications are what truly defines their meaning, so I don't really see why the DT framework should need to enforce them. (That said, I'm sure there are other cases where DT enforces things it shouldn't have to.)
Does the specification have some way to check it? What happens if a DT is wrong? Are you going to require a DT update to make things right? Or the kernel has to work-around the error? Neither is great. So having this as a schema makes sense to prevent either scenario.
Quoted 9 lines
And now, having looked at these added binding definitions (in patches 07 through 11 in this series), I wonder what exactly is required for them to be accepted. For the most part these seem to just be defining how the extensions specified for RISC-V are to be expressed in DT files. It seems to be a fairly straightforward copy from the ratified specification(s) to the YAML format.
Who need to sign off on it? Conor? Paul? DT maintainers?
I generally leave this extension mess to Conor.
Rob
Re: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description
Quoted 18 lines · Rob Herring
Quoted 10 lines · Alex Elder
Quoted 8 lines · Guodong Xu
Add description for the Supm extension. Supm indicates support for pointer masking in user mode. Supm is mandatory for RVA23S64.
The Supm extension is ratified in commit
d70011dde6c2("Update to ratified state") of riscv-j-extension.Supm depends on either Smnpm or Ssnpm, so add a schema check to enforce this dependency.
Quoted 6 lines
I have the same general question on this, about whether it's really necessary for the DT binding to enforce these requirements. The RISC-V specifications are what truly defines their meaning, so I don't really see why the DT framework should need to enforce them. (That said, I'm sure there are other cases where DT enforces things it shouldn't have to.)
Quoted 4 lines
Does the specification have some way to check it? What happens if a DT is wrong? Are you going to require a DT update to make things right? Or the kernel has to work-around the error? Neither is great. So having this as a schema makes sense to prevent either scenario.
I'm really glad you weighed in. I actually have several questions related to RISC-V extensions and DT. But for now I'll focus on just this...
To answer your first question, I'm not sure how the specification is "checked", or what "it" is that you're asking about for that matter. Also I think we have to be clear about what "wrong" means.
RISC-V is defined by a (large and growing) set of specifications that are developed through a well-defined process. When a spec is *ratified* it is committed, and it won't be changed. These specifications are ultimately *the* definition of RISC-V compliance.
I assumed the "wrong" you're talking about is a DTS/DTB that has been committed but somehow does not match what a RISC-V spec says, but I might be mistaken.
Anyway, we can flip that around and have a similar problem: What if we define the DT binding in such a way that it doesn't match the RISC-V spec? The (ratified) RISC-V spec is right.
My thought was that we should have software do the verification, and recommend the software (e.g. arch/riscv/kernel/cpufeature.c in Linux) be updated to verify things before committing to a DT binding.
To me, C code is more general and more universally understandable than YAML rules, but I'm biased by how well I work with C versus YAML schemas.
In any case, a "wrong" binding is a problem no matter what the reason. One way or another there are things expressed via DT that must match the RISC-V specifications. And yes, we do have tools and bindings that can verify things related to DT.
Quoted 10 lines
Quoted 8 lines
And now, having looked at these added binding definitions (in patches 07 through 11 in this series), I wonder what exactly is required for them to be accepted. For the most part these seem to just be defining how the extensions specified for RISC-V are to be expressed in DT files. It seems to be a fairly straightforward copy from the ratified specification(s) to the YAML format.
Who need to sign off on it? Conor? Paul? DT maintainers?
I generally leave this extension mess to Conor.
Sounds wise. Should I address my other few questions on this topic to Conor? I don't want this particular series to get held up on unrelated discussions.
-Alex
Quoted 1 line
Rob
Rob Herring
maintainerRe: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description
Quoted 39 lines · Alex Elder
Quoted 18 lines · Rob Herring
Quoted 10 lines · Alex Elder
Quoted 8 lines · Guodong Xu
Add description for the Supm extension. Supm indicates support for pointer masking in user mode. Supm is mandatory for RVA23S64.
The Supm extension is ratified in commit
d70011dde6c2("Update to ratified state") of riscv-j-extension.Supm depends on either Smnpm or Ssnpm, so add a schema check to enforce this dependency.
Quoted 6 lines
I have the same general question on this, about whether it's really necessary for the DT binding to enforce these requirements. The RISC-V specifications are what truly defines their meaning, so I don't really see why the DT framework should need to enforce them. (That said, I'm sure there are other cases where DT enforces things it shouldn't have to.)
Quoted 4 lines
Does the specification have some way to check it? What happens if a DT is wrong? Are you going to require a DT update to make things right? Or the kernel has to work-around the error? Neither is great. So having this as a schema makes sense to prevent either scenario.
I'm really glad you weighed in. I actually have several questions related to RISC-V extensions and DT. But for now I'll focus on just this...
To answer your first question, I'm not sure how the specification is "checked", or what "it" is that you're asking about for that matter. Also I think we have to be clear about what "wrong" means.
RISC-V is defined by a (large and growing) set of specifications that are developed through a well-defined process. When a spec is *ratified* it is committed, and it won't be changed. These specifications are ultimately *the* definition of RISC-V compliance.
Quoted 3 lines
I assumed the "wrong" you're talking about is a DTS/DTB that has been committed but somehow does not match what a RISC-V spec says, but I might be mistaken.
That's correct.
Quoted 3 lines
Anyway, we can flip that around and have a similar problem: What if we define the DT binding in such a way that it doesn't match the RISC-V spec? The (ratified) RISC-V spec is right.
Sure. Any time there is more than 1 source of truth, they could be mismatched. But it is 1 spec and 1 schema to compare, not N DTS files. Checking the schema matches the spec is much easier than reviewing every new DTS file.
The only true fix is to make the spec machine readable.
Quoted 4 lines
My thought was that we should have software do the verification, and recommend the software (e.g.
arch/riscv/kernel/cpufeature.cin Linux) be updated to verify things before committing to a DT binding.
That moves validation from build time to run time. How is that better? And what about other OSs?
I'm very much of the opinion that it is not the kernel's job to validate the DT. It obviously has not done a very good job given issues we find with schemas. It's fine to have some checks in this case if the kernel can't function (or use/enable the extension) without the dependent extensions, but there are lots of classes of errors the kernel doesn't need to care about.
Quoted 3 lines
To me, C code is more general and more universally understandable than YAML rules, but I'm biased by how well I work with C versus YAML schemas.
Personally, if I was going to do validation with code, I would pick python or any language that can handle lists and dicts natively. I too would prefer C for everything, but it's not the best tool for the job here. Even if we decided to do validation in C (I'm pretty sure we had a proposal to do just that at some point), we'd just end up defining our own data structures of validation data. Because at the end of the day, most of the validation information is all the same structure of data (i.e. a list of properties with lists of allowed values). I'd much rather follow some standard (json-schema) that's already documented than try to come up with my own poorly documented invention.
I do think there is some need for code based validation as there are some things which can't be expressed with schemas. We have some of that in dtc, but that only works for core bindings. Some sort of python snippets of code in schemas is kind of what I'm thinking.
Quoted 12 lines
In any case, a "wrong" binding is a problem no matter what the reason. One way or another there are things expressed via DT that must match the RISC-V specifications. And yes, we do have tools and bindings that can verify things related to DT.
Quoted 7 lines
Quoted 7 lines
And now, having looked at these added binding definitions (in patches 07 through 11 in this series), I wonder what exactly is required for them to be accepted. For the most part these seem to just be defining how the extensions specified for RISC-V are to be expressed in DT files. It seems to be a fairly straightforward copy from the ratified specification(s) to the YAML format.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Who need to sign off on it? Conor? Paul? DT maintainers?
I generally leave this extension mess to Conor.
Sounds wise. Should I address my other few questions on this topic to Conor? I don't want this particular series to get held up on unrelated discussions.
Probably so.
Rob
Re: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description
Quoted 46 lines · Rob Herring
Quoted 39 lines · Alex Elder
Quoted 18 lines · Rob Herring
Quoted 10 lines · Alex Elder
Quoted 8 lines · Guodong Xu
Add description for the Supm extension. Supm indicates support for pointer masking in user mode. Supm is mandatory for RVA23S64.
The Supm extension is ratified in commit
d70011dde6c2("Update to ratified state") of riscv-j-extension.Supm depends on either Smnpm or Ssnpm, so add a schema check to enforce this dependency.
Quoted 6 lines
I have the same general question on this, about whether it's really necessary for the DT binding to enforce these requirements. The RISC-V specifications are what truly defines their meaning, so I don't really see why the DT framework should need to enforce them. (That said, I'm sure there are other cases where DT enforces things it shouldn't have to.)
Quoted 4 lines
Does the specification have some way to check it? What happens if a DT is wrong? Are you going to require a DT update to make things right? Or the kernel has to work-around the error? Neither is great. So having this as a schema makes sense to prevent either scenario.
I'm really glad you weighed in. I actually have several questions related to RISC-V extensions and DT. But for now I'll focus on just this...
To answer your first question, I'm not sure how the specification is "checked", or what "it" is that you're asking about for that matter. Also I think we have to be clear about what "wrong" means.
RISC-V is defined by a (large and growing) set of specifications that are developed through a well-defined process. When a spec is *ratified* it is committed, and it won't be changed. These specifications are ultimately *the* definition of RISC-V compliance.
Quoted 3 lines
I assumed the "wrong" you're talking about is a DTS/DTB that has been committed but somehow does not match what a RISC-V spec says, but I might be mistaken.
That's correct.
Quoted 8 lines
Quoted 3 lines
Anyway, we can flip that around and have a similar problem: What if we define the DT binding in such a way that it doesn't match the RISC-V spec? The (ratified) RISC-V spec is right.
Sure. Any time there is more than 1 source of truth, they could be mismatched. But it is 1 spec and 1 schema to compare, not N DTS files. Checking the schema matches the spec is much easier than reviewing every new DTS file.
The objective is not to define things with divergent meanings anyway, only to say "this string is exactly this version of this extension", so that if some other version of an extension comes along we have a way to differentiate. We didn't before and that became problematic for both standard extensions and vendor specific stuff. You'll note we don't look to define anything ourselves, just cite the spec that provides the definitions.
Quoted 10 lines
The only true fix is to make the spec machine readable.
Quoted 4 lines
My thought was that we should have software do the verification, and recommend the software (e.g.
arch/riscv/kernel/cpufeature.cin Linux) be updated to verify things before committing to a DT binding.That moves validation from build time to run time. How is that better? And what about other OSs?
Quoted 6 lines
I'm very much of the opinion that it is not the kernel's job to validate the DT. It obviously has not done a very good job given issues we find with schemas. It's fine to have some checks in this case if the kernel can't function (or use/enable the extension) without the dependent extensions, but there are lots of classes of errors the kernel doesn't need to care about.
By and large what's in cpufeature.c is there to turn extensions off based on kconfig choices (vector support enabled etc) or kernel design decisions (kernel requiring both d and f extensions for fpu support). I don't think there's anything there that doesn't assume that the devicetree is correct. For my money, it's much simpler to describe dependencies in a binding than add more code to the kernel that tries to figure out dependencies at runtime.
Re: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description
Am 30. Dezember 2025 18:37:25 MEZ schrieb Conor Dooley <[email protected]>:
Quoted 81 lines · Rob Herring
Quoted 46 lines · Alex Elder
Quoted 39 lines · Rob Herring
Quoted 18 lines · Alex Elder
Quoted 10 lines · Guodong Xu
Quoted 8 lines
Add description for the Supm extension. Supm indicates support for pointer masking in user mode. Supm is mandatory for RVA23S64.
The Supm extension is ratified in commit
d70011dde6c2("Update to ratified state") of riscv-j-extension.Supm depends on either Smnpm or Ssnpm, so add a schema check to enforce this dependency.
Quoted 6 lines
I have the same general question on this, about whether it's really necessary for the DT binding to enforce these requirements. The RISC-V specifications are what truly defines their meaning, so I don't really see why the DT framework should need to enforce them. (That said, I'm sure there are other cases where DT enforces things it shouldn't have to.)
Quoted 4 lines
Does the specification have some way to check it? What happens if a DT is wrong? Are you going to require a DT update to make things right? Or the kernel has to work-around the error? Neither is great. So having this as a schema makes sense to prevent either scenario.
I'm really glad you weighed in. I actually have several questions related to RISC-V extensions and DT. But for now I'll focus on just this...
To answer your first question, I'm not sure how the specification is "checked", or what "it" is that you're asking about for that matter. Also I think we have to be clear about what "wrong" means.
RISC-V is defined by a (large and growing) set of specifications that are developed through a well-defined process. When a spec is *ratified* it is committed, and it won't be changed. These specifications are ultimately *the* definition of RISC-V compliance.
Quoted 3 lines
I assumed the "wrong" you're talking about is a DTS/DTB that has been committed but somehow does not match what a RISC-V spec says, but I might be mistaken.
That's correct.
Quoted 8 lines
Quoted 3 lines
Anyway, we can flip that around and have a similar problem: What if we define the DT binding in such a way that it doesn't match the RISC-V spec? The (ratified) RISC-V spec is right.
Sure. Any time there is more than 1 source of truth, they could be mismatched. But it is 1 spec and 1 schema to compare, not N DTS files. Checking the schema matches the spec is much easier than reviewing every new DTS file.
The objective is not to define things with divergent meanings anyway, only to say "this string is exactly this version of this extension", so that if some other version of an extension comes along we have a way to differentiate. We didn't before and that became problematic for both standard extensions and vendor specific stuff. You'll note we don't look to define anything ourselves, just cite the spec that provides the definitions.
Quoted 10 lines
The only true fix is to make the spec machine readable.
Quoted 4 lines
My thought was that we should have software do the verification, and recommend the software (e.g.
arch/riscv/kernel/cpufeature.cin Linux) be updated to verify things before committing to a DT binding.That moves validation from build time to run time. How is that better? And what about other OSs?
Quoted 6 lines
I'm very much of the opinion that it is not the kernel's job to validate the DT. It obviously has not done a very good job given issues we find with schemas. It's fine to have some checks in this case if the kernel can't function (or use/enable the extension) without the dependent extensions, but there are lots of classes of errors the kernel doesn't need to care about.
Quoted 3 lines
By and large what's in
cpufeature.cis there to turn extensions off based on kconfig choices (vector support enabled etc) or kernel design decisions (kernel requiring both d and f extensions for fpu support). I
Should supm be handled in the same way? Add it to the device-tree of RVA23U64 devices. If a kernel does not support pointer masking in user space, hide the extension in cpufeature.c.
Best regards
Heinrich
Quoted 5 lines
don't think there's anything there that doesn't assume that the devicetree is correct. For my money, it's much simpler to describe dependencies in a binding than add more code to the kernel that tries to figure out dependencies at runtime.
Re: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description
Quoted 82 lines · Heinrich Schuchardt
Am 30. Dezember 2025 18:37:25 MEZ schrieb Conor Dooley <[email protected]>:
Quoted 81 lines · Rob Herring
Quoted 46 lines · Alex Elder
Quoted 39 lines · Rob Herring
Quoted 18 lines · Alex Elder
Quoted 10 lines · Guodong Xu
Quoted 8 lines
Add description for the Supm extension. Supm indicates support for pointer masking in user mode. Supm is mandatory for RVA23S64.
The Supm extension is ratified in commit
d70011dde6c2("Update to ratified state") of riscv-j-extension.Supm depends on either Smnpm or Ssnpm, so add a schema check to enforce this dependency.
Quoted 6 lines
I have the same general question on this, about whether it's really necessary for the DT binding to enforce these requirements. The RISC-V specifications are what truly defines their meaning, so I don't really see why the DT framework should need to enforce them. (That said, I'm sure there are other cases where DT enforces things it shouldn't have to.)
Quoted 4 lines
Does the specification have some way to check it? What happens if a DT is wrong? Are you going to require a DT update to make things right? Or the kernel has to work-around the error? Neither is great. So having this as a schema makes sense to prevent either scenario.
I'm really glad you weighed in. I actually have several questions related to RISC-V extensions and DT. But for now I'll focus on just this...
To answer your first question, I'm not sure how the specification is "checked", or what "it" is that you're asking about for that matter. Also I think we have to be clear about what "wrong" means.
RISC-V is defined by a (large and growing) set of specifications that are developed through a well-defined process. When a spec is *ratified* it is committed, and it won't be changed. These specifications are ultimately *the* definition of RISC-V compliance.
Quoted 3 lines
I assumed the "wrong" you're talking about is a DTS/DTB that has been committed but somehow does not match what a RISC-V spec says, but I might be mistaken.
That's correct.
Quoted 8 lines
Quoted 3 lines
Anyway, we can flip that around and have a similar problem: What if we define the DT binding in such a way that it doesn't match the RISC-V spec? The (ratified) RISC-V spec is right.
Sure. Any time there is more than 1 source of truth, they could be mismatched. But it is 1 spec and 1 schema to compare, not N DTS files. Checking the schema matches the spec is much easier than reviewing every new DTS file.
The objective is not to define things with divergent meanings anyway, only to say "this string is exactly this version of this extension", so that if some other version of an extension comes along we have a way to differentiate. We didn't before and that became problematic for both standard extensions and vendor specific stuff. You'll note we don't look to define anything ourselves, just cite the spec that provides the definitions.
Quoted 16 lines
The only true fix is to make the spec machine readable.
Quoted 4 lines
My thought was that we should have software do the verification, and recommend the software (e.g.
arch/riscv/kernel/cpufeature.cin Linux) be updated to verify things before committing to a DT binding.That moves validation from build time to run time. How is that better? And what about other OSs?
I'm very much of the opinion that it is not the kernel's job to validate the DT. It obviously has not done a very good job given issues we find with schemas. It's fine to have some checks in this case if the kernel can't function (or use/enable the extension) without the dependent extensions, but there are lots of classes of errors the kernel doesn't need to care about.
Quoted 7 lines
Quoted 3 lines
By and large what's in
cpufeature.cis there to turn extensions off based on kconfig choices (vector support enabled etc) or kernel design decisions (kernel requiring both d and f extensions for fpu support). IShould supm be handled in the same way? Add it to the device-tree of RVA23U64 devices. If a kernel does not support pointer masking in user space, hide the extension in
cpufeature.c.
Perhaps.
Samuel opted not to add supm to dt when he introduced the other relevant extensions, so the rationale from him would be helpful but I'd like to get more opinions on how to deal with supm specifically. supm doesn't really describe hardware capability, since the privilege specific instructions are what does that, which makes me question if it should be in dt at all. On the other hand, it could be argued that supm describes a combination of hardware capability at the dt consumer's privilege level and is valid on that basis. Some wording like Zkr will probably be needed, specifically mentioning that having supm in the dt means that corresponding version sxnpm for the privilege level that the devicetree is provided to is supported.
Either way, we are going to need something in cpufeature.c to imply supm so that it appears to userspace if the privilege specific extension is detected and supm is enabled in the kernel. The kernel already does the implication internally it just isn't reported as an extension to userspace IIRC.
If we permit supm in dt, we're also going to have to turn supm off if the Kconfig option is disabled, but that's relatively little effort since it mostly (or maybe entirely) reuses code from implying supm.
Samuel Holland
maintainerRe: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description
Hi all,
(Also replied to the v1 thread:
https://lore.kernel.org/linux-riscv/[email protected]/)
Quoted 4 lines · Conor Dooley
Quoted 3 lines
Should supm be handled in the same way? Add it to the device-tree of RVA23U64 devices. If a kernel does not support pointer masking in user space, hide the extension in
cpufeature.c.
Quoted 12 lines
Perhaps.
Samuel opted not to add supm to dt when he introduced the other relevant extensions, so the rationale from him would be helpful but I'd like to get more opinions on how to deal with supm specifically. supm doesn't really describe hardware capability, since the privilege specific instructions are what does that, which makes me question if it should be in dt at all. On the other hand, it could be argued that supm describes a combination of hardware capability at the dt consumer's privilege level and is valid on that basis. Some wording like Zkr will probably be needed, specifically mentioning that having supm in the dt means that corresponding version sxnpm for the privilege level that the devicetree is provided to is supported.
Supm describes a combination of the hardware capability (Smnpm or Ssnpm), the consumer's privilege level (U), and the software at the next higher privilege level (M or S).
If the DT is targeting U-mode, then I can see a case for adding Supm to the DT either at runtime or based on the known capabilities of the next-higher-privilege-mode software. So it could make sense to add a binding for Supm. But we still shouldn't add Supm to this particular DT, because 1) this DT is not targeting U-mode, and 2) this DT is not bound to a particular version of S-mode software.
Quoted 8 lines
Either way, we are going to need something in
cpufeature.cto imply supm so that it appears to userspace if the privilege specific extension is detected and supm is enabled in the kernel. The kernel already does the implication internally it just isn't reported as an extension to userspace IIRC.
If we permit supm in dt, we're also going to have to turn supm off if theKconfigoption is disabled, but that's relatively little effort since it mostly (or maybe entirely) reuses code from implying supm.
It's currently exposed to hwprobe() but not in /proc/cpuinfo. This was based on my understanding that hwprobe() was the right way to check for availability of extensions. I'm okay with adding it to /proc/cpuinfo if there's value in doing so, but I would recommend that the extension in cpufeature.c is _not_ parsed from the DT and only enabled synthetically.
Regards,
Samuel
Re: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description
In reply to Rob HerringQuoted 46 lines · Rob Herring
Quoted 39 lines · Alex Elder
Quoted 18 lines · Rob Herring
Quoted 10 lines · Alex Elder
Quoted 8 lines · Guodong Xu
Add description for the Supm extension. Supm indicates support for pointer masking in user mode. Supm is mandatory for RVA23S64.
The Supm extension is ratified in commit
d70011dde6c2("Update to ratified state") of riscv-j-extension.Supm depends on either Smnpm or Ssnpm, so add a schema check to enforce this dependency.
Quoted 6 lines
I have the same general question on this, about whether it's really necessary for the DT binding to enforce these requirements. The RISC-V specifications are what truly defines their meaning, so I don't really see why the DT framework should need to enforce them. (That said, I'm sure there are other cases where DT enforces things it shouldn't have to.)
Quoted 4 lines
Does the specification have some way to check it? What happens if a DT is wrong? Are you going to require a DT update to make things right? Or the kernel has to work-around the error? Neither is great. So having this as a schema makes sense to prevent either scenario.
I'm really glad you weighed in. I actually have several questions related to RISC-V extensions and DT. But for now I'll focus on just this...
To answer your first question, I'm not sure how the specification is "checked", or what "it" is that you're asking about for that matter. Also I think we have to be clear about what "wrong" means.
RISC-V is defined by a (large and growing) set of specifications that are developed through a well-defined process. When a spec is *ratified* it is committed, and it won't be changed. These specifications are ultimately *the* definition of RISC-V compliance.
Quoted 3 lines
I assumed the "wrong" you're talking about is a DTS/DTB that has been committed but somehow does not match what a RISC-V spec says, but I might be mistaken.
That's correct.
Quoted 8 lines
Quoted 3 lines
Anyway, we can flip that around and have a similar problem: What if we define the DT binding in such a way that it doesn't match the RISC-V spec? The (ratified) RISC-V spec is right.
Sure. Any time there is more than 1 source of truth, they could be mismatched. But it is 1 spec and 1 schema to compare, not N DTS files. Checking the schema matches the spec is much easier than reviewing every new DTS file.
Yes, I understand that and I agree. We *do* have tools to verify DT files against bindings, and at least in this domain we don't have tools to verify against the RISC-V specs.
Quoted 1 line
The only true fix is to make the spec machine readable.
But barring that, we can define the DT binding and try to ensure it exactly matches the RISC-V specs.
Quoted 7 lines
Quoted 4 lines
My thought was that we should have software do the verification, and recommend the software (e.g.
arch/riscv/kernel/cpufeature.cin Linux) be updated to verify things before committing to a DT binding.That moves validation from build time to run time. How is that better? And what about other OSs?
OK I concede that encoding the logic in the DT binding is a good practical solution and I take back my suggestion.
Quoted 2 lines
I'm very much of the opinion that it is not the kernel's job to validate the DT. It obviously has not done a very good job given
This is exactly what I wanted your opinion on. I mean, I already agreed with this statement, but the existence of a different (RISC-V) spec as a source of truth made me consider that maybe it wasn't DT's job to validate some things.
Quoted 5 lines
issues we find with schemas. It's fine to have some checks in this case if the kernel can't function (or use/enable the extension) without the dependent extensions, but there are lots of classes of errors the kernel doesn't need to care about.
Quoted 7 lines
Quoted 3 lines
To me, C code is more general and more universally understandable than YAML rules, but I'm biased by how well I work with C versus YAML schemas.
Personally, if I was going to do validation with code, I would pick python or any language that can handle lists and dicts natively. I too would prefer C for everything, but it's not the best tool for the job
My point was about DT binding logic versus kernel code logic. But yes I agree with what you're saying here.
Quoted 9 lines
here. Even if we decided to do validation in C (I'm pretty sure we had a proposal to do just that at some point), we'd just end up defining our own data structures of validation data. Because at the end of the day, most of the validation information is all the same structure of data (i.e. a list of properties with lists of allowed values). I'd much rather follow some standard (json-schema) that's already documented than try to come up with my own poorly documented invention.
Quoted 4 lines
I do think there is some need for code based validation as there are some things which can't be expressed with schemas. We have some of that in dtc, but that only works for core bindings. Some sort of python snippets of code in schemas is kind of what I'm thinking.
The main things I take away from this discussion:
- DT bindings *should* encode constraints for RISC-V extensions to enforce certain requirements from their underlying RISC-V specifications.
- The reason to do this is that the DT tools we have can help ensure correctness. And doing it in the binding means it can get reviewed once, and the logic will apply to all DTS files that adhere to the binding.
- Doing some validation in the kernel is still useful, but anything done there needs to replicated in any other code bases that need to parse DT files.
- Conor owns this mess. :)
-Alex
Quoted 23 lines
Quoted 12 lines
In any case, a "wrong" binding is a problem no matter what the reason. One way or another there are things expressed via DT that must match the RISC-V specifications. And yes, we do have tools and bindings that can verify things related to DT.
Quoted 7 lines
Quoted 7 lines
And now, having looked at these added binding definitions (in patches 07 through 11 in this series), I wonder what exactly is required for them to be accepted. For the most part these seem to just be defining how the extensions specified for RISC-V are to be expressed in DT files. It seems to be a fairly straightforward copy from the ratified specification(s) to the YAML format.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Who need to sign off on it? Conor? Paul? DT maintainers?
I generally leave this extension mess to Conor.
Sounds wise. Should I address my other few questions on this topic to Conor? I don't want this particular series to get held up on unrelated discussions.
Probably so.
Rob
Re: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description
In reply to Rob HerringQuoted 18 lines · Rob Herring
Quoted 10 lines · Alex Elder
Quoted 8 lines · Guodong Xu
Add description for the Supm extension. Supm indicates support for pointer masking in user mode. Supm is mandatory for RVA23S64.
The Supm extension is ratified in commit
d70011dde6c2("Update to ratified state") of riscv-j-extension.Supm depends on either Smnpm or Ssnpm, so add a schema check to enforce this dependency.
Quoted 6 lines
I have the same general question on this, about whether it's really necessary for the DT binding to enforce these requirements. The RISC-V specifications are what truly defines their meaning, so I don't really see why the DT framework should need to enforce them. (That said, I'm sure there are other cases where DT enforces things it shouldn't have to.)
Quoted 4 lines
Does the specification have some way to check it? What happens if a DT is wrong? Are you going to require a DT update to make things right? Or the kernel has to work-around the error? Neither is great. So having this as a schema makes sense to prevent either scenario.
The reason this whole mess exists is because extensions got redefined after the kernel port was merged and the bindings defined. This is almost all a hedge against there being future redefinitions. For now, and hopefully forever, this will just be a list of extensions with citations to their relevant documentation so that we can say "this is exactly what this means". The added bonus is avoiding messes like people implementing development versions of specs and claiming support, because that just becomes "your devicetree is wrong".
The dependency stuff exists because it is far too easy to miss something in a list of 30+ extensions and dt validation can reduce some of the complexity required when checking what extensions are supported.
Quoted 10 lines
Quoted 8 lines
And now, having looked at these added binding definitions (in patches 07 through 11 in this series), I wonder what exactly is required for them to be accepted. For the most part these seem to just be defining how the extensions specified for RISC-V are to be expressed in DT files. It seems to be a fairly straightforward copy from the ratified specification(s) to the YAML format.
Who need to sign off on it? Conor? Paul? DT maintainers?
I generally leave this extension mess to Conor.
And generally I do without that much back and forth, just so happens that a couple of the ones in this series are the less simple cases to deal with.
Re: [PATCH v2 11/13] dt-bindings: riscv: Add Supm extension description
Quoted 19 lines · Conor Dooley
Quoted 18 lines · Rob Herring
Quoted 16 lines · Alex Elder
Quoted 8 lines · Guodong Xu
Add description for the Supm extension. Supm indicates support for pointer masking in user mode. Supm is mandatory for RVA23S64.
The Supm extension is ratified in commit
d70011dde6c2("Update to ratified state") of riscv-j-extension.Supm depends on either Smnpm or Ssnpm, so add a schema check to enforce this dependency.
I have the same general question on this, about whether it's really necessary for the DT binding to enforce these requirements. The RISC-V specifications are what truly defines their meaning, so I don't really see why the DT framework should need to enforce them. (That said, I'm sure there are other cases where DT enforces things it shouldn't have to.)
Quoted 7 lines
Quoted 4 lines
Does the specification have some way to check it? What happens if a DT is wrong? Are you going to require a DT update to make things right? Or the kernel has to work-around the error? Neither is great. So having this as a schema makes sense to prevent either scenario.
The reason this whole mess exists is because extensions got redefined after the kernel port was merged and the bindings defined. This is
Redefined, or just new extensions defined?
Was support for any extensions added to the kernel before they were ratified? Even if so, did the meaning of the extension change between when support was added to the kernel and ratification?
Quoted 3 lines
almost all a hedge against there being future redefinitions. For now, and hopefully forever, this will just be a list of extensions with citations to their relevant documentation so that we can say "this is
Yes, this is good. I think the bindings should, where possible, just refer to the precise definitions in the (ratified) RISC-V specifications. But I now agree that they can also encode logic to enforce things.
Quoted 7 lines
exactly what this means". The added bonus is avoiding messes like people implementing development versions of specs and claiming support, because that just becomes "your devicetree is wrong".
The dependency stuff exists because it is far too easy to miss something in a list of 30+ extensions and dt validation can reduce some of the complexity required when checking what extensions are supported.
By "dependency stuff" do you just mean the DT binding logic?
Anyway I've come around to the idea that DT bindings actually should do validation like this.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
And now, having looked at these added binding definitions (in patches 07 through 11 in this series), I wonder what exactly is required for them to be accepted. For the most part these seem to just be defining how the extensions specified for RISC-V are to be expressed in DT files. It seems to be a fairly straightforward copy from the ratified specification(s) to the YAML format.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Who need to sign off on it? Conor? Paul? DT maintainers?
I generally leave this extension mess to Conor.
And generally I do without that much back and forth, just so happens that a couple of the ones in this series are the less simple cases to deal with.
Thanks. I may have a remaining question or two for you but they aren't that pressing.
-Alex
PATCH v2 12/13 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.
---
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 | 548 +++++++++++++++++++++++++++++++++++ 1 file changed, 548 insertions(+)
arch/riscv/boot/dts/spacemit/k3.dtsi new file +548 -0
@@ -0,0 +1,548 @@ +// 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", "supm", + "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", "supm", + "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", "supm", + "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", "supm", + "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", "supm", + "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", "supm", + "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", "supm", + "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", "supm", + "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 0x00200000>; + interrupt-controller; + #interrupt-cells = <0>; + msi-controller; + #msi-cells = <0>; + 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>; + riscv,num-ids = <511>; + riscv,num-guest-ids = <511>; + riscv,hart-index-bits = <4>; + riscv,guest-index-bits = <6>; + }; + + saplic: interrupt-controller@e0804000 { + compatible = "spacemit,k3-aplic", "riscv,aplic"; + reg = <0x0 0xe0804000 0x0 0x4000>; + msi-parent = <&simsic>; + #interrupt-cells = <2>; + interrupt-controller; + riscv,num-sources = <512>; + }; + + clint: timer@e081c000 { + compatible = "spacemit,k3-clint", "sifive,clint0"; + reg = <0x0 0xe081c000 0x0 0x0004000>; + 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>; + }; + }; +};
Signature · 1 line
2.43.0
PATCH v2 13/13 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.
---
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