diff mbox series

[v4,1/2] dt-bindings: net: motorcomm: Add pad driver strength cfg

Message ID 20230714101406.17686-2-samin.guo@starfivetech.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Add motorcomm phy pad-driver-strength-cfg support | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers warning 3 maintainers not CCed: wol@1.8v wol@3.3v conor+dt@kernel.org
netdev/build_clang success Errors and warnings before: 9 this patch: 9
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 9 this patch: 9
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 52 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Guo Samin July 14, 2023, 10:14 a.m. UTC
The motorcomm phy (YT8531) supports the ability to adjust the drive
strength of the rx_clk/rx_data.

The YT8531 RGMII LDO voltage supports 1.8V/3.3V, and the
LDO voltage can be configured with hardware pull-up resistors to match
the SOC voltage (usually 1.8V). The software can read the registers
0xA001 obtain the current LDO voltage value.

When we configure the drive strength, we need to read the current LDO
voltage value to ensure that it is a legal value at that LDO voltage.

Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
---
 .../bindings/net/motorcomm,yt8xxx.yaml        | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)

Comments

Andrew Lunn July 14, 2023, 6:54 p.m. UTC | #1
> +  motorcomm,rx-clk-driver-strength:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: |
> +      drive strength of rx_clk rgmii pad.
> +      |----------------------------------|
> +      |        rx_clk ds map table       |
> +      |----------------------------------|
> +      | DS(3b) |  wol@1.8v  |  wol@3.3v  |
> +      |________|_________________________|
> +      |        | current(uA)| current(uA)|
> +      |   000  |     1200   |    3070    |
> +      |   001  |     2100   |    4080    |
> +      |   010  |     2700   |    4370    |
> +      |   011  |     2910   |    4680    |
> +      |   100  |     3110   |    5020    |
> +      |   101  |     3600   |    5450    |
> +      |   110  |     3970   |    5740    |
> +      |   111  |     4350   |    6140    |
> +      |--------|------------|------------|
> +    enum: [ 1200, 2100, 2700, 2910, 3070, 3110, 3600, 3970,
> +            4080, 4350, 4370, 4680, 5020, 5450, 5740, 6140 ]
> +    default: 2910

The DS(3b) value is not relevant to the binding. It is a driver
detail. So i would not bother listing it.

Please add a comment explaining what wol is. 

       Andrew
Rob Herring (Arm) July 15, 2023, 2:47 a.m. UTC | #2
On Fri, Jul 14, 2023 at 06:14:05PM +0800, Samin Guo wrote:
> The motorcomm phy (YT8531) supports the ability to adjust the drive
> strength of the rx_clk/rx_data.
> 
> The YT8531 RGMII LDO voltage supports 1.8V/3.3V, and the
> LDO voltage can be configured with hardware pull-up resistors to match
> the SOC voltage (usually 1.8V). The software can read the registers
> 0xA001 obtain the current LDO voltage value.
> 
> When we configure the drive strength, we need to read the current LDO
> voltage value to ensure that it is a legal value at that LDO voltage.
> 
> Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
> Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
> ---
>  .../bindings/net/motorcomm,yt8xxx.yaml        | 46 +++++++++++++++++++
>  1 file changed, 46 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml b/Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml
> index 157e3bbcaf6f..097bf143af35 100644
> --- a/Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml
> +++ b/Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml
> @@ -52,6 +52,52 @@ properties:
>        for a timer.
>      type: boolean
>  
> +  motorcomm,rx-clk-driver-strength:
> +    $ref: /schemas/types.yaml#/definitions/uint32

As the units are uA, drop the type and add '-microamp' suffix. 
'motorcomm,rx-clk-drv-microamp' is probably sufficient.

