diff mbox series

[net-next,1/2] dt-bindings: net: airoha,en8811h: Add en8811h serdes polarity

Message ID 20240206194751.1901802-2-ericwouds@gmail.com
State Changes Requested
Headers show
Series Add en8811h phy driver and devicetree binding doc | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Eric Woudstra Feb. 6, 2024, 7:47 p.m. UTC
The en8811h phy can be set with serdes polarity reversed on rx and/or tx.

Changed from rfc patch:

Explicitly say what -rx and -tx means.

Signed-off-by: Eric Woudstra <ericwouds@gmail.com>
---
 .../bindings/net/airoha,en8811h.yaml          | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/airoha,en8811h.yaml

Comments

Krzysztof Kozlowski Feb. 7, 2024, 7:52 a.m. UTC | #1
On 06/02/2024 20:47, Eric Woudstra wrote:
> The en8811h phy can be set with serdes polarity reversed on rx and/or tx.
> 
> Changed from rfc patch:
> 
> Explicitly say what -rx and -tx means.

I don't know what does it mean. This is v1, so we don't expect
changelog. If this is v2 (because there was RFC/RFT/RFkisses/RFhugs
which are states of patchsets, not versions), then please mark it as v2
and put changelog under ---.

> 
> Signed-off-by: Eric Woudstra <ericwouds@gmail.com>
> ---
>  .../bindings/net/airoha,en8811h.yaml          | 44 +++++++++++++++++++
>  1 file changed, 44 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/airoha,en8811h.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/airoha,en8811h.yaml b/Documentation/devicetree/bindings/net/airoha,en8811h.yaml
> new file mode 100644
> index 000000000000..99898e2bed64
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/airoha,en8811h.yaml
> @@ -0,0 +1,44 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/airoha,en8811h.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Airoha EN8811H PHY
> +
> +maintainers:
> +  - Eric Woudstra <ericwouds@gmail.com>
> +
> +description:
> +  Bindings for Airoha EN8811H PHY

Drop "Bindings for" and instead describe the hardware. You are
duplicating now title.


> +
> +allOf:
> +  - $ref: ethernet-phy.yaml#
> +
> +properties:

This won't match to anything... missing compatible. You probably want to
align with ongoing work on the lists.


> +  airoha,pnswap-rx:
> +    type: boolean
> +    description:
> +      Reverse rx polarity of the SERDES. This is the receiving
> +      side of the lines from the MAC towards the EN881H.
> +
> +

Only one blank line.

> +  airoha,pnswap-tx:
> +    type: boolean
> +    description:
> +      Reverse tx polarity of SERDES. This is the transmitting
> +      side of the lines from EN8811H towards the MAC.
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    mdio {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        ethphy1: ethernet-phy@1 {
> +                reg = <1>;
> +                airoha,pnswap-rx;

You have broken indentation.

Use 4 spaces for example indentation.

> +        };
> +    };

Best regards,
Krzysztof
Eric Woudstra Feb. 7, 2024, 4:42 p.m. UTC | #2
Hi krzysztof,

I mistakenly thought that changing from rfc-patch to patch, the number
would reset. I will mark the next one v2, or do you want me to mark it v3?

I have been using realtek,rtl82xx.yaml as an example. I see all your
comments apply to this file also, so it would seem I could have chosen
a better example. I will change it according your remarks.

>> +
>> +allOf:
>> +  - $ref: ethernet-phy.yaml#
>> +
>> +properties:
> 
> This won't match to anything... missing compatible. You probably want to
> align with ongoing work on the lists.

As for the compatible string, the PHY reports it's c45-id okay and
phylink can find the driver with this id. Therefore I have left the
compatible string out of the devicetree node of the phy and not
specified it in the binding (also same as realtek,rtl82xx.yaml).

If you are implying that I need to use it, then I will add:

select:
  properties:
    compatible:
      contains:
        enum:
          - ethernet-phy-id03a2.a411
  required:
    - compatible

To the binding, and

	compatible = "ethernet-phy-id03a2.a411";

To the devicetree node of the phy again.

Best regards,

Eric Woudstra
Andrew Lunn Feb. 7, 2024, 6:40 p.m. UTC | #3
> As for the compatible string, the PHY reports it's c45-id okay and
> phylink can find the driver with this id. Therefore I have left the
> compatible string out of the devicetree node of the phy and not
> specified it in the binding (also same as realtek,rtl82xx.yaml).

As you pointed out, the kernel does not require a compatible. So in
your board DT blob, you don't need it.

In the binding document, you can indicate a compatible can optionally
be used, and in the example its a good idea it actually use it, so
that the example gets checked by the tools.

     Andrew
Rob Herring (Arm) Feb. 15, 2024, 1:29 p.m. UTC | #4
On Wed, Feb 07, 2024 at 05:42:58PM +0100, Eric Woudstra wrote:
> 
> Hi krzysztof,
> 
> I mistakenly thought that changing from rfc-patch to patch, the number
> would reset. I will mark the next one v2, or do you want me to mark it v3?
> 
> I have been using realtek,rtl82xx.yaml as an example. I see all your
> comments apply to this file also, so it would seem I could have chosen
> a better example. I will change it according your remarks.
> 
> >> +
> >> +allOf:
> >> +  - $ref: ethernet-phy.yaml#
> >> +
> >> +properties:
> > 
> > This won't match to anything... missing compatible. You probably want to
> > align with ongoing work on the lists.
> 
> As for the compatible string, the PHY reports it's c45-id okay and
> phylink can find the driver with this id. Therefore I have left the
> compatible string out of the devicetree node of the phy and not
> specified it in the binding (also same as realtek,rtl82xx.yaml).
> 
> If you are implying that I need to use it, then I will add:
> 
> select:
>   properties:
>     compatible:
>       contains:
>         enum:
>           - ethernet-phy-id03a2.a411
>   required:
>     - compatible

Don't need any of this unless you have a common/generic fallback 
compatible.

> 
> To the binding, and
> 
> 	compatible = "ethernet-phy-id03a2.a411";
> 
> To the devicetree node of the phy again.
> 
> Best regards,
> 
> Eric Woudstra
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/airoha,en8811h.yaml b/Documentation/devicetree/bindings/net/airoha,en8811h.yaml
new file mode 100644
index 000000000000..99898e2bed64
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/airoha,en8811h.yaml
@@ -0,0 +1,44 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/airoha,en8811h.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Airoha EN8811H PHY
+
+maintainers:
+  - Eric Woudstra <ericwouds@gmail.com>
+
+description:
+  Bindings for Airoha EN8811H PHY
+
+allOf:
+  - $ref: ethernet-phy.yaml#
+
+properties:
+  airoha,pnswap-rx:
+    type: boolean
+    description:
+      Reverse rx polarity of the SERDES. This is the receiving
+      side of the lines from the MAC towards the EN881H.
+
+
+  airoha,pnswap-tx:
+    type: boolean
+    description:
+      Reverse tx polarity of SERDES. This is the transmitting
+      side of the lines from EN8811H towards the MAC.
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    mdio {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        ethphy1: ethernet-phy@1 {
+                reg = <1>;
+                airoha,pnswap-rx;
+        };
+    };