diff mbox series

[net-next,v5,1/9] dt-bindings: net: Expand pcs-handle to an array

Message ID 20220926190322.2889342-2-sean.anderson@seco.com (mailing list archive)
State New, archived
Headers show
Series net: dpaa: Convert to phylink | expand

Commit Message

Sean Anderson Sept. 26, 2022, 7:03 p.m. UTC
This allows multiple phandles to be specified for pcs-handle, such as
when multiple PCSs are present for a single MAC. To differentiate
between them, also add a pcs-handle-names property.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---
This was previously submitted as [1]. I expect to update this series
more, so I have moved it here. Changes from that version include:
- Add maxItems to existing bindings
- Add a dependency from pcs-names to pcs-handle.

[1] https://lore.kernel.org/netdev/20220711160519.741990-3-sean.anderson@seco.com/

(no changes since v4)

Changes in v4:
- Use pcs-handle-names instead of pcs-names, as discussed

Changes in v3:
- New

 .../bindings/net/dsa/renesas,rzn1-a5psw.yaml           |  1 +
 .../devicetree/bindings/net/ethernet-controller.yaml   | 10 +++++++++-
 .../devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml    |  2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

Comments

Rob Herring Sept. 27, 2022, 2:39 p.m. UTC | #1
On Mon, 26 Sep 2022 15:03:13 -0400, Sean Anderson wrote:
> This allows multiple phandles to be specified for pcs-handle, such as
> when multiple PCSs are present for a single MAC. To differentiate
> between them, also add a pcs-handle-names property.
> 
> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
> ---
> This was previously submitted as [1]. I expect to update this series
> more, so I have moved it here. Changes from that version include:
> - Add maxItems to existing bindings
> - Add a dependency from pcs-names to pcs-handle.
> 
> [1] https://lore.kernel.org/netdev/20220711160519.741990-3-sean.anderson@seco.com/
> 
> (no changes since v4)
> 
> Changes in v4:
> - Use pcs-handle-names instead of pcs-names, as discussed
> 
> Changes in v3:
> - New
> 
>  .../bindings/net/dsa/renesas,rzn1-a5psw.yaml           |  1 +
>  .../devicetree/bindings/net/ethernet-controller.yaml   | 10 +++++++++-
>  .../devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml    |  2 +-
>  3 files changed, 11 insertions(+), 2 deletions(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml: properties:ethernet-ports:patternProperties:^(ethernet-)?port@[0-4]$:properties:pcs-handle:maxItems: False schema does not allow 1
	hint: Scalar properties should not have array keywords
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml: ignoring, error in schema: properties: ethernet-ports: patternProperties: ^(ethernet-)?port@[0-4]$: properties: pcs-handle: maxItems
Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.example.dtb:0:0: /example-0/switch@44050000: failed to match any schema with compatible: ['renesas,r9a06g032-a5psw', 'renesas,rzn1-a5psw']
Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.example.dtb:0:0: /example-0/switch@44050000: failed to match any schema with compatible: ['renesas,r9a06g032-a5psw', 'renesas,rzn1-a5psw']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Rob Herring Sept. 27, 2022, 3:33 p.m. UTC | #2
On Mon, Sep 26, 2022 at 03:03:13PM -0400, Sean Anderson wrote:
> This allows multiple phandles to be specified for pcs-handle, such as
> when multiple PCSs are present for a single MAC. To differentiate
> between them, also add a pcs-handle-names property.
> 
> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
> ---
> This was previously submitted as [1]. I expect to update this series
> more, so I have moved it here. Changes from that version include:
> - Add maxItems to existing bindings
> - Add a dependency from pcs-names to pcs-handle.
> 
> [1] https://lore.kernel.org/netdev/20220711160519.741990-3-sean.anderson@seco.com/
> 
> (no changes since v4)
> 
> Changes in v4:
> - Use pcs-handle-names instead of pcs-names, as discussed
> 
> Changes in v3:
> - New
> 
>  .../bindings/net/dsa/renesas,rzn1-a5psw.yaml           |  1 +
>  .../devicetree/bindings/net/ethernet-controller.yaml   | 10 +++++++++-
>  .../devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml    |  2 +-
>  3 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> index 7ca9c19a157c..a53552ee1d0e 100644
> --- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> @@ -74,6 +74,7 @@ properties:
>  
>          properties:
>            pcs-handle:
> +            maxItems: 1

Forgot to remove the $ref here.

>              description:
>                phandle pointing to a PCS sub-node compatible with
>                renesas,rzn1-miic.yaml#
> diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> index 4b3c590fcebf..5bb2ec2963cf 100644
> --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
> @@ -108,11 +108,16 @@ properties:
>      $ref: "#/properties/phy-connection-type"
>  
>    pcs-handle:
> -    $ref: /schemas/types.yaml#/definitions/phandle
> +    $ref: /schemas/types.yaml#/definitions/phandle-array

'phandle-array' is really a matrix, so this needs a bit more:

items:
  maxItems: 1

Which basically says this is phandles with no arg cells.

>      description:
>        Specifies a reference to a node representing a PCS PHY device on a MDIO
>        bus to link with an external PHY (phy-handle) if exists.
>  
> +  pcs-handle-names:
> +    $ref: /schemas/types.yaml#/definitions/string-array

No need for a type as *-names already has a type.

> +    description:
> +      The name of each PCS in pcs-handle.
> +
>    phy-handle:
>      $ref: /schemas/types.yaml#/definitions/phandle
>      description:
> @@ -216,6 +221,9 @@ properties:
>          required:
>            - speed
>  
> +dependencies:
> +  pcs-handle-names: [pcs-handle]
> +
>  allOf:
>    - if:
>        properties:
> diff --git a/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml b/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml
> index 7f620a71a972..600240281e8c 100644
> --- a/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml
> +++ b/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml
> @@ -31,7 +31,7 @@ properties:
>    phy-mode: true
>  
>    pcs-handle:
> -    $ref: /schemas/types.yaml#/definitions/phandle
> +    maxItems: 1
>      description:
>        A reference to a node representing a PCS PHY device found on
>        the internal MDIO bus.
> -- 
> 2.35.1.1320.gc452695387.dirty
> 
>
Sean Anderson Sept. 27, 2022, 4:27 p.m. UTC | #3
On 9/27/22 11:33 AM, Rob Herring wrote:
> On Mon, Sep 26, 2022 at 03:03:13PM -0400, Sean Anderson wrote:
>> This allows multiple phandles to be specified for pcs-handle, such as
>> when multiple PCSs are present for a single MAC. To differentiate
>> between them, also add a pcs-handle-names property.
>> 
>> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
>> ---
>> This was previously submitted as [1]. I expect to update this series
>> more, so I have moved it here. Changes from that version include:
>> - Add maxItems to existing bindings
>> - Add a dependency from pcs-names to pcs-handle.
>> 
>> [1] https://lore.kernel.org/netdev/20220711160519.741990-3-sean.anderson@seco.com/
>> 
>> (no changes since v4)
>> 
>> Changes in v4:
>> - Use pcs-handle-names instead of pcs-names, as discussed
>> 
>> Changes in v3:
>> - New
>> 
>>  .../bindings/net/dsa/renesas,rzn1-a5psw.yaml           |  1 +
>>  .../devicetree/bindings/net/ethernet-controller.yaml   | 10 +++++++++-
>>  .../devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml    |  2 +-
>>  3 files changed, 11 insertions(+), 2 deletions(-)
>> 
>> diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
>> index 7ca9c19a157c..a53552ee1d0e 100644
>> --- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
>> +++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
>> @@ -74,6 +74,7 @@ properties:
>>  
>>          properties:
>>            pcs-handle:
>> +            maxItems: 1
> 
> Forgot to remove the $ref here.
> 
>>              description:
>>                phandle pointing to a PCS sub-node compatible with
>>                renesas,rzn1-miic.yaml#
>> diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
>> index 4b3c590fcebf..5bb2ec2963cf 100644
>> --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
>> +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
>> @@ -108,11 +108,16 @@ properties:
>>      $ref: "#/properties/phy-connection-type"
>>  
>>    pcs-handle:
>> -    $ref: /schemas/types.yaml#/definitions/phandle
>> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> 
> 'phandle-array' is really a matrix, so this needs a bit more:
> 
> items:
>   maxItems: 1
> 
> Which basically says this is phandles with no arg cells.
> 
>>      description:
>>        Specifies a reference to a node representing a PCS PHY device on a MDIO
>>        bus to link with an external PHY (phy-handle) if exists.
>>  
>> +  pcs-handle-names:
>> +    $ref: /schemas/types.yaml#/definitions/string-array
> 
> No need for a type as *-names already has a type.
> 
>> +    description:
>> +      The name of each PCS in pcs-handle.
>> +
>>    phy-handle:
>>      $ref: /schemas/types.yaml#/definitions/phandle
>>      description:
>> @@ -216,6 +221,9 @@ properties:
>>          required:
>>            - speed
>>  
>> +dependencies:
>> +  pcs-handle-names: [pcs-handle]
>> +
>>  allOf:
>>    - if:
>>        properties:
>> diff --git a/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml b/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml
>> index 7f620a71a972..600240281e8c 100644
>> --- a/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml
>> +++ b/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml
>> @@ -31,7 +31,7 @@ properties:
>>    phy-mode: true
>>  
>>    pcs-handle:
>> -    $ref: /schemas/types.yaml#/definitions/phandle
>> +    maxItems: 1
>>      description:
>>        A reference to a node representing a PCS PHY device found on
>>        the internal MDIO bus.
>> -- 
>> 2.35.1.1320.gc452695387.dirty
>> 
>> 
> 

OK, I've added these changes for v6.

--Sean
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
index 7ca9c19a157c..a53552ee1d0e 100644
--- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
@@ -74,6 +74,7 @@  properties:
 
         properties:
           pcs-handle:
+            maxItems: 1
             description:
               phandle pointing to a PCS sub-node compatible with
               renesas,rzn1-miic.yaml#
diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
index 4b3c590fcebf..5bb2ec2963cf 100644
--- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
+++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
@@ -108,11 +108,16 @@  properties:
     $ref: "#/properties/phy-connection-type"
 
   pcs-handle:
-    $ref: /schemas/types.yaml#/definitions/phandle
+    $ref: /schemas/types.yaml#/definitions/phandle-array
     description:
       Specifies a reference to a node representing a PCS PHY device on a MDIO
       bus to link with an external PHY (phy-handle) if exists.
 
+  pcs-handle-names:
+    $ref: /schemas/types.yaml#/definitions/string-array
+    description:
+      The name of each PCS in pcs-handle.
+
   phy-handle:
     $ref: /schemas/types.yaml#/definitions/phandle
     description:
@@ -216,6 +221,9 @@  properties:
         required:
           - speed
 
+dependencies:
+  pcs-handle-names: [pcs-handle]
+
 allOf:
   - if:
       properties:
diff --git a/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml b/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml
index 7f620a71a972..600240281e8c 100644
--- a/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml
+++ b/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml
@@ -31,7 +31,7 @@  properties:
   phy-mode: true
 
   pcs-handle:
-    $ref: /schemas/types.yaml#/definitions/phandle
+    maxItems: 1
     description:
       A reference to a node representing a PCS PHY device found on
       the internal MDIO bus.