[PATCH 1/4] dt-bindings: memory: tegra: Add Tegra264 support

Thierry Reding posted 4 patches 3 months ago
There is a newer version of this series
[PATCH 1/4] dt-bindings: memory: tegra: Add Tegra264 support
Posted by Thierry Reding 3 months ago
From: Sumit Gupta <sumitg@nvidia.com>

Add bindings for the Memory Controller (MC) and External Memory
Controller (EMC) found on the Tegra264 SoC. Tegra264 SoC has a different
number of interrupt lines for MC sub-units: UCF_SOC, hub, hub common,
syncpoint and MC channel. The total number of interrupt lines is eight.
Update maxItems for MC interrupts accordingly.

Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 .../nvidia,tegra186-mc.yaml                   | 65 ++++++++++++++++++-
 1 file changed, 63 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml
index 935d63d181d9..52575a16349b 100644
--- a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml
+++ b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml
@@ -32,6 +32,7 @@ properties:
           - nvidia,tegra186-mc
           - nvidia,tegra194-mc
           - nvidia,tegra234-mc
+          - nvidia,tegra264-mc
 
   reg:
     minItems: 6
@@ -42,8 +43,12 @@ properties:
     maxItems: 18
 
   interrupts:
-    items:
-      - description: MC general interrupt
+    minItems: 1
+    maxItems: 8
+
+  interrupt-names:
+    minItems: 1
+    maxItems: 8
 
   "#address-cells":
     const: 2
@@ -74,6 +79,7 @@ patternProperties:
               - nvidia,tegra186-emc
               - nvidia,tegra194-emc
               - nvidia,tegra234-emc
+              - nvidia,tegra264-emc
 
       reg:
         minItems: 1
@@ -127,6 +133,15 @@ patternProperties:
             reg:
               minItems: 2
 
+      - if:
+          properties:
+            compatible:
+              const: nvidia,tegra264-emc
+        then:
+          properties:
+            reg:
+              minItems: 2
+
     additionalProperties: false
 
     required:
@@ -220,6 +235,52 @@ allOf:
             - const: ch14
             - const: ch15
 
+  - if:
+      properties:
+        compatible:
+          const: nvidia,tegra264-mc
+    then:
+      properties:
+        reg:
+          minItems: 17
+          description: 17 memory controller channels
+
+        reg-names:
+          items:
+            - const: broadcast
+            - const: ch0
+            - const: ch1
+            - const: ch2
+            - const: ch3
+            - const: ch4
+            - const: ch5
+            - const: ch6
+            - const: ch7
+            - const: ch8
+            - const: ch9
+            - const: ch10
+            - const: ch11
+            - const: ch12
+            - const: ch13
+            - const: ch14
+            - const: ch15
+
+        interrupts:
+          minItems: 8
+          maxItems: 8
+          description: One interrupt line for each MC component
+
+        interrupt-names:
+          items:
+            - const: mcf
+            - const: hub1
+            - const: hub2
+            - const: hub3
+            - const: hub4
+            - const: hub5
+            - const: sbs
+            - const: channel
+
 additionalProperties: false
 
 required:
-- 
2.50.0
Re: [PATCH 1/4] dt-bindings: memory: tegra: Add Tegra264 support
Posted by Krzysztof Kozlowski 2 months, 4 weeks ago
On 08/07/2025 12:52, Thierry Reding wrote:
>    interrupts:
> -    items:
> -      - description: MC general interrupt
> +    minItems: 1
> +    maxItems: 8
> +
> +  interrupt-names:
> +    minItems: 1
> +    maxItems: 8
>  
>    "#address-cells":
>      const: 2
> @@ -74,6 +79,7 @@ patternProperties:
>                - nvidia,tegra186-emc
>                - nvidia,tegra194-emc
>                - nvidia,tegra234-emc
> +              - nvidia,tegra264-emc
>  
>        reg:
>          minItems: 1
> @@ -127,6 +133,15 @@ patternProperties:
>              reg:
>                minItems: 2
>  
> +      - if:
> +          properties:
> +            compatible:
> +              const: nvidia,tegra264-emc
> +        then:
> +          properties:
> +            reg:
> +              minItems: 2
> +
>      additionalProperties: false
>  
>      required:
> @@ -220,6 +235,52 @@ allOf:
>              - const: ch14
>              - const: ch15
>  
> +  - if:
> +      properties:
> +        compatible:
> +          const: nvidia,tegra264-mc
> +    then:
> +      properties:
> +        reg:
> +          minItems: 17

