[PATCH v2 07/13] dt-bindings: riscv: Add B ISA extension description

Conor Dooley conor at kernel.org
Mon Dec 22 13:17:31 PST 2025


On Mon, Dec 22, 2025 at 09:04:17PM +0800, Guodong Xu wrote:
> 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 <guodong at riscstar.com>
> ---
> v2: New patch.
> ---
>  .../devicetree/bindings/riscv/extensions.yaml         | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml
> index 565cb2cbb49b552959392810a9b731b43346a594..385e1deb23996d294e7662693f1257f910a6e129 100644
> --- a/Documentation/devicetree/bindings/riscv/extensions.yaml
> +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml
> @@ -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

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.

> +        then:
> +          allOf:
> +            - contains:
> +                const: zba
> +            - contains:
> +                const: zbb
> +            - contains:
> +                const: zbs
>        # Zcb depends on Zca
>        - if:
>            contains:
> 
> -- 
> 2.43.0
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20251222/1c2a2120/attachment.sig>


More information about the linux-riscv mailing list