diff mbox series

[RFC,net-next,2/3] dt-bindings: net: mscc-miim: add clock and clock-frequency

Message ID 20220331151440.3643482-2-michael@walle.cc (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series [RFC,net-next,1/3] dt-bindings: net: convert mscc-miim to YAML format | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter warning Series does not have a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Michael Walle March 31, 2022, 3:14 p.m. UTC
Add the (optional) clock input of the MDIO controller and indicate that
the common clock-frequency property is supported. The driver can use it
to set the desired MDIO bus frequency.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 Documentation/devicetree/bindings/net/mscc,miim.yaml | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Krzysztof Kozlowski March 31, 2022, 8:05 p.m. UTC | #1
On 31/03/2022 17:14, Michael Walle wrote:
> Add the (optional) clock input of the MDIO controller and indicate that
> the common clock-frequency property is supported. The driver can use it
> to set the desired MDIO bus frequency.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
>  Documentation/devicetree/bindings/net/mscc,miim.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/mscc,miim.yaml b/Documentation/devicetree/bindings/net/mscc,miim.yaml
> index b52bf1732755..e9e8ddcdade9 100644
> --- a/Documentation/devicetree/bindings/net/mscc,miim.yaml
> +++ b/Documentation/devicetree/bindings/net/mscc,miim.yaml
> @@ -32,6 +32,11 @@ properties:
>  
>    interrupts: true
>  
> +  clocks:
> +    maxItems: 1
> +
> +  clock-frequency: true

This looks unusual clock-frequency is usually for clock providers but
this is a consumer, so it is not a common frequency here. You mention
that "driver can use it", so it's not a hardware description but some
feature for the driver. We have this already - use assigned-clock* in
your DTS.

Best regards,
Krzysztof
Andrew Lunn March 31, 2022, 8:16 p.m. UTC | #2
On Thu, Mar 31, 2022 at 10:05:48PM +0200, Krzysztof Kozlowski wrote:
> On 31/03/2022 17:14, Michael Walle wrote:
> > Add the (optional) clock input of the MDIO controller and indicate that
> > the common clock-frequency property is supported. The driver can use it
> > to set the desired MDIO bus frequency.
> > 
> > Signed-off-by: Michael Walle <michael@walle.cc>
> > ---
> >  Documentation/devicetree/bindings/net/mscc,miim.yaml | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/mscc,miim.yaml b/Documentation/devicetree/bindings/net/mscc,miim.yaml
> > index b52bf1732755..e9e8ddcdade9 100644
> > --- a/Documentation/devicetree/bindings/net/mscc,miim.yaml
> > +++ b/Documentation/devicetree/bindings/net/mscc,miim.yaml
> > @@ -32,6 +32,11 @@ properties:
> >  
> >    interrupts: true
> >  
> > +  clocks:
> > +    maxItems: 1
> > +
> > +  clock-frequency: true
> 
> This looks unusual clock-frequency is usually for clock providers but
> this is a consumer, so it is not a common frequency here. You mention
> that "driver can use it", so it's not a hardware description but some
> feature for the driver. We have this already - use assigned-clock* in
> your DTS.

Please see

Documentation/devicetree/bindings/net/mdio.yaml

  clock-frequency:
    description:
      Desired MDIO bus clock frequency in Hz. Values greater than IEEE 802.3
      defined 2.5MHz should only be used when all devices on the bus support
      the given clock speed.

The MDIO bus master provides the MDIO bus clock, so in a sense, the
device is a provider. although it does also make use of the clock
itself. It is a hardware description, because the users of the bus
make use of the clock, i.e. the PHY devices on the bus.

It is also identical to i2c bus masters
Documentation/devicetree/bindings/i2c/i2c.txt says:

- clock-frequency
        frequency of bus clock in Hz.

   Andrew
Krzysztof Kozlowski March 31, 2022, 8:30 p.m. UTC | #3
On 31/03/2022 22:16, Andrew Lunn wrote:
> On Thu, Mar 31, 2022 at 10:05:48PM +0200, Krzysztof Kozlowski wrote:
>> On 31/03/2022 17:14, Michael Walle wrote:
>>> Add the (optional) clock input of the MDIO controller and indicate that
>>> the common clock-frequency property is supported. The driver can use it
>>> to set the desired MDIO bus frequency.
>>>
>>> Signed-off-by: Michael Walle <michael@walle.cc>
>>> ---
>>>  Documentation/devicetree/bindings/net/mscc,miim.yaml | 5 +++++
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/net/mscc,miim.yaml b/Documentation/devicetree/bindings/net/mscc,miim.yaml
>>> index b52bf1732755..e9e8ddcdade9 100644
>>> --- a/Documentation/devicetree/bindings/net/mscc,miim.yaml
>>> +++ b/Documentation/devicetree/bindings/net/mscc,miim.yaml
>>> @@ -32,6 +32,11 @@ properties:
>>>  
>>>    interrupts: true
>>>  
>>> +  clocks:
>>> +    maxItems: 1
>>> +
>>> +  clock-frequency: true
>>
>> This looks unusual clock-frequency is usually for clock providers but
>> this is a consumer, so it is not a common frequency here. You mention
>> that "driver can use it", so it's not a hardware description but some
>> feature for the driver. We have this already - use assigned-clock* in
>> your DTS.
> 
> Please see
> 
> Documentation/devicetree/bindings/net/mdio.yaml
> 
>   clock-frequency:
>     description:
>       Desired MDIO bus clock frequency in Hz. Values greater than IEEE 802.3
>       defined 2.5MHz should only be used when all devices on the bus support
>       the given clock speed.
> 
> The MDIO bus master provides the MDIO bus clock, so in a sense, the
> device is a provider. although it does also make use of the clock
> itself. It is a hardware description, because the users of the bus
> make use of the clock, i.e. the PHY devices on the bus.
> 
> It is also identical to i2c bus masters
> Documentation/devicetree/bindings/i2c/i2c.txt says:
> 

Thanks, it's good. Indeed buses also use this property.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/mscc,miim.yaml b/Documentation/devicetree/bindings/net/mscc,miim.yaml
index b52bf1732755..e9e8ddcdade9 100644
--- a/Documentation/devicetree/bindings/net/mscc,miim.yaml
+++ b/Documentation/devicetree/bindings/net/mscc,miim.yaml
@@ -32,6 +32,11 @@  properties:
 
   interrupts: true
 
+  clocks:
+    maxItems: 1
+
+  clock-frequency: true
+
 required:
   - compatible
   - reg