2021-07-28 11:53:46

by Joakim Zhang

[permalink] [raw]
Subject: [PATCH V2 net-next 0/7] net: fec: add support for i.MX8MQ and i.MX8QM

This patch set adds supports for i.MX8MQ and i.MX8QM, both of them extend new features.

ChangeLogs:
V1->V2:
* rebase on schema binding, and update dts compatible string.
* use generic ethernet controller property for MAC internal RGMII clock delay
rx-internal-delay-ps and tx-internal-delay-ps

Fugang Duan (3):
net: fec: add imx8mq and imx8qm new versions support
net: fec: add eee mode tx lpi support
net: fec: add MAC internal delayed clock feature support

Joakim Zhang (4):
dt-bindings: net: fsl,fec: update compatible items
dt-bindings: net: fsl,fec: add RGMII internal clock delay
arm64: dts: imx8m: add "fsl,imx8mq-fec" compatible string for FEC
arm64: dts: imx8qxp: add "fsl,imx8qm-fec" compatible string for FEC

.../devicetree/bindings/net/fsl,fec.yaml | 27 ++++
arch/arm64/boot/dts/freescale/imx8mm.dtsi | 2 +-
arch/arm64/boot/dts/freescale/imx8mn.dtsi | 2 +-
.../boot/dts/freescale/imx8qxp-ss-conn.dtsi | 4 +-
drivers/net/ethernet/freescale/fec.h | 25 +++
drivers/net/ethernet/freescale/fec_main.c | 146 ++++++++++++++++++
6 files changed, 202 insertions(+), 4 deletions(-)

--
2.17.1



2021-07-28 11:54:00

by Joakim Zhang

[permalink] [raw]
Subject: [PATCH V2 net-next 1/7] dt-bindings: net: fsl,fec: update compatible items

Add more compatible items for i.MX8/8M platforms.

Signed-off-by: Joakim Zhang <[email protected]>
---
.../devicetree/bindings/net/fsl,fec.yaml | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/fsl,fec.yaml b/Documentation/devicetree/bindings/net/fsl,fec.yaml
index dbcbec95fc9e..b14e0e7c1e42 100644
--- a/Documentation/devicetree/bindings/net/fsl,fec.yaml
+++ b/Documentation/devicetree/bindings/net/fsl,fec.yaml
@@ -40,6 +40,24 @@ properties:
- enum:
- fsl,imx7d-fec
- const: fsl,imx6sx-fec
+ - items:
+ - const: fsl,imx8mq-fec
+ - const: fsl,imx6sx-fec
+ - items:
+ - enum:
+ - fsl,imx8mm-fec
+ - fsl,imx8mn-fec
+ - fsl,imx8mp-fec
+ - const: fsl,imx8mq-fec
+ - const: fsl,imx6sx-fec
+ - items:
+ - const: fsl,imx8qm-fec
+ - const: fsl,imx6sx-fec
+ - items:
+ - enum:
+ - fsl,imx8qxp-fec
+ - const: fsl,imx8qm-fec
+ - const: fsl,imx6sx-fec

reg:
maxItems: 1
--
2.17.1


2021-07-28 11:54:06

by Joakim Zhang

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

Add RGMII internal clock delay for FEC controller.

Signed-off-by: Joakim Zhang <[email protected]>
---
Documentation/devicetree/bindings/net/fsl,fec.yaml | 9 +++++++++
1 file changed, 9 insertions(+)

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.
--
2.17.1


2021-07-28 11:54:28

by Joakim Zhang

[permalink] [raw]
Subject: [PATCH V2 net-next 3/7] net: fec: add imx8mq and imx8qm new versions support

From: Fugang Duan <[email protected]>

The ENET of imx8mq and imx8qm are basically the same as imx6sx,
but they have new features support based on imx6sx, like:
- imx8mq: supports IEEE 802.3az EEE standard.
- imx8qm: supports RGMII mode delayed clock.

