[PATCH v2 net-next 02/14] dt-bindings: net: add nxp,netc-timer property

Wei Fang posted 14 patches 2 months, 3 weeks ago
There is a newer version of this series
[PATCH v2 net-next 02/14] dt-bindings: net: add nxp,netc-timer property
Posted by Wei Fang 2 months, 3 weeks ago
NETC is a multi-function PCIe Root Complex Integrated Endpoint (RCiEP)
that contains multiple PCIe functions, such as ENETC and Timer. Timer
provides PTP time synchronization functionality and ENETC provides the
NIC functionality.

For some platforms, such as i.MX95, it has only one timer instance, so
the binding relationship between Timer and ENETC is fixed. But for some
platforms, such as i.MX943, it has 3 Timer instances, by setting the
EaTBCR registers of the IERB module, we can specify any Timer instance
to be bound to the ENETC instance.

Therefore, add "nxp,netc-timer" property to bind ENETC instance to a
specified Timer instance so that ENETC can support PTP synchronization
through Timer.

Signed-off-by: Wei Fang <wei.fang@nxp.com>

---
v2 changes:
new patch
---
 .../devicetree/bindings/net/fsl,enetc.yaml    | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
index ca70f0050171..ae05f2982653 100644
--- a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
+++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
@@ -44,6 +44,13 @@ properties:
     unevaluatedProperties: false
     description: Optional child node for ENETC instance, otherwise use NETC EMDIO.
 
+  nxp,netc-timer:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Specifies a reference to a node representing a NETC Timer device,
+      which provides time synchronization as required for IEEE 1588 and
+      IEEE 802.1AS-2020.
+
 required:
   - compatible
   - reg
@@ -62,6 +69,7 @@ allOf:
       properties:
         clocks: false
         clock-names: false
+        nxp,netc-timer: false
 
 unevaluatedProperties: false
 
@@ -86,3 +94,18 @@ examples:
             };
         };
     };
+  - |
+    pcie {
+      #address-cells = <3>;
+      #size-cells = <2>;
+
+      ethernet@0,0 {
+          compatible = "pci1131,e101";
+          reg = <0x000000 0 0 0 0>;
+          clocks = <&scmi_clk 102>;
+          clock-names = "ref";
+          nxp,netc-timer = <&netc_timer>;
+          phy-handle = <&ethphy0>;
+          phy-mode = "rgmii-id";
+      };
+    };
-- 
2.34.1
Re: [PATCH v2 net-next 02/14] dt-bindings: net: add nxp,netc-timer property
Posted by Krzysztof Kozlowski 2 months, 3 weeks ago
On Wed, Jul 16, 2025 at 03:30:59PM +0800, Wei Fang wrote:
> NETC is a multi-function PCIe Root Complex Integrated Endpoint (RCiEP)
> that contains multiple PCIe functions, such as ENETC and Timer. Timer
> provides PTP time synchronization functionality and ENETC provides the
> NIC functionality.
> 
> For some platforms, such as i.MX95, it has only one timer instance, so
> the binding relationship between Timer and ENETC is fixed. But for some
> platforms, such as i.MX943, it has 3 Timer instances, by setting the
> EaTBCR registers of the IERB module, we can specify any Timer instance
> to be bound to the ENETC instance.
> 
> Therefore, add "nxp,netc-timer" property to bind ENETC instance to a
> specified Timer instance so that ENETC can support PTP synchronization
> through Timer.
> 
> Signed-off-by: Wei Fang <wei.fang@nxp.com>
> 
> ---
> v2 changes:
> new patch
> ---
>  .../devicetree/bindings/net/fsl,enetc.yaml    | 23 +++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> index ca70f0050171..ae05f2982653 100644
> --- a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> +++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> @@ -44,6 +44,13 @@ properties:
>      unevaluatedProperties: false
>      description: Optional child node for ENETC instance, otherwise use NETC EMDIO.
>  
> +  nxp,netc-timer:

Heh, you got comments to use existing properties for PTP devices and
consumers. I also said to you to use cell arguments how existing
bindings use it.

You did not respond that you are not going to use existing properties.

So why existing timestamper is not correct? Is this not a timestamper?
If it is, why do we need to repeat the same discussion...

Best regards,
Krzysztof
Re: [PATCH v2 net-next 02/14] dt-bindings: net: add nxp,netc-timer property
Posted by Frank Li 2 months, 3 weeks ago
On Wed, Jul 16, 2025 at 03:30:59PM +0800, Wei Fang wrote:
> NETC is a multi-function PCIe Root Complex Integrated Endpoint (RCiEP)
> that contains multiple PCIe functions, such as ENETC and Timer. Timer
> provides PTP time synchronization functionality and ENETC provides the
> NIC functionality.
>
> For some platforms, such as i.MX95, it has only one timer instance, so
> the binding relationship between Timer and ENETC is fixed. But for some
> platforms, such as i.MX943, it has 3 Timer instances, by setting the
> EaTBCR registers of the IERB module, we can specify any Timer instance
> to be bound to the ENETC instance.
>
> Therefore, add "nxp,netc-timer" property to bind ENETC instance to a
> specified Timer instance so that ENETC can support PTP synchronization
> through Timer.
>
> Signed-off-by: Wei Fang <wei.fang@nxp.com>
>
> ---
> v2 changes:
> new patch
> ---
>  .../devicetree/bindings/net/fsl,enetc.yaml    | 23 +++++++++++++++++++
>  1 file changed, 23 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> index ca70f0050171..ae05f2982653 100644
> --- a/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> +++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml
> @@ -44,6 +44,13 @@ properties:
>      unevaluatedProperties: false
>      description: Optional child node for ENETC instance, otherwise use NETC EMDIO.
>
> +  nxp,netc-timer:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description:
> +      Specifies a reference to a node representing a NETC Timer device,
> +      which provides time synchronization as required for IEEE 1588 and
> +      IEEE 802.1AS-2020.
> +

I think it is quite common. add ptp-timer ethernet-controller.yaml?

Frank

>  required:
>    - compatible
>    - reg
> @@ -62,6 +69,7 @@ allOf:
>        properties:
>          clocks: false
>          clock-names: false
> +        nxp,netc-timer: false
>
>  unevaluatedProperties: false
>
> @@ -86,3 +94,18 @@ examples:
>              };
>          };
>      };
> +  - |
> +    pcie {
> +      #address-cells = <3>;
> +      #size-cells = <2>;
> +
> +      ethernet@0,0 {
> +          compatible = "pci1131,e101";
> +          reg = <0x000000 0 0 0 0>;
> +          clocks = <&scmi_clk 102>;
> +          clock-names = "ref";
> +          nxp,netc-timer = <&netc_timer>;
> +          phy-handle = <&ethphy0>;
> +          phy-mode = "rgmii-id";
> +      };
> +    };
> --
> 2.34.1
>