public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	devicetree@vger.kernel.org, linux-tegra@vger.kernel.org,
	Prathamesh Shete <pshete@nvidia.com>
Subject: Re: [PATCH 1/2] dt-bindings: tegra: pmc: Update aotag as an optional aperture
Date: Tue, 18 Nov 2025 11:11:58 +0000	[thread overview]
Message-ID: <9e88368b-2bcd-4f38-abcb-00b8ff6845ea@nvidia.com> (raw)
In-Reply-To: <e39fcaeb-b516-41f1-89a4-fa3328c07deb@kernel.org>


On 18/11/2025 10:38, Krzysztof Kozlowski wrote:
> On 18/11/2025 11:08, Jon Hunter wrote:
>>
>> On 15/11/2025 12:25, Krzysztof Kozlowski wrote:
>>> On Fri, Nov 14, 2025 at 04:17:10PM +0000, Jon Hunter wrote:
>>>> Not all Tegra SoCs or all versions of a particular Tegra SoC may include
>>>> the AOTAG aperture. This change makes "aotag" as an optional aperture for
>>>> Tegra234 and Tegra264.
>>>>
>>>> Co-developed-by: Prathamesh Shete <pshete@nvidia.com>
>>>> Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
>>>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>>>> ---
>>>> Admittedly I don't know if there is a better way to handle this,
>>>> but if there is please let me know!
>>>>
>>>>    .../arm/tegra/nvidia,tegra186-pmc.yaml        | 57 ++++++++++++-------
>>>>    1 file changed, 38 insertions(+), 19 deletions(-)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
>>>> index be70819020c5..defd9000eed2 100644
>>>> --- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
>>>> +++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
>>>> @@ -19,17 +19,12 @@ properties:
>>>>          - nvidia,tegra264-pmc
>>>>    
>>>>      reg:
>>>> -    minItems: 4
>>>> +    minItems: 3
>>>>        maxItems: 5
>>>>    
>>>>      reg-names:
>>>> -    minItems: 4
>>>> -    items:
>>>> -      - const: pmc
>>>> -      - const: wake
>>>> -      - const: aotag
>>>> -      - enum: [ scratch, misc ]
>>>> -      - const: misc
>>>> +    minItems: 3
>>>> +    maxItems: 5
>>>
>>>     minItems: 3
>>>     items:
>>>       - const: pmc
>>>       - const: wake
>>>       - enum: [ aotag, cratch, misc ]
>>>       - enum: [ scratch, misc ]
>>>       - const: misc
>>>
>>> Should work, no?
>>
>> I was thinking about that, but with the above, and if I am understanding
>> you correctly, it would permit someone to make the following mistake ...
>>
>>    reg-names = "pmc", "wake", "scratch", "scratch", "misc";
>>
>> Hence, I thought that I need to be more explicit and list out all the
>> combinations that are supported for a given device. Let me know if I am
>> misunderstanding you here.
> 
> It won't be allowed, test it.

So this is what I tried to test this ...

diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
index be70819020c5..78bd579cad75 100644
--- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
+++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra186-pmc.yaml
@@ -19,15 +19,15 @@ properties:
        - nvidia,tegra264-pmc
  
    reg:
-    minItems: 4
+    minItems: 3
      maxItems: 5
  
    reg-names:
-    minItems: 4
+    minItems: 3
      items:
        - const: pmc
        - const: wake
-      - const: aotag
+      - enum: [ aotag, scratch, misc ]
        - enum: [ scratch, misc ]
        - const: misc
  
@@ -51,6 +51,7 @@ allOf:
      then:
        properties:
          reg:
+          minItems: 4
            maxItems: 4
          reg-names:
            maxItems: 4
@@ -73,7 +74,9 @@ allOf:
        properties:
          compatible:
            contains:
-            const: nvidia,tegra234-pmc
+            enum:
+              - nvidia,tegra234-pmc
+              - nvidia,tegra264-pmc
      then:
        properties:
          reg-names:
@@ -184,7 +187,7 @@ examples:
                <0x0c370000 0x10000>,
                <0x0c380000 0x10000>,
                <0x0c390000 0x10000>;
-        reg-names = "pmc", "wake", "aotag", "scratch";
+        reg-names = "pmc", "wake", "scratch", "scratch";
          nvidia,invert-interrupt;
  
          sdmmc1_3v3: sdmmc1-3v3 {


The above did not trigger any errors even though I introduced
an error in the example. Anything I am missing?

Jon

-- 
nvpublic


  reply	other threads:[~2025-11-18 11:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14 16:17 [PATCH 1/2] dt-bindings: tegra: pmc: Update aotag as an optional aperture Jon Hunter
2025-11-14 16:17 ` [PATCH 2/2] soc/tegra: pmc: don't fail if "aotag" is not present Jon Hunter
2025-11-15 12:25 ` [PATCH 1/2] dt-bindings: tegra: pmc: Update aotag as an optional aperture Krzysztof Kozlowski
2025-11-18 10:08   ` Jon Hunter
2025-11-18 10:38     ` Krzysztof Kozlowski
2025-11-18 11:11       ` Jon Hunter [this message]
2025-11-18 13:08         ` Krzysztof Kozlowski
2025-11-18 14:11           ` Jon Hunter
2025-11-18 14:22             ` Krzysztof Kozlowski
2025-11-18 14:20           ` 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=9e88368b-2bcd-4f38-abcb-00b8ff6845ea@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=pshete@nvidia.com \
    --cc=robh@kernel.org \
    --cc=thierry.reding@gmail.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