Signed-off-by: Fugang Duan <[email protected]>
Signed-off-by: Joakim Zhang <[email protected]>
---
drivers/net/ethernet/freescale/fec.h | 13 ++++++++++
drivers/net/ethernet/freescale/fec_main.c | 30 +++++++++++++++++++++++
2 files changed, 43 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index 2e002e4b4b4a..c1f93aa79d63 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -472,6 +472,19 @@ struct bufdesc_ex {
*/
#define FEC_QUIRK_HAS_MULTI_QUEUES (1 << 19)

+/* i.MX8MQ ENET IP version add new feature to support IEEE 802.3az EEE
+ * standard. For the transmission, MAC supply two user registers to set
+ * Sleep (TS) and Wake (TW) time.
+ */
+#define FEC_QUIRK_HAS_EEE (1 << 20)
+
+/* i.MX8QM ENET IP version add new feture to generate delayed TXC/RXC
+ * as an alternative option to make sure it works well with various PHYs.
+ * For the implementation of delayed clock, ENET takes synchronized 250MHz
+ * clocks to generate 2ns delay.
+ */
+#define FEC_QUIRK_DELAYED_CLKS_SUPPORT (1 << 21)
+
struct bufdesc_prop {
int qid;
/* Address of Rx and Tx buffers */
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index e361be85f26f..d9ba9d6f7af7 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -135,6 +135,26 @@ static const struct fec_devinfo fec_imx6ul_info = {
FEC_QUIRK_HAS_COALESCE | FEC_QUIRK_CLEAR_SETUP_MII,
};

+static const struct fec_devinfo fec_imx8mq_info = {
+ .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
+ FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |
+ FEC_QUIRK_HAS_VLAN | FEC_QUIRK_HAS_AVB |
+ FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE |
+ FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE |
+ FEC_QUIRK_CLEAR_SETUP_MII | FEC_QUIRK_HAS_MULTI_QUEUES |
+ FEC_QUIRK_HAS_EEE,
+};
+
+static const struct fec_devinfo fec_imx8qm_info = {
+ .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
+ FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM |
+ FEC_QUIRK_HAS_VLAN | FEC_QUIRK_HAS_AVB |
+ FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE |
+ FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE |
+ FEC_QUIRK_CLEAR_SETUP_MII | FEC_QUIRK_HAS_MULTI_QUEUES |
+ FEC_QUIRK_DELAYED_CLKS_SUPPORT,
+};
+
static struct platform_device_id fec_devtype[] = {
{
/* keep it for coldfire */
@@ -161,6 +181,12 @@ static struct platform_device_id fec_devtype[] = {
}, {
.name = "imx6ul-fec",
.driver_data = (kernel_ulong_t)&fec_imx6ul_info,
+ }, {
+ .name = "imx8mq-fec",
+ .driver_data = (kernel_ulong_t)&fec_imx8mq_info,
+ }, {
+ .name = "imx8qm-fec",
+ .driver_data = (kernel_ulong_t)&fec_imx8qm_info,
}, {
/* sentinel */
}
@@ -175,6 +201,8 @@ enum imx_fec_type {
MVF600_FEC,
IMX6SX_FEC,
IMX6UL_FEC,
+ IMX8MQ_FEC,
+ IMX8QM_FEC,
};

static const struct of_device_id fec_dt_ids[] = {
@@ -185,6 +213,8 @@ static const struct of_device_id fec_dt_ids[] = {
{ .compatible = "fsl,mvf600-fec", .data = &fec_devtype[MVF600_FEC], },
{ .compatible = "fsl,imx6sx-fec", .data = &fec_devtype[IMX6SX_FEC], },
{ .compatible = "fsl,imx6ul-fec", .data = &fec_devtype[IMX6UL_FEC], },
+ { .compatible = "fsl,imx8mq-fec", .data = &fec_devtype[IMX8MQ_FEC], },
+ { .compatible = "fsl,imx8qm-fec", .data = &fec_devtype[IMX8QM_FEC], },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, fec_dt_ids);
--
2.17.1


2021-07-28 11:55:30

by Joakim Zhang

[permalink] [raw]
Subject: [PATCH V2 net-next 7/7] arm64: dts: imx8qxp: add "fsl,imx8qm-fec" compatible string for FEC

Add "fsl,imx8qm-fec" compatible string for FEC to support new feature
(RGMII delayed clock).

Signed-off-by: Joakim Zhang <[email protected]>
---
arch/arm64/boot/dts/freescale/imx8qxp-ss-conn.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-ss-conn.dtsi b/arch/arm64/boot/dts/freescale/imx8qxp-ss-conn.dtsi
index f5f58959f65c..46da21af3702 100644
--- a/arch/arm64/boot/dts/freescale/imx8qxp-ss-conn.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8qxp-ss-conn.dtsi
@@ -17,9 +17,9 @@
};

&fec1 {
- compatible = "fsl,imx8qxp-fec", "fsl,imx6sx-fec";
+ compatible = "fsl,imx8qxp-fec", "fsl,imx8qm-fec", "fsl,imx6sx-fec";
};

&fec2 {
- compatible = "fsl,imx8qxp-fec", "fsl,imx6sx-fec";
+ compatible = "fsl,imx8qxp-fec", "fsl,imx8qm-fec", "fsl,imx6sx-fec";
};
--
2.17.1


2021-07-28 11:56:24

by Joakim Zhang

[permalink] [raw]
Subject: [PATCH V2 net-next 5/7] net: fec: add MAC internal delayed clock feature support

From: Fugang Duan <[email protected]>

i.MX8QM ENET IP version support timing specification that MAC
integrate clock delay in RGMII mode, the delayed TXC/RXC as an
alternative option to work well with various PHYs.

Signed-off-by: Fugang Duan <[email protected]>
Signed-off-by: Joakim Zhang <[email protected]>
---
drivers/net/ethernet/freescale/fec.h | 6 +++++
drivers/net/ethernet/freescale/fec_main.c | 27 +++++++++++++++++++++++
2 files changed, 33 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index 0a741bc440e4..ae3259164395 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -381,6 +381,9 @@ struct bufdesc_ex {
#define FEC_DEFAULT_IMASK (FEC_ENET_TXF | FEC_ENET_RXF)
#define FEC_RX_DISABLED_IMASK (FEC_DEFAULT_IMASK & (~FEC_ENET_RXF))

+#define FEC_ENET_TXC_DLY ((uint)0x00010000)
+#define FEC_ENET_RXC_DLY ((uint)0x00020000)
+
/* ENET interrupt coalescing macro define */
#define FEC_ITR_CLK_SEL (0x1 << 30)
#define FEC_ITR_EN (0x1 << 31)
@@ -543,6 +546,7 @@ struct fec_enet_private {
struct clk *clk_ref;
struct clk *clk_enet_out;
struct clk *clk_ptp;
+ struct clk *clk_2x_txclk;

bool ptp_clk_on;
struct mutex ptp_clk_mutex;
@@ -565,6 +569,8 @@ struct fec_enet_private {
uint phy_speed;
phy_interface_t phy_interface;
struct device_node *phy_node;
+ bool rgmii_txc_dly;
+ bool rgmii_rxc_dly;
int link;
int full_duplex;
int speed;
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index f13a9da180a2..40ea318d7396 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1137,6 +1137,13 @@ fec_restart(struct net_device *ndev)
if (fep->bufdesc_ex)
ecntl |= (1 << 4);

+ if (fep->quirks & FEC_QUIRK_DELAYED_CLKS_SUPPORT &&
+ fep->rgmii_txc_dly)
+ ecntl |= FEC_ENET_TXC_DLY;
+ if (fep->quirks & FEC_QUIRK_DELAYED_CLKS_SUPPORT &&
+ fep->rgmii_rxc_dly)
+ ecntl |= FEC_ENET_RXC_DLY;
+
#ifndef CONFIG_M5272
/* Enable the MIB statistic event counters */
writel(0 << 31, fep->hwp + FEC_MIB_CTRLSTAT);
@@ -2000,6 +2007,10 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable)
if (ret)
goto failed_clk_ref;

+ ret = clk_prepare_enable(fep->clk_2x_txclk);
+ if (ret)
+ goto failed_clk_2x_txclk;
+
fec_enet_phy_reset_after_clk_enable(ndev);
} else {
clk_disable_unprepare(fep->clk_enet_out);
@@ -2010,10 +2021,14 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable)
mutex_unlock(&fep->ptp_clk_mutex);
}
clk_disable_unprepare(fep->clk_ref);
+ clk_disable_unprepare(fep->clk_2x_txclk);
}

return 0;

+failed_clk_2x_txclk:
+ if (fep->clk_ref)
+ clk_disable_unprepare(fep->clk_ref);
failed_clk_ref:
if (fep->clk_ptp) {
mutex_lock(&fep->ptp_clk_mutex);
@@ -3704,6 +3719,7 @@ fec_probe(struct platform_device *pdev)
char irq_name[8];
int irq_cnt;
struct fec_devinfo *dev_info;
+ u32 rgmii_delay;

fec_enet_get_queue_num(pdev, &num_tx_qs, &num_rx_qs);

@@ -3761,6 +3777,12 @@ fec_probe(struct platform_device *pdev)
if (ret)
goto failed_stop_mode;

+ /* For rgmii internal delay, valid values are 0ps and 2000ps */
+ if (of_property_read_u32(np, "tx-internal-delay-ps", &rgmii_delay))
+ fep->rgmii_txc_dly = true;
+ if (of_property_read_u32(np, "rx-internal-delay-ps", &rgmii_delay))
+ fep->rgmii_rxc_dly = true;
+
phy_node = of_parse_phandle(np, "phy-handle", 0);
if (!phy_node && of_phy_is_fixed_link(np)) {
ret = of_phy_register_fixed_link(np);
@@ -3812,6 +3834,11 @@ fec_probe(struct platform_device *pdev)
fep->clk_ref = NULL;
fep->clk_ref_rate = clk_get_rate(fep->clk_ref);

+ /* clk_2x_txclk is optional, depends on board */
+ fep->clk_2x_txclk = devm_clk_get(&pdev->dev, "enet_2x_txclk");
+ if (IS_ERR(fep->clk_2x_txclk))
+ fep->clk_2x_txclk = NULL;
+
fep->bufdesc_ex = fep->quirks & FEC_QUIRK_HAS_BUFDESC_EX;
fep->clk_ptp = devm_clk_get(&pdev->dev, "ptp");
if (IS_ERR(fep->clk_ptp)) {
--
2.17.1


2021-07-28 11:57:13

by Joakim Zhang

[permalink] [raw]
Subject: [PATCH V2 net-next 6/7] arm64: dts: imx8m: add "fsl,imx8mq-fec" compatible string for FEC

Add "fsl,imx8mq-fec" compatible string for FEC to support new feature
(IEEE 802.3az EEE standard).

Signed-off-by: Joakim Zhang <[email protected]>
---
arch/arm64/boot/dts/freescale/imx8mm.dtsi | 2 +-
arch/arm64/boot/dts/freescale/imx8mn.dtsi | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
index e7648c3b8390..1608a48495b6 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
@@ -920,7 +920,7 @@
};

fec1: ethernet@30be0000 {
- compatible = "fsl,imx8mm-fec", "fsl,imx6sx-fec";
+ compatible = "fsl,imx8mm-fec", "fsl,imx8mq-fec", "fsl,imx6sx-fec";
reg = <0x30be0000 0x10000>;
interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
index d4231e061403..e6de293865b0 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
@@ -923,7 +923,7 @@
};

fec1: ethernet@30be0000 {
- compatible = "fsl,imx8mn-fec", "fsl,imx6sx-fec";
+ compatible = "fsl,imx8mn-fec", "fsl,imx8mq-fec", "fsl,imx6sx-fec";
reg = <0x30be0000 0x10000>;
interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
--
2.17.1


2021-07-28 12:51:56

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH V2 net-next 0/7] net: fec: add support for i.MX8MQ and i.MX8QM

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Wed, 28 Jul 2021 19:51:56 +0800 you wrote:
> This patch set adds supports for i.MX8MQ and i.MX8QM, both of them extend new features.
>
> ChangeLogs:
> V1->V2:
> * rebase on schema binding, and update dts compatible string.
> * use generic ethernet controller property for MAC internal RGMII clock delay
> rx-internal-delay-ps and tx-internal-delay-ps
>
> [...]

Here is the summary with links:
- [V2,net-next,1/7] dt-bindings: net: fsl,fec: update compatible items
https://git.kernel.org/netdev/net-next/c/5d886947039d
- [V2,net-next,2/7] dt-bindings: net: fsl,fec: add RGMII internal clock delay
https://git.kernel.org/netdev/net-next/c/df11b8073e19
- [V2,net-next,3/7] net: fec: add imx8mq and imx8qm new versions support
https://git.kernel.org/netdev/net-next/c/947240ebcc63
- [V2,net-next,4/7] net: fec: add eee mode tx lpi support
https://git.kernel.org/netdev/net-next/c/b82f8c3f1409
- [V2,net-next,5/7] net: fec: add MAC internal delayed clock feature support
https://git.kernel.org/netdev/net-next/c/fc539459e900
- [V2,net-next,6/7] arm64: dts: imx8m: add "fsl,imx8mq-fec" compatible string for FEC
https://git.kernel.org/netdev/net-next/c/a758dee8ac50
- [V2,net-next,7/7] arm64: dts: imx8qxp: add "fsl,imx8qm-fec" compatible string for FEC
https://git.kernel.org/netdev/net-next/c/987e1b96d056

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



2021-07-28 14:10:15

by Andrew Lunn

[permalink] [raw]
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.

Andrew

2021-07-28 14:12:54

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH V2 net-next 5/7] net: fec: add MAC internal delayed clock feature support

> + /* For rgmii internal delay, valid values are 0ps and 2000ps */
> + if (of_property_read_u32(np, "tx-internal-delay-ps", &rgmii_delay))
> + fep->rgmii_txc_dly = true;
> + if (of_property_read_u32(np, "rx-internal-delay-ps", &rgmii_delay))
> + fep->rgmii_rxc_dly = true;

I don't see any validation of the only supported values are 0ps and
2000ps.

Andrew

2021-07-29 02:31:21

by Joakim Zhang

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


> -----Original Message-----
> From: Andrew Lunn <[email protected]>
> Sent: 2021??7??28?? 22:08
> To: Joakim Zhang <[email protected]>
> Cc: [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; dl-linux-imx <[email protected]>;
> [email protected]; [email protected];
> [email protected]
> 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

2021-07-29 02:34:02

by Joakim Zhang

[permalink] [raw]
Subject: RE: [PATCH V2 net-next 5/7] net: fec: add MAC internal delayed clock feature support


> -----Original Message-----
> From: Andrew Lunn <[email protected]>
> Sent: 2021??7??28?? 22:11
> To: Joakim Zhang <[email protected]>
> Cc: [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; dl-linux-imx <[email protected]>;
> [email protected]; [email protected];
> [email protected]
> Subject: Re: [PATCH V2 net-next 5/7] net: fec: add MAC internal delayed clock
> feature support
>
> > + /* For rgmii internal delay, valid values are 0ps and 2000ps */
> > + if (of_property_read_u32(np, "tx-internal-delay-ps", &rgmii_delay))
> > + fep->rgmii_txc_dly = true;
> > + if (of_property_read_u32(np, "rx-internal-delay-ps", &rgmii_delay))
> > + fep->rgmii_rxc_dly = true;
>
> I don't see any validation of the only supported values are 0ps and 2000ps.

Hi Andrew,

I also take this into account, since I have limited the value to 0 and 2000 in fec dt-bindings.
It will report error when run dtbs_check if value is not invalid. Another reason is that actually
the value is not program to hardware, we only enable RGMII delay or not. If need, I think we
can only add a dev_warn() here, instead of stop the probe process?

Best Regards,
Joakim Zhang
> Andrew