imx8mp_evk: Simplify Ethernet initialization
Subsystems (2)
Fabio Estevam
reviewerPATCH v3 1/2 imx8mp_evk: Simplify Ethernet initialization
From: Fabio Estevam <[email protected]>
With DM enabled, there is no need for board code to initialize the Ethernet interfaces.
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 FEC properties, nor passing reset properties to the EQOS interface in u-boot.dtsi.
Remove all these unneeded pieces.
Tested both Ethernet interfaces after these changes.
---
Changes since v2:
- Only collected Hugo's tag.
arch/arm/dts/imx8mp-evk-u-boot.dtsi | 14 ------------- board/freescale/imx8mp_evk/imx8mp_evk.c | 28 +------------------------ 2 files changed, 1 insertion(+), 41 deletions(-)
arch/arm/dts/imx8mp-evk-u-boot.dtsi +0 -14
@@ -137,17 +137,3 @@ &wdog1 { bootph-pre-ram; }; - -ðphy0 { - reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>; - 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 -27
@@ -7,8 +7,6 @@#include <env.h> #include <errno.h> #include <init.h> -#include <miiphy.h> -#include <netdev.h> #include <linux/delay.h> #include <asm/global_data.h> #include <asm/mach-imx/iomux-v3.h>
@@ -20,33 +18,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
Fabio Estevam
reviewerPATCH v3 2/2 imx8mp_evk: Remove unneeded header files
From: Fabio Estevam <[email protected]>
Cleanup the file by removing unneeded header files.
---
Changes since v2:
- Also remove <asm/global_data.h> and DECLARE_GLOBAL_DATA_PTR. (Hugo)
board/freescale/imx8mp_evk/imx8mp_evk.c | 13 ------------- 1 file changed, 13 deletions(-)
board/freescale/imx8mp_evk/imx8mp_evk.c +0 -13
@@ -3,20 +3,7 @@* Copyright 2019 NXP */ -#include <common.h> #include <env.h> -#include <errno.h> -#include <init.h> -#include <linux/delay.h> -#include <asm/global_data.h> -#include <asm/mach-imx/iomux-v3.h> -#include <asm-generic/gpio.h> -#include <asm/arch/imx8mp_pins.h> -#include <asm/arch/clock.h> -#include <asm/arch/sys_proto.h> -#include <asm/mach-imx/gpio.h> - -DECLARE_GLOBAL_DATA_PTR ;int board_init (void ) {
Signature · 1 line
2.34.1
Re: [PATCH v3 2/2] imx8mp_evk: Remove unneeded header files
Quoted 5 lines · On Thu, 19 Oct 2023 18:51:13 -0300 Fabio Estevam <[email protected]> wrote:
From: Fabio Estevam <[email protected]>
Cleanup the file by removing unneeded header files.
Signed-off-by Fabio Estevam <[email protected]>
Quoted 36 lines
---
Changes since v2:
- Also remove <asm/global_data.h> andDECLARE_GLOBAL_DATA_PTR. (Hugo)board/freescale/imx8mp_evk/imx8mp_evk.c | 13 ------------- 1 file changed, 13 deletions(-)board/freescale/imx8mp_evk/imx8mp_evk.c +0
-13@@ -3,20 +3,7 @@* Copyright 2019 NXP */ -#include <common.h> #include <env.h> -#include <errno.h> -#include <init.h> -#include <linux/delay.h> -#include <asm/global_data.h> -#include <asm/mach-imx/iomux-v3.h> -#include <asm-generic/gpio.h> -#include <asm/arch/imx8mp_pins.h> -#include <asm/arch/clock.h> -#include <asm/arch/sys_proto.h> -#include <asm/mach-imx/gpio.h> - -DECLARE_GLOBAL_DATA_PTR ;int board_init (void ) {Signature · 1 line
2.34.1
Fabio Estevam
reviewerQuoted 13 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
With DM enabled, there is no need for board code to initialize the Ethernet interfaces.
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 FEC properties, nor passing reset properties to the EQOS interface in
u-boot.dtsi.
Quoted 6 lines
Remove all these unneeded pieces.
Tested both Ethernet interfaces after these changes.
Signed-off-by Fabio Estevam <[email protected]>Reviewed-by Hugo Villeneuve <[email protected]>
Applied all to u-boot-imx next, thanks.