All of lore.kernel.org
 help / color / mirror / Atom feed
From: Drew Fustini <fustini@kernel.org>
To: Conor Dooley <conor@kernel.org>
Cc: Tomasz Jeznach <tomasz.jeznach@linux.dev>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>,
	iommu@lists.linux.dev, linux-riscv@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Joel Stanley <joel@jms.id.au>,
	Joerg Roedel <joerg.roedel@amd.com>,
	Nicholas Piggin <npiggin@gmail.com>
Subject: Re: [PATCH v2] dt-bindings: iommu: riscv: Add bindings for Tenstorrent RISC-V IOMMU
Date: Wed, 20 May 2026 11:14:32 -0700	[thread overview]
Message-ID: <ag36CHVAERc3ZYmi@x1> (raw)
In-Reply-To: <20260520-frayed-fervor-7c887193ab19@spud>

[-- Attachment #1: Type: text/plain, Size: 4118 bytes --]

On Wed, May 20, 2026 at 05:17:41PM +0100, Conor Dooley wrote:

Thanks for the review...

> On Tue, May 19, 2026 at 11:16:28PM -0700, Drew Fustini wrote:
> > From: Nicholas Piggin <npiggin@gmail.com>
> > 
> > Extend the binding to cover details specific to the Tenstorrent RISC-V
> > IOMMU. In particular, a second register range is added which contains
> > M-privileged registers, e.g., PMAs and PMPs.
> > 
> > The RISC-V spec S-privileged registers remain in the first register
> > range and are compatible with "riscv,iommu" so the Linux driver does not
> > notice any difference, but the binding will be used by OpenSBI and
> > potentially other M-mode software.
> > 
> > Reviewed-by: Joel Stanley <joel@jms.id.au>
> > Acked-by: Joerg Roedel <joerg.roedel@amd.com>
> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> > [fustini: fix dt_binding_check errors]
> > Signed-off-by: Drew Fustini <fustini@kernel.org>
> > ---
> > v2 changes:
> > - Fix dt_binding_check errors
> > - Add the Acked-by: from Joerg
> > - Drop RFC prefix
> > 
> > Link to v1:
> > https://lore.kernel.org/lkml/20260310003850.3837030-1-npiggin@gmail.com/
> > 
> >  .../bindings/iommu/riscv,iommu.yaml           | 62 ++++++++++++++++---
> >  1 file changed, 55 insertions(+), 7 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/iommu/riscv,iommu.yaml b/Documentation/devicetree/bindings/iommu/riscv,iommu.yaml
> > index d4838c3b3741..5aad8cf67840 100644
> > --- a/Documentation/devicetree/bindings/iommu/riscv,iommu.yaml
> > +++ b/Documentation/devicetree/bindings/iommu/riscv,iommu.yaml
> > @@ -32,22 +32,35 @@ properties:
> >    # should be specified along with 'reg' property providing MMIO location.
> >    compatible:
> >      oneOf:
> > -      - items:
> > +      - description: Platform (non-PCIe) IOMMU implementations
> > +        items:
> >            - enum:
> >                - qemu,riscv-iommu
> >            - const: riscv,iommu
> > -      - items:
> > +      - description: PCIe IOMMU implementations
> > +        items:
> >            - enum:
> >                - pci1efd,edf1
> >            - const: riscv,pci-iommu
> > +      - description: Tenstorrent IOMMUs implementing "riscv,iommu"
> > +        items:
> > +          - enum:
> > +              - tenstorrent,riscv-iommu
> > +          - const: riscv,iommu
> 
> You should be able to put this into the enum alongside the qemu
> compatible, right?

Good point, I'll move tenstorrent,riscv-iommu to the enum with
qemu,riscv-iommu.

> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - tenstorrent,riscv-iommu
> > +    then:
> > +      properties:
> > +        reg:
> 
> > +          items:
> > +            - description: IOMMU base registers
> > +            - description: Tenstorrent IOMMU machine mode registers.
> 
> Should this also have minItems: 2?

I think items: with 2 items implies minItems: 2 but I see your later
point about the description and names don't belong in the allOf: block.

> 
> > +        reg-names:
> 
> > +          items:
> > +            - const: base
> > +            - const: machine
> > +              description:
> > +                Region containing platform specific MMRs for machine-mode
> > +                configuration, such as PMA and PMP registers.
> 
> And this you should replace with minItems: 2 or delete. The reg property
> is where your description here belongs and all the names do here is
> re-list what's available outside the condition.

Ah, so I just have minItems: 2 here and rely on the reg: section to have
the descriptions.

> > +  - |+
> > +    /* Example 5 (Tenstorrent IOMMU device with MSIs) */
> > +    iommu5: iommu@d2020000 {
> > +        compatible = "tenstorrent,riscv-iommu", "riscv,iommu";
> > +        reg = <0xd2020000 0x10000 0xaa000000 0x10000>;
> 
> This is not the correct format for multiple reg properties. Hint: you're
> missing ">, <".

Thanks, I'll fix that.

-Drew

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Drew Fustini <fustini@kernel.org>
To: Conor Dooley <conor@kernel.org>
Cc: Tomasz Jeznach <tomasz.jeznach@linux.dev>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>,
	iommu@lists.linux.dev, linux-riscv@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Joel Stanley <joel@jms.id.au>,
	Joerg Roedel <joerg.roedel@amd.com>,
	Nicholas Piggin <npiggin@gmail.com>
Subject: Re: [PATCH v2] dt-bindings: iommu: riscv: Add bindings for Tenstorrent RISC-V IOMMU
Date: Wed, 20 May 2026 11:14:32 -0700	[thread overview]
Message-ID: <ag36CHVAERc3ZYmi@x1> (raw)
In-Reply-To: <20260520-frayed-fervor-7c887193ab19@spud>


[-- Attachment #1.1: Type: text/plain, Size: 4118 bytes --]

On Wed, May 20, 2026 at 05:17:41PM +0100, Conor Dooley wrote:

Thanks for the review...

> On Tue, May 19, 2026 at 11:16:28PM -0700, Drew Fustini wrote:
> > From: Nicholas Piggin <npiggin@gmail.com>
> > 
> > Extend the binding to cover details specific to the Tenstorrent RISC-V
> > IOMMU. In particular, a second register range is added which contains
> > M-privileged registers, e.g., PMAs and PMPs.
> > 
> > The RISC-V spec S-privileged registers remain in the first register
> > range and are compatible with "riscv,iommu" so the Linux driver does not
> > notice any difference, but the binding will be used by OpenSBI and
> > potentially other M-mode software.
> > 
> > Reviewed-by: Joel Stanley <joel@jms.id.au>
> > Acked-by: Joerg Roedel <joerg.roedel@amd.com>
> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> > [fustini: fix dt_binding_check errors]
> > Signed-off-by: Drew Fustini <fustini@kernel.org>
> > ---
> > v2 changes:
> > - Fix dt_binding_check errors
> > - Add the Acked-by: from Joerg
> > - Drop RFC prefix
> > 
> > Link to v1:
> > https://lore.kernel.org/lkml/20260310003850.3837030-1-npiggin@gmail.com/
> > 
> >  .../bindings/iommu/riscv,iommu.yaml           | 62 ++++++++++++++++---
> >  1 file changed, 55 insertions(+), 7 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/iommu/riscv,iommu.yaml b/Documentation/devicetree/bindings/iommu/riscv,iommu.yaml
> > index d4838c3b3741..5aad8cf67840 100644
> > --- a/Documentation/devicetree/bindings/iommu/riscv,iommu.yaml
> > +++ b/Documentation/devicetree/bindings/iommu/riscv,iommu.yaml
> > @@ -32,22 +32,35 @@ properties:
> >    # should be specified along with 'reg' property providing MMIO location.
> >    compatible:
> >      oneOf:
> > -      - items:
> > +      - description: Platform (non-PCIe) IOMMU implementations
> > +        items:
> >            - enum:
> >                - qemu,riscv-iommu
> >            - const: riscv,iommu
> > -      - items:
> > +      - description: PCIe IOMMU implementations
> > +        items:
> >            - enum:
> >                - pci1efd,edf1
> >            - const: riscv,pci-iommu
> > +      - description: Tenstorrent IOMMUs implementing "riscv,iommu"
> > +        items:
> > +          - enum:
> > +              - tenstorrent,riscv-iommu
> > +          - const: riscv,iommu
> 
> You should be able to put this into the enum alongside the qemu
> compatible, right?

Good point, I'll move tenstorrent,riscv-iommu to the enum with
qemu,riscv-iommu.

> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - tenstorrent,riscv-iommu
> > +    then:
> > +      properties:
> > +        reg:
> 
> > +          items:
> > +            - description: IOMMU base registers
> > +            - description: Tenstorrent IOMMU machine mode registers.
> 
> Should this also have minItems: 2?

I think items: with 2 items implies minItems: 2 but I see your later
point about the description and names don't belong in the allOf: block.

> 
> > +        reg-names:
> 
> > +          items:
> > +            - const: base
> > +            - const: machine
> > +              description:
> > +                Region containing platform specific MMRs for machine-mode
> > +                configuration, such as PMA and PMP registers.
> 
> And this you should replace with minItems: 2 or delete. The reg property
> is where your description here belongs and all the names do here is
> re-list what's available outside the condition.

Ah, so I just have minItems: 2 here and rely on the reg: section to have
the descriptions.

> > +  - |+
> > +    /* Example 5 (Tenstorrent IOMMU device with MSIs) */
> > +    iommu5: iommu@d2020000 {
> > +        compatible = "tenstorrent,riscv-iommu", "riscv,iommu";
> > +        reg = <0xd2020000 0x10000 0xaa000000 0x10000>;
> 
> This is not the correct format for multiple reg properties. Hint: you're
> missing ">, <".

Thanks, I'll fix that.

-Drew

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

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

  reply	other threads:[~2026-05-20 18:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20  6:16 [PATCH v2] dt-bindings: iommu: riscv: Add bindings for Tenstorrent RISC-V IOMMU Drew Fustini
2026-05-20  6:16 ` Drew Fustini
2026-05-20  6:37 ` sashiko-bot
2026-05-20 16:17 ` Conor Dooley
2026-05-20 16:17   ` Conor Dooley
2026-05-20 18:14   ` Drew Fustini [this message]
2026-05-20 18:14     ` Drew Fustini
2026-05-20 18:55     ` Conor Dooley
2026-05-20 18:55       ` Conor Dooley

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=ag36CHVAERc3ZYmi@x1 \
    --to=fustini@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=iommu@lists.linux.dev \
    --cc=joel@jms.id.au \
    --cc=joerg.roedel@amd.com \
    --cc=joro@8bytes.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=npiggin@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=tomasz.jeznach@linux.dev \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

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

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