Missing maxItems

> +          description: 17 memory controller channels
> +
> +        reg-names:
> +          items:
> +            - const: broadcast
> +            - const: ch0
> +            - const: ch1
> +            - const: ch2
> +            - const: ch3
> +            - const: ch4
> +            - const: ch5
> +            - const: ch6
> +            - const: ch7
> +            - const: ch8
> +            - const: ch9
> +            - const: ch10
> +            - const: ch11
> +            - const: ch12
> +            - const: ch13
> +            - const: ch14
> +            - const: ch15
> +
> +        interrupts:
> +          minItems: 8
> +          maxItems: 8
> +          description: One interrupt line for each MC component
> +
> +        interrupt-names:
> +          items:
> +            - const: mcf
> +            - const: hub1
> +            - const: hub2
> +            - const: hub3
> +            - const: hub4
> +            - const: hub5
> +            - const: sbs
> +            - const: channel


Missing constraints for interrupts and interrupt-names for all other
variants. Now this patch claims they all have 8 interrupts with any name.



Best regards,
Krzysztof
Re: [PATCH 1/4] dt-bindings: memory: tegra: Add Tegra264 support
Posted by Thierry Reding 2 months, 4 weeks ago
On Wed, Jul 09, 2025 at 08:19:51PM +0200, Krzysztof Kozlowski wrote:
> On 08/07/2025 12:52, Thierry Reding wrote:
> >    interrupts:
> > -    items:
> > -      - description: MC general interrupt
> > +    minItems: 1
> > +    maxItems: 8
> > +
> > +  interrupt-names:
> > +    minItems: 1
> > +    maxItems: 8
> >  
> >    "#address-cells":
> >      const: 2
> > @@ -74,6 +79,7 @@ patternProperties:
> >                - nvidia,tegra186-emc
> >                - nvidia,tegra194-emc
> >                - nvidia,tegra234-emc
> > +              - nvidia,tegra264-emc
> >  
> >        reg:
> >          minItems: 1
> > @@ -127,6 +133,15 @@ patternProperties:
> >              reg:
> >                minItems: 2
> >  
> > +      - if:
> > +          properties:
> > +            compatible:
> > +              const: nvidia,tegra264-emc
> > +        then:
> > +          properties:
> > +            reg:
> > +              minItems: 2
> > +
> >      additionalProperties: false
> >  
> >      required:
> > @@ -220,6 +235,52 @@ allOf:
> >              - const: ch14
> >              - const: ch15
> >  
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          const: nvidia,tegra264-mc
> > +    then:
> > +      properties:
> > +        reg:
> > +          minItems: 17
> 
> Missing maxItems

My recollection was that maxItems didn't have to be specified if we
already have minItems and they are both equal. That said, I see now
there are a few cases in existing bindings where both are used in
conjunction, so I must be misremembering. I've added "maxItems: 17".

> 
> > +          description: 17 memory controller channels
> > +
> > +        reg-names:
> > +          items:
> > +            - const: broadcast
> > +            - const: ch0
> > +            - const: ch1
> > +            - const: ch2
> > +            - const: ch3
> > +            - const: ch4
> > +            - const: ch5
> > +            - const: ch6
> > +            - const: ch7
> > +            - const: ch8
> > +            - const: ch9
> > +            - const: ch10
> > +            - const: ch11
> > +            - const: ch12
> > +            - const: ch13
> > +            - const: ch14
> > +            - const: ch15
> > +
> > +        interrupts:
> > +          minItems: 8
> > +          maxItems: 8
> > +          description: One interrupt line for each MC component
> > +
> > +        interrupt-names:
> > +          items:
> > +            - const: mcf
> > +            - const: hub1
> > +            - const: hub2
> > +            - const: hub3
> > +            - const: hub4
> > +            - const: hub5
> > +            - const: sbs
> > +            - const: channel
> 
> 
> Missing constraints for interrupts and interrupt-names for all other
> variants. Now this patch claims they all have 8 interrupts with any name.

