Skip to content

Commit 0cdb7fc

Browse files
docularxuConchuOD
authored andcommitted
dt-bindings: riscv: Add B ISA extension description
Add description of the single-letter B extension for Bit Manipulation. B is mandatory for RVA23U64. The B extension is ratified in the 20240411 version of the unprivileged ISA specification. According to the ratified spec, the B standard extension comprises instructions provided by the Zba, Zbb, and Zbs extensions. Add two-way dependency check to enforce that B implies Zba/Zbb/Zbs; and when Zba/Zbb/Zbs (all of them) are specified, then B must be added too. The reason why B/Zba/Zbb/Zbs must coexist at the same time is that unlike other single-letter extensions, B was ratified (Apr/2024) much later than its component extensions Zba/Zbb/Zbs (Jun/2021). When "b" is specified, zba/zbb/zbs must be present to ensure backward compatibility with existing software and kernels that only look for the explicit component strings. When all three components zba/zbb/zbs are specified, "b" should also be present. Making "b" mandatory when all three components are present. Existing devicetrees with zba/zbb/zbs but without "b" will generate warnings that can be fixed in follow-up patches. Signed-off-by: Guodong Xu <guodong@riscstar.com> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
1 parent fff010c commit 0cdb7fc

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Documentation/devicetree/bindings/riscv/extensions.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ properties:
109109
The standard C extension for compressed instructions, as ratified in
110110
the 20191213 version of the unprivileged ISA specification.
111111

112+
- const: b
113+
description:
114+
The standard B extension for bit manipulation instructions, as
115+
ratified in the 20240411 version of the unprivileged ISA
116+
specification. The B standard extension comprises instructions
117+
provided by the Zba, Zbb, and Zbs extensions.
118+
112119
- const: v
113120
description:
114121
The standard V extension for vector operations, as ratified
@@ -738,6 +745,30 @@ properties:
738745
then:
739746
contains:
740747
const: f
748+
# B comprises Zba, Zbb, and Zbs
749+
- if:
750+
contains:
751+
const: b
752+
then:
753+
allOf:
754+
- contains:
755+
const: zba
756+
- contains:
757+
const: zbb
758+
- contains:
759+
const: zbs
760+
# Zba, Zbb, Zbs together require B
761+
- if:
762+
allOf:
763+
- contains:
764+
const: zba
765+
- contains:
766+
const: zbb
767+
- contains:
768+
const: zbs
769+
then:
770+
contains:
771+
const: b
741772
# Zcb depends on Zca
742773
- if:
743774
contains:

0 commit comments

Comments
 (0)