> +    description: |
> +      drive strength of rx_clk rgmii pad.
> +      |----------------------------------|
> +      |        rx_clk ds map table       |
> +      |----------------------------------|
> +      | DS(3b) |  wol@1.8v  |  wol@3.3v  |
> +      |________|_________________________|
> +      |        | current(uA)| current(uA)|
> +      |   000  |     1200   |    3070    |
> +      |   001  |     2100   |    4080    |
> +      |   010  |     2700   |    4370    |
> +      |   011  |     2910   |    4680    |
> +      |   100  |     3110   |    5020    |
> +      |   101  |     3600   |    5450    |
> +      |   110  |     3970   |    5740    |
> +      |   111  |     4350   |    6140    |
> +      |--------|------------|------------|
> +    enum: [ 1200, 2100, 2700, 2910, 3070, 3110, 3600, 3970,
> +            4080, 4350, 4370, 4680, 5020, 5450, 5740, 6140 ]
> +    default: 2910
> +
> +  motorcomm,rx-data-driver-strength:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: |
> +      drive strength of rx_data/rx_ctl rgmii pad.
> +      |----------------------------------|
> +      |        rx_data ds map table      |
> +      |----------------------------------|
> +      | DS(3b) |  wol@1.8v  |  wol@3.3v  |
> +      |________|_________________________|
> +      |        | current(uA)| current(uA)|
> +      |   000  |     1200   |    3070    |
> +      |   001  |     2100   |    4080    |
> +      |   010  |     2700   |    4370    |
> +      |   011  |     2910   |    4680    |
> +      |   100  |     3110   |    5020    |
> +      |   101  |     3600   |    5450    |
> +      |   110  |     3970   |    5740    |
> +      |   111  |     4350   |    6140    |
> +      |--------|------------|------------|
> +    enum: [ 1200, 2100, 2700, 2910, 3070, 3110, 3600, 3970,
> +            4080, 4350, 4370, 4680, 5020, 5450, 5740, 6140 ]
> +    default: 2910
> +
>    motorcomm,tx-clk-adj-enabled:
>      description: |
>        This configuration is mainly to adapt to VF2 with JH7110 SoC.
> -- 
> 2.17.1
>
Guo Samin July 17, 2023, 8:28 a.m. UTC | #3
-------- 原始信息 --------
主题: Re: [PATCH v4 1/2] dt-bindings: net: motorcomm: Add pad driver strength cfg
From: Andrew Lunn <andrew@lunn.ch>
收件人: Samin Guo <samin.guo@starfivetech.com>
日期: 2023/7/15

>> +  motorcomm,rx-clk-driver-strength:
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    description: |
>> +      drive strength of rx_clk rgmii pad.
>> +      |----------------------------------|
>> +      |        rx_clk ds map table       |
>> +      |----------------------------------|
>> +      | DS(3b) |  wol@1.8v  |  wol@3.3v  |
>> +      |________|_________________________|
>> +      |        | current(uA)| current(uA)|
>> +      |   000  |     1200   |    3070    |
>> +      |   001  |     2100   |    4080    |
>> +      |   010  |     2700   |    4370    |
>> +      |   011  |     2910   |    4680    |
>> +      |   100  |     3110   |    5020    |
>> +      |   101  |     3600   |    5450    |
>> +      |   110  |     3970   |    5740    |
>> +      |   111  |     4350   |    6140    |
>> +      |--------|------------|------------|
>> +    enum: [ 1200, 2100, 2700, 2910, 3070, 3110, 3600, 3970,
>> +            4080, 4350, 4370, 4680, 5020, 5450, 5740, 6140 ]
>> +    default: 2910
> 
> The DS(3b) value is not relevant to the binding. It is a driver
> detail. So i would not bother listing it.
> 
ok, will remove it.

> Please add a comment explaining what wol is. 
> 
>        Andrew

Sorry,it should be vol (voltage), not wol.

 
Best regards,
Samin
Guo Samin July 17, 2023, 8:35 a.m. UTC | #4
-------- 原始信息 --------
主题: Re: [PATCH v4 1/2] dt-bindings: net: motorcomm: Add pad driver strength cfg
From: Rob Herring <robh@kernel.org>
收件人: Samin Guo <samin.guo@starfivetech.com>
日期: 2023/7/15

> On Fri, Jul 14, 2023 at 06:14:05PM +0800, Samin Guo wrote:
>> The motorcomm phy (YT8531) supports the ability to adjust the drive
>> strength of the rx_clk/rx_data.
>>
>> The YT8531 RGMII LDO voltage supports 1.8V/3.3V, and the
>> LDO voltage can be configured with hardware pull-up resistors to match
>> the SOC voltage (usually 1.8V). The software can read the registers
>> 0xA001 obtain the current LDO voltage value.
>>
>> When we configure the drive strength, we need to read the current LDO
>> voltage value to ensure that it is a legal value at that LDO voltage.
>>
>> Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
>> Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
>> ---
>>  .../bindings/net/motorcomm,yt8xxx.yaml        | 46 +++++++++++++++++++
>>  1 file changed, 46 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml b/Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml
>> index 157e3bbcaf6f..097bf143af35 100644
>> --- a/Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml
>> +++ b/Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml
>> @@ -52,6 +52,52 @@ properties:
>>        for a timer.
>>      type: boolean
>>  
>> +  motorcomm,rx-clk-driver-strength:
>> +    $ref: /schemas/types.yaml#/definitions/uint32
> 
> As the units are uA, drop the type and add '-microamp' suffix. 
> 'motorcomm,rx-clk-drv-microamp' is probably sufficient.
>
Thanks for the guidance, will be improved in the next version.
 
