diff mbox series

[v5,03/12] dt-bindings: net: snps,dwmac: Add an optional resets single 'ahb'

Message ID 20230303085928.4535-4-samin.guo@starfivetech.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Add Ethernet driver for StarFive JH7110 SoC | expand

Checks

Context Check Description
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Guo Samin March 3, 2023, 8:59 a.m. UTC
According to:
stmmac_platform.c: stmmac_probe_config_dt
stmmac_main.c: stmmac_dvr_probe

dwmac controller may require one (stmmaceth) or two (stmmaceth+ahb)
reset signals, and the maxItems of resets/reset-names is going to be 2.

Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
---
 .../devicetree/bindings/net/snps,dwmac.yaml        | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

Comments

Rob Herring (Arm) March 8, 2023, 9:57 p.m. UTC | #1
On Fri, Mar 03, 2023 at 04:59:19PM +0800, Samin Guo wrote:
> According to:
> stmmac_platform.c: stmmac_probe_config_dt
> stmmac_main.c: stmmac_dvr_probe

That's not really a reason on its own. Maybe the driver is wrong. Do we 
know what hardware needs this?

> dwmac controller may require one (stmmaceth) or two (stmmaceth+ahb)
> reset signals, and the maxItems of resets/reset-names is going to be 2.
> 
> Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
> ---
>  .../devicetree/bindings/net/snps,dwmac.yaml        | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index b4135d5297b4..89099a888f0b 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -133,12 +133,18 @@ properties:
>          - ptp_ref
>  
>    resets:
> -    maxItems: 1
> -    description:
> -      MAC Reset signal.
> +    minItems: 1
> +    items:
> +      - description: GMAC stmmaceth reset
> +      - description: AHB reset
>  
>    reset-names:
> -    const: stmmaceth
> +    minItems: 1
> +    maxItems: 2
> +    contains:

This means 'reset-names = "foo", "ahb";' is valid. You want 'items' 
instead. However, that still allows the below string in any order. Do we 
really need that? If not, then you want:

items:
  - const: stmmaceth
  - const: ahb

> +      enum:
> +        - stmmaceth
> +        - ahb
>  
>    power-domains:
>      maxItems: 1
> -- 
> 2.17.1
>
Guo Samin March 9, 2023, 3:10 a.m. UTC | #2
Re: [PATCH v5 03/12] dt-bindings: net: snps,dwmac: Add an optional resets single 'ahb'
From: Rob Herring <robh@kernel.org>

> On Fri, Mar 03, 2023 at 04:59:19PM +0800, Samin Guo wrote:
>> According to:
>> stmmac_platform.c: stmmac_probe_config_dt
>> stmmac_main.c: stmmac_dvr_probe
> 
> That's not really a reason on its own. Maybe the driver is wrong. Do we 
> know what hardware needs this?
> 
Hi Rob, Starfive JH7110 SOC must have two resets (stmmaceth+ahb), it uses snps,dwmac-5.20 IP.

Best regards,
Samin
>> dwmac controller may require one (stmmaceth) or two (stmmaceth+ahb)
>> reset signals, and the maxItems of resets/reset-names is going to be 2.
>>
>> Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
>> ---
>>  .../devicetree/bindings/net/snps,dwmac.yaml        | 14 ++++++++++----
>>  1 file changed, 10 insertions(+), 4 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> index b4135d5297b4..89099a888f0b 100644
>> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>> @@ -133,12 +133,18 @@ properties:
>>          - ptp_ref
>>  
>>    resets:
>> -    maxItems: 1
>> -    description:
>> -      MAC Reset signal.
>> +    minItems: 1
>> +    items:
>> +      - description: GMAC stmmaceth reset
>> +      - description: AHB reset
>>  
>>    reset-names:
>> -    const: stmmaceth
>> +    minItems: 1
>> +    maxItems: 2
>> +    contains:
> 
> This means 'reset-names = "foo", "ahb";' is valid. You want 'items' 
> instead. However, that still allows the below string in any order. Do we 
> really need that? If not, then you want:
> 
> items:
>   - const: stmmaceth
>   - const: ahb
> 
Thank you for your guidance. It will be better to modify it in this way, I will fix it in next version.

Best regards,
Samin
>> +      enum:
>> +        - stmmaceth
>> +        - ahb
>>  
>>    power-domains:
>>      maxItems: 1
>> -- 
>> 2.17.1
>>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index b4135d5297b4..89099a888f0b 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -133,12 +133,18 @@  properties:
         - ptp_ref
 
   resets:
-    maxItems: 1
-    description:
-      MAC Reset signal.
+    minItems: 1
+    items:
+      - description: GMAC stmmaceth reset
+      - description: AHB reset
 
   reset-names:
-    const: stmmaceth
+    minItems: 1
+    maxItems: 2
+    contains:
+      enum:
+        - stmmaceth
+        - ahb
 
   power-domains:
     maxItems: 1