All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] imx8mp_evk: Simplify Ethernet initialization
@ 2023-10-19 19:21 Fabio Estevam
  2023-10-19 19:21 ` [PATCH v2 2/2] mx8mp_evk: Remove unneeded header files Fabio Estevam
  2023-10-19 20:37 ` [PATCH v2 1/2] imx8mp_evk: Simplify Ethernet initialization Hugo Villeneuve
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2023-10-19 19:21 UTC (permalink / raw)
  To: sbabic; +Cc: u-boot, peng.fan, hugo, Fabio Estevam

From: Fabio Estevam <festevam@denx.de>

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.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
Changes since v1:
- Removed Ethernet related headers. (Hugo)
- Also removed custom eqos reset properties from u-boot.dtsi.

 arch/arm/dts/imx8mp-evk-u-boot.dtsi     | 14 -------------
 board/freescale/imx8mp_evk/imx8mp_evk.c | 28 +------------------------
 2 files changed, 1 insertion(+), 41 deletions(-)

diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 0bf489b46248..51c84383673c 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -137,17 +137,3 @@
 &wdog1 {
 	bootph-pre-ram;
 };
-
-&ethphy0 {
-	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>;
-};
-
-
diff --git a/board/freescale/imx8mp_evk/imx8mp_evk.c b/board/freescale/imx8mp_evk/imx8mp_evk.c
index a24b8c1d8608..42291c958e39 100644
--- a/board/freescale/imx8mp_evk/imx8mp_evk.c
+++ b/board/freescale/imx8mp_evk/imx8mp_evk.c
@@ -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)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] mx8mp_evk: Remove unneeded header files
  2023-10-19 19:21 [PATCH v2 1/2] imx8mp_evk: Simplify Ethernet initialization Fabio Estevam
@ 2023-10-19 19:21 ` Fabio Estevam
  2023-10-19 20:30   ` Hugo Villeneuve
  2023-10-19 20:37 ` [PATCH v2 1/2] imx8mp_evk: Simplify Ethernet initialization Hugo Villeneuve
  1 sibling, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2023-10-19 19:21 UTC (permalink / raw)
  To: sbabic; +Cc: u-boot, peng.fan, hugo, Fabio Estevam

From: Fabio Estevam <festevam@denx.de>

Cleanup the file by removing unneeded header files.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
Changes since v1:
- Newly introduced. (Hugo)

 board/freescale/imx8mp_evk/imx8mp_evk.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/board/freescale/imx8mp_evk/imx8mp_evk.c b/board/freescale/imx8mp_evk/imx8mp_evk.c
index 42291c958e39..e62e27db48d9 100644
--- a/board/freescale/imx8mp_evk/imx8mp_evk.c
+++ b/board/freescale/imx8mp_evk/imx8mp_evk.c
@@ -3,18 +3,8 @@
  * 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;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] mx8mp_evk: Remove unneeded header files
  2023-10-19 19:21 ` [PATCH v2 2/2] mx8mp_evk: Remove unneeded header files Fabio Estevam
@ 2023-10-19 20:30   ` Hugo Villeneuve
  0 siblings, 0 replies; 4+ messages in thread
From: Hugo Villeneuve @ 2023-10-19 20:30 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: sbabic, u-boot, peng.fan, Fabio Estevam

On Thu, 19 Oct 2023 16:21:55 -0300
Fabio Estevam <festevam@gmail.com> wrote:

> From: Fabio Estevam <festevam@denx.de>
> 
> Cleanup the file by removing unneeded header files.
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---
> Changes since v1:
> - Newly introduced. (Hugo)
> 
>  board/freescale/imx8mp_evk/imx8mp_evk.c | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/board/freescale/imx8mp_evk/imx8mp_evk.c b/board/freescale/imx8mp_evk/imx8mp_evk.c
> index 42291c958e39..e62e27db48d9 100644
> --- a/board/freescale/imx8mp_evk/imx8mp_evk.c
> +++ b/board/freescale/imx8mp_evk/imx8mp_evk.c
> @@ -3,18 +3,8 @@
>   * 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;

Hi Fabio,
after that, do you even need DECLARE_GLOBAL_DATA_PTR and its associated
header file?

Hugo.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/2] imx8mp_evk: Simplify Ethernet initialization
  2023-10-19 19:21 [PATCH v2 1/2] imx8mp_evk: Simplify Ethernet initialization Fabio Estevam
  2023-10-19 19:21 ` [PATCH v2 2/2] mx8mp_evk: Remove unneeded header files Fabio Estevam
@ 2023-10-19 20:37 ` Hugo Villeneuve
  1 sibling, 0 replies; 4+ messages in thread
From: Hugo Villeneuve @ 2023-10-19 20:37 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: sbabic, u-boot, peng.fan, Fabio Estevam

On Thu, 19 Oct 2023 16:21:54 -0300
Fabio Estevam <festevam@gmail.com> wrote:

> From: Fabio Estevam <festevam@denx.de>
> 
> 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.
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>

Reviewed-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>


> ---
> Changes since v1:
> - Removed Ethernet related headers. (Hugo)
> - Also removed custom eqos reset properties from u-boot.dtsi.
> 
>  arch/arm/dts/imx8mp-evk-u-boot.dtsi     | 14 -------------
>  board/freescale/imx8mp_evk/imx8mp_evk.c | 28 +------------------------
>  2 files changed, 1 insertion(+), 41 deletions(-)
> 
> diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
> index 0bf489b46248..51c84383673c 100644
> --- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
> @@ -137,17 +137,3 @@
>  &wdog1 {
>  	bootph-pre-ram;
>  };
> -
> -&ethphy0 {
> -	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>;
> -};
> -
> -
> diff --git a/board/freescale/imx8mp_evk/imx8mp_evk.c b/board/freescale/imx8mp_evk/imx8mp_evk.c
> index a24b8c1d8608..42291c958e39 100644
> --- a/board/freescale/imx8mp_evk/imx8mp_evk.c
> +++ b/board/freescale/imx8mp_evk/imx8mp_evk.c
> @@ -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)
> -- 
> 2.34.1
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-19 20:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-19 19:21 [PATCH v2 1/2] imx8mp_evk: Simplify Ethernet initialization Fabio Estevam
2023-10-19 19:21 ` [PATCH v2 2/2] mx8mp_evk: Remove unneeded header files Fabio Estevam
2023-10-19 20:30   ` Hugo Villeneuve
2023-10-19 20:37 ` [PATCH v2 1/2] imx8mp_evk: Simplify Ethernet initialization Hugo Villeneuve

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.