Skip to contentSkip to conversation

imx8mp_evk: Simplify FEC initialization

PATCH Superseded Fabio Estevam 2 participants 2 messages Oct 19, 2023

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 imx8mp_evk: Simplify FEC initialization

From: Fabio Estevam <[email protected]>

With DM enabled, there is no need for board code to initialize the FEC interface.

The RTL8211FDI Ethernet PHYs have 25MHz oscillator, so there is no need to enable the RGMII TX clk output.

Also, there is no need for describing the deprecated phy-reset properties in u-boot.dtsi.

Remove all these uneeded pieces.

---
 arch/arm/dts/imx8mp-evk-u-boot.dtsi     |  8 --------
 board/freescale/imx8mp_evk/imx8mp_evk.c | 26 +------------------------
 2 files changed, 1 insertion(+), 33 deletions(-)
arch/arm/dts/imx8mp-evk-u-boot.dtsi +0 -8
index 43f13a9c22f7..db6bc6a11883 100644
@@ -150,11 +150,3 @@
 	reset-delay-us = <15000>;
 	reset-post-delay-us = <100000>;
 };
-
-&fec {
-	phy-reset-gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
-	phy-reset-duration = <15>;
-	phy-reset-post-delay = <100>;
-};
-
-
board/freescale/imx8mp_evk/imx8mp_evk.c +1 -25
index a24b8c1d8608..2c2b8383c8dc 100644
@@ -20,33 +20,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static void setup_fec(void)
-{
-	struct iomuxc_gpr_base_regs *gpr =
-		(struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
-
-	/* Enable RGMII TX clk output */
-	setbits_le32(&gpr->gpr[1], BIT(22));
-}
-
-#if CONFIG_IS_ENABLED(NET)
-int board_phy_config(struct phy_device *phydev)
-{
-	if (phydev->drv->config)
-		phydev->drv->config(phydev);
-	return 0;
-}
-#endif
-
 int board_init(void)
 {
-	int ret = 0;
-
-	if (IS_ENABLED(CONFIG_FEC_MXC)) {
-		setup_fec();
-	}
-
-	return ret;
+	return 0;
 }
 
 int board_late_init(void)
Signature · 1 line
2.34.1
#1 lore raw
Quoted 40 lines · On Thu, 19 Oct 2023 14:04:41 -0300 Fabio Estevam <[email protected]> wrote:

From: Fabio Estevam <[email protected]>

With DM enabled, there is no need for board code to initialize the FEC interface.

The RTL8211FDI Ethernet PHYs have 25MHz oscillator, so there is no need to enable the RGMII TX clk output.

Also, there is no need for describing the deprecated phy-reset properties in u-boot.dtsi.

Remove all these uneeded pieces.

---
 arch/arm/dts/imx8mp-evk-u-boot.dtsi     |  8 --------
 board/freescale/imx8mp_evk/imx8mp_evk.c | 26 +------------------------
 2 files changed, 1 insertion(+), 33 deletions(-)
arch/arm/dts/imx8mp-evk-u-boot.dtsi +0 -8
index 43f13a9c22f7..db6bc6a11883 100644
@@ -150,11 +150,3 @@
 	reset-delay-us = <15000>;
 	reset-post-delay-us = <100000>;
 };
-
-&fec {
-	phy-reset-gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
-	phy-reset-duration = <15>;
-	phy-reset-post-delay = <100>;
-};
-
-
board/freescale/imx8mp_evk/imx8mp_evk.c +0 -0
index a24b8c1d8608..2c2b8383c8dc 100644

board/freescale/imx8mp_evk/imx8mp_evk.c line 21

Quoted 2 lines
board/freescale/imx8mp_evk/imx8mp_evk.c +0 -0
@@ -20,33 +20,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;

Hi Fabio,
there is probably some #includes that are no longer necessary after this change... maybe remove them as well, or in another cleanup patch?

Hugo.

Quoted 34 lines
board/freescale/imx8mp_evk/imx8mp_evk.c +1 -25
-static void setup_fec(void)
-{
-	struct iomuxc_gpr_base_regs *gpr =
-		(struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR;
-
-	/* Enable RGMII TX clk output */
-	setbits_le32(&gpr->gpr[1], BIT(22));
-}
-
-#if CONFIG_IS_ENABLED(NET)
-int board_phy_config(struct phy_device *phydev)
-{
-	if (phydev->drv->config)
-		phydev->drv->config(phydev);
-	return 0;
-}
-#endif
-
 int board_init(void)
 {
-	int ret = 0;
-
-	if (IS_ENABLED(CONFIG_FEC_MXC)) {
-		setup_fec();
-	}
-
-	return ret;
+	return 0;
 }
 
 int board_late_init(void)
Signature · 1 line
2.34.1