I'll add back the interrupts property for the other variants. For the
interrupt-names it's slightly more tricky because on older variants we
don't need it since there's only one interrupt. It looks like I can do
"interrupt-names: false" in those cases.

Thanks,
Thierry
Re: [PATCH 1/4] dt-bindings: memory: tegra: Add Tegra264 support
Posted by Krzysztof Kozlowski 2 months, 4 weeks ago
On 09/07/2025 22:36, Thierry Reding wrote:
> On Wed, Jul 09, 2025 at 08:19:51PM +0200, Krzysztof Kozlowski wrote:
>> On 08/07/2025 12:52, Thierry Reding wrote:
>>>    interrupts:
>>> -    items:
>>> -      - description: MC general interrupt
>>> +    minItems: 1
>>> +    maxItems: 8
>>> +
>>> +  interrupt-names:
>>> +    minItems: 1
>>> +    maxItems: 8
>>>  
>>>    "#address-cells":
>>>      const: 2
>>> @@ -74,6 +79,7 @@ patternProperties:
>>>                - nvidia,tegra186-emc
>>>                - nvidia,tegra194-emc
>>>                - nvidia,tegra234-emc
>>> +              - nvidia,tegra264-emc
>>>  
>>>        reg:
>>>          minItems: 1
>>> @@ -127,6 +133,15 @@ patternProperties:
>>>              reg:
>>>                minItems: 2
>>>  
>>> +      - if:
>>> +          properties:
>>> +            compatible:
>>> +              const: nvidia,tegra264-emc
>>> +        then:
>>> +          properties:
>>> +            reg:
>>> +              minItems: 2
>>> +
>>>      additionalProperties: false
>>>  
>>>      required:
>>> @@ -220,6 +235,52 @@ allOf:
>>>              - const: ch14
>>>              - const: ch15
>>>  
>>> +  - if:
>>> +      properties:
>>> +        compatible:
>>> +          const: nvidia,tegra264-mc
>>> +    then:
>>> +      properties:
>>> +        reg:
>>> +          minItems: 17
>>
>> Missing maxItems
> 
> My recollection was that maxItems didn't have to be specified if we
> already have minItems and they are both equal. That said, I see now

There was never such rule.

> there are a few cases in existing bindings where both are used in
> conjunction, so I must be misremembering. I've added "maxItems: 17".
> 
>>
>>> +          description: 17 memory controller channels
>>> +
>>> +        reg-names:
>>> +          items:
>>> +            - const: broadcast
>>> +            - const: ch0
>>> +            - const: ch1
>>> +            - const: ch2
>>> +            - const: ch3
>>> +            - const: ch4
>>> +            - const: ch5
>>> +            - const: ch6
>>> +            - const: ch7
>>> +            - const: ch8
>>> +            - const: ch9
>>> +            - const: ch10
>>> +            - const: ch11
>>> +            - const: ch12
>>> +            - const: ch13
>>> +            - const: ch14
>>> +            - const: ch15
>>> +
>>> +        interrupts:
>>> +          minItems: 8
>>> +          maxItems: 8
>>> +          description: One interrupt line for each MC component
>>> +
>>> +        interrupt-names:
>>> +          items:
>>> +            - const: mcf
>>> +            - const: hub1
>>> +            - const: hub2
>>> +            - const: hub3
>>> +            - const: hub4
>>> +            - const: hub5
>>> +            - const: sbs
>>> +            - const: channel
>>
>>
>> Missing constraints for interrupts and interrupt-names for all other
>> variants. Now this patch claims they all have 8 interrupts with any name.
> 
> I'll add back the interrupts property for the other variants. For the
> interrupt-names it's slightly more tricky because on older variants we
> don't need it since there's only one interrupt. It looks like I can do
> "interrupt-names: false" in those cases.

Yes.

> 
> Thanks,
> Thierry


Best regards,
Krzysztof