>> +    description: |
>> +      drive strength of rx_clk rgmii pad.
>> +      |----------------------------------|
>> +      |        rx_clk ds map table       |
>> +      |----------------------------------|
>> +      | DS(3b) |  wol@1.8v  |  wol@3.3v  |
>> +      |________|_________________________|
>> +      |        | current(uA)| current(uA)|
>> +      |   000  |     1200   |    3070    |
>> +      |   001  |     2100   |    4080    |
>> +      |   010  |     2700   |    4370    |
>> +      |   011  |     2910   |    4680    |
>> +      |   100  |     3110   |    5020    |
>> +      |   101  |     3600   |    5450    |
>> +      |   110  |     3970   |    5740    |
>> +      |   111  |     4350   |    6140    |
>> +      |--------|------------|------------|
>> +    enum: [ 1200, 2100, 2700, 2910, 3070, 3110, 3600, 3970,
>> +            4080, 4350, 4370, 4680, 5020, 5450, 5740, 6140 ]
>> +    default: 2910
>> +
>> +  motorcomm,rx-data-driver-strength:
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    description: |
>> +      drive strength of rx_data/rx_ctl rgmii pad.
>> +      |----------------------------------|
>> +      |        rx_data ds map table      |
>> +      |----------------------------------|
>> +      | DS(3b) |  wol@1.8v  |  wol@3.3v  |
>> +      |________|_________________________|
>> +      |        | current(uA)| current(uA)|
>> +      |   000  |     1200   |    3070    |
>> +      |   001  |     2100   |    4080    |
>> +      |   010  |     2700   |    4370    |
>> +      |   011  |     2910   |    4680    |
>> +      |   100  |     3110   |    5020    |
>> +      |   101  |     3600   |    5450    |
>> +      |   110  |     3970   |    5740    |
>> +      |   111  |     4350   |    6140    |
>> +      |--------|------------|------------|
>> +    enum: [ 1200, 2100, 2700, 2910, 3070, 3110, 3600, 3970,
>> +            4080, 4350, 4370, 4680, 5020, 5450, 5740, 6140 ]
>> +    default: 2910
>> +
>>    motorcomm,tx-clk-adj-enabled:
>>      description: |
>>        This configuration is mainly to adapt to VF2 with JH7110 SoC.
>> -- 
>> 2.17.1
>>

Best regards,
Samin
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml b/Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml
index 157e3bbcaf6f..097bf143af35 100644
--- a/Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml
+++ b/Documentation/devicetree/bindings/net/motorcomm,yt8xxx.yaml
@@ -52,6 +52,52 @@  properties:
       for a timer.
     type: boolean
 
+  motorcomm,rx-clk-driver-strength:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      drive strength of rx_clk rgmii pad.
+      |----------------------------------|
+      |        rx_clk ds map table       |
+      |----------------------------------|
+      | DS(3b) |  wol@1.8v  |  wol@3.3v  |
+      |________|_________________________|
+      |        | current(uA)| current(uA)|
+      |   000  |     1200   |    3070    |
+      |   001  |     2100   |    4080    |
+      |   010  |     2700   |    4370    |
+      |   011  |     2910   |    4680    |
+      |   100  |     3110   |    5020    |
+      |   101  |     3600   |    5450    |
+      |   110  |     3970   |    5740    |
+      |   111  |     4350   |    6140    |
+      |--------|------------|------------|
+    enum: [ 1200, 2100, 2700, 2910, 3070, 3110, 3600, 3970,
+            4080, 4350, 4370, 4680, 5020, 5450, 5740, 6140 ]
+    default: 2910
+
+  motorcomm,rx-data-driver-strength:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      drive strength of rx_data/rx_ctl rgmii pad.
+      |----------------------------------|
+      |        rx_data ds map table      |
+      |----------------------------------|
+      | DS(3b) |  wol@1.8v  |  wol@3.3v  |
+      |________|_________________________|
+      |        | current(uA)| current(uA)|
+      |   000  |     1200   |    3070    |
+      |   001  |     2100   |    4080    |
+      |   010  |     2700   |    4370    |
+      |   011  |     2910   |    4680    |
+      |   100  |     3110   |    5020    |
+      |   101  |     3600   |    5450    |
+      |   110  |     3970   |    5740    |
+      |   111  |     4350   |    6140    |
+      |--------|------------|------------|
+    enum: [ 1200, 2100, 2700, 2910, 3070, 3110, 3600, 3970,
+            4080, 4350, 4370, 4680, 5020, 5450, 5740, 6140 ]
+    default: 2910
+
   motorcomm,tx-clk-adj-enabled:
     description: |
       This configuration is mainly to adapt to VF2 with JH7110 SoC.