diff mbox series

[V2,net-next,2/7] dt-bindings: net: fsl,fec: add RGMII internal clock delay

Message ID 20210728115203.16263-3-qiangqing.zhang@nxp.com (mailing list archive)
State Accepted
Commit df11b8073e19bd0eedae630dae82f38eb374b80d
Delegated to: Netdev Maintainers
Headers show
Series net: fec: add support for i.MX8MQ and i.MX8QM | expand

Checks

Context Check Description
netdev/apply success Patch already applied to net-next
netdev/tree_selection success Clearly marked for net-next

Commit Message

Joakim Zhang July 28, 2021, 11:51 a.m. UTC
Add RGMII internal clock delay for FEC controller.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 Documentation/devicetree/bindings/net/fsl,fec.yaml | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Andrew Lunn July 28, 2021, 2:08 p.m. UTC | #1
On Wed, Jul 28, 2021 at 07:51:58PM +0800, Joakim Zhang wrote:

> +      The "enet_2x_txclk"(option), for RGMII sampling clock which fixed at 250Mhz.
> +      The clock is required if SoC RGMII enable clock delay.

Hi Joakim

So you only need the clock if you are using RGMII delays? For RGMII
without delays, the clock is not needed?

You might want to add a check in the C code that the clock is provided
when needed.

     Andrew
Joakim Zhang July 29, 2021, 2:30 a.m. UTC | #2
> -----Original Message-----
> From: Andrew Lunn <andrew@lunn.ch>
> Sent: 2021年7月28日 22:08
> To: Joakim Zhang <qiangqing.zhang@nxp.com>
> Cc: davem@davemloft.net; kuba@kernel.org; robh+dt@kernel.org;
> shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> festevam@gmail.com; dl-linux-imx <linux-imx@nxp.com>;
> netdev@vger.kernel.org; devicetree@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH V2 net-next 2/7] dt-bindings: net: fsl,fec: add RGMII
> internal clock delay
> 
> On Wed, Jul 28, 2021 at 07:51:58PM +0800, Joakim Zhang wrote:
> 
> > +      The "enet_2x_txclk"(option), for RGMII sampling clock which fixed at
> 250Mhz.
> > +      The clock is required if SoC RGMII enable clock delay.
> 
> Hi Joakim
> 
> So you only need the clock if you are using RGMII delays? For RGMII without
> delays, the clock is not needed?
> 
> You might want to add a check in the C code that the clock is provided when
> needed.

Hi Andrew,

Yes, we only need this clock for RGMII delays, the clock is not needed for RGMII without delays.

Had better add below check to avoid enabling needless clock. 
	if (fep->rgmii_txc_dly || fep->rgmii_rxc_dly)

Best Regards,
Joakim Zhang
>      Andrew
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/fsl,fec.yaml b/Documentation/devicetree/bindings/net/fsl,fec.yaml
index b14e0e7c1e42..eca41443fcce 100644
--- a/Documentation/devicetree/bindings/net/fsl,fec.yaml
+++ b/Documentation/devicetree/bindings/net/fsl,fec.yaml
@@ -96,6 +96,8 @@  properties:
       SOC internal PLL.
       The "enet_out"(option), output clock for external device, like supply clock
       for PHY. The clock is required if PHY clock source from SOC.
+      The "enet_2x_txclk"(option), for RGMII sampling clock which fixed at 250Mhz.
+      The clock is required if SoC RGMII enable clock delay.
 
   clock-names:
     minItems: 2
@@ -107,6 +109,7 @@  properties:
         - ptp
         - enet_clk_ref
         - enet_out
+        - enet_2x_txclk
 
   phy-mode: true
 
@@ -118,6 +121,12 @@  properties:
 
   mac-address: true
 
+  tx-internal-delay-ps:
+    enum: [0, 2000]
+
+  rx-internal-delay-ps:
+    enum: [0, 2000]
+
   phy-supply:
     description:
       Regulator that powers the Ethernet PHY.