public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Olivia Mackall <olivia@selenic.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Sean Wang <sean.wang@mediatek.com>,
	linux-crypto@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 1/2] dt-bindings: rng: mtk-rng: add SMC-based TRNG variants
Date: Wed, 4 Mar 2026 12:14:52 +0000	[thread overview]
Message-ID: <aagiPIgoosVqsA0t@makrotopia.org> (raw)
In-Reply-To: <20260304-defiant-echidna-of-examination-b1e798@quoll>

On Wed, Mar 04, 2026 at 12:34:45PM +0100, Krzysztof Kozlowski wrote:
> On Wed, Mar 04, 2026 at 12:55:27AM +0000, Daniel Golle wrote:
> > diff --git a/Documentation/devicetree/bindings/rng/mtk-rng.yaml b/Documentation/devicetree/bindings/rng/mtk-rng.yaml
> > index 7e8dc62e5d3a6..6074758552ac3 100644
> > --- a/Documentation/devicetree/bindings/rng/mtk-rng.yaml
> > +++ b/Documentation/devicetree/bindings/rng/mtk-rng.yaml
> > @@ -11,12 +11,15 @@ maintainers:
> >  
> >  properties:
> >    $nodename:
> > -    pattern: "^rng@[0-9a-f]+$"
> > +    pattern: "^rng(@[0-9a-f]+)?$"
> >  
> >    compatible:
> >      oneOf:
> >        - enum:
> >            - mediatek,mt7623-rng
> > +          - mediatek,mt7981-rng
> > +          - mediatek,mt7987-rng
> > +          - mediatek,mt7988-rng
> 
> Not compatible with each other?

MT7623 is the original hardware first supported in Linux. It can be
accessed via MMIO and requires the clock to be enabled by Linux.

Starting with MT7981 and followed by MT7988 and MT7987 it is
technically the same hardware, but on those ARMv8 SoCs TF-A assigns
the MMIO range of the TRNG to only be accessible from within the
secure/trusted land, and TF-A provides a (vendor-specific) API
allowing non-trusted land (ie. Linux) to acquire random bytes.

With MT7986 they made the unlucky choice to initially allow direct
access to the MMIO range, but later updates to TF-A then also locked
it to secure/trusted land, offering the same API as on the newer SoCs.
So for MT7986 the driver has to try and figure out which convention to
use.


> 
> >        - items:
> >            - enum:
> >                - mediatek,mt7622-rng
> > @@ -38,9 +41,22 @@ properties:
> >  
> >  required:
> >    - compatible
> > -  - reg
> > -  - clocks
> > -  - clock-names
> > +
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          not:
> 
> Use rather positive list, so drop "not:" and use cntains for only one
> compatible - mediatek,mt7623-rng.

Ack.

> 
> > +            contains:
> > +              enum:
> > +                - mediatek,mt7981-rng
> > +                - mediatek,mt7987-rng
> > +                - mediatek,mt7988-rng
> > +    then:
> > +      required:
> > +        - reg
> > +        - clocks
> > +        - clock-names
> >  
> >  additionalProperties: false
> >  
> > @@ -53,3 +69,7 @@ examples:
> >              clocks = <&infracfg CLK_INFRA_TRNG>;
> >              clock-names = "rng";
> >      };
> > +  - |
> > +    rng {
> > +            compatible = "mediatek,mt7981-rng";
> 
> Use four spaces for indentation.

Oh sorry, I knew that actually but forgot...


  reply	other threads:[~2026-03-04 12:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04  0:55 [PATCH 1/2] dt-bindings: rng: mtk-rng: add SMC-based TRNG variants Daniel Golle
2026-03-04  0:56 ` [PATCH 2/2] hwrng: mtk - add support for hw access via SMCC Daniel Golle
2026-03-04 11:34 ` [PATCH 1/2] dt-bindings: rng: mtk-rng: add SMC-based TRNG variants Krzysztof Kozlowski
2026-03-04 12:14   ` Daniel Golle [this message]
2026-03-04 12:18     ` Krzysztof Kozlowski
2026-03-04 12:21       ` Daniel Golle
2026-03-04 12:26         ` Krzysztof Kozlowski

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=aagiPIgoosVqsA0t@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=olivia@selenic.com \
    --cc=robh@kernel.org \
    --cc=sean.wang@mediatek.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox