[U-Boot] [PATCH 0/2][Net][ppc4xx] Remove non-CONFIG_NET_MULTI option for PPC4xx EMAC

Hello,
This patch set switches all remaining PPC4xx boards to use CONFIG_NET_MULTI. I haven't been able to test any of the boards, but MAKEALL 4xx ran OK. I remember that some of the 4xx linker scripts specified 'ppc_4xx_eth_initialize', so maybe that's necessary in some cases?
regards, Ben

All in-tree PPC4xx boards now use CONFIG_NET_MULTI
Signed-off-by: Ben Warren biggerbadderben@gmail.com --- include/configs/AR405.h | 1 + include/configs/CPCIISER4.h | 1 + include/configs/CRAYL1.h | 1 + include/configs/DP405.h | 1 + include/configs/ERIC.h | 1 + include/configs/EXBITGEN.h | 1 + include/configs/HUB405.h | 1 + include/configs/JSE.h | 1 + include/configs/MIP405.h | 1 + include/configs/OCRTC.h | 1 + include/configs/ORSG.h | 1 + include/configs/PIP405.h | 1 + include/configs/W7OLMC.h | 1 + include/configs/W7OLMG.h | 1 + include/configs/WUH405.h | 1 + include/configs/csb272.h | 1 + include/configs/csb472.h | 1 + include/configs/netstal-common.h | 2 +- include/configs/sbc405.h | 1 + 19 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/include/configs/AR405.h b/include/configs/AR405.h index 9f19269..73e34bd 100644 --- a/include/configs/AR405.h +++ b/include/configs/AR405.h @@ -71,6 +71,7 @@ #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 0 /* PHY address */ #define CONFIG_LXT971_NO_SLEEP 1 /* disable sleep mode in LXT971 */ +#define CONFIG_NET_MULTI
/* diff --git a/include/configs/CPCIISER4.h b/include/configs/CPCIISER4.h index 3263712..b2679e5 100644 --- a/include/configs/CPCIISER4.h +++ b/include/configs/CPCIISER4.h @@ -54,6 +54,7 @@ #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 0 /* PHY address */ #define CONFIG_LXT971_NO_SLEEP 1 /* disable sleep mode in LXT971 */ +#define CONFIG_NET_MULTI
/* diff --git a/include/configs/CRAYL1.h b/include/configs/CRAYL1.h index 150bd29..96bf161 100644 --- a/include/configs/CRAYL1.h +++ b/include/configs/CRAYL1.h @@ -45,6 +45,7 @@ #define CONFIG_PHY_ADDR 1 /* PHY address; handling of ENET */ #define CONFIG_BOARD_EARLY_INIT_F 1 /* early setup for 405gp */ #define CONFIG_MISC_INIT_R 1 /* so that a misc_init_r() is called */ +#define CONFIG_NET_MULTI
/* set PRAM to keep U-Boot out, mem= to keep linux out, and initrd_hi to * keep possible initrd ramdisk decompression out. This is in k (1024 bytes) diff --git a/include/configs/DP405.h b/include/configs/DP405.h index 187547d..7eb9357 100644 --- a/include/configs/DP405.h +++ b/include/configs/DP405.h @@ -55,6 +55,7 @@ #define CONFIG_PPC4xx_EMAC #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 0 /* PHY address */ +#define CONFIG_NET_MULTI
/* diff --git a/include/configs/ERIC.h b/include/configs/ERIC.h index 201e62a..023f33e 100644 --- a/include/configs/ERIC.h +++ b/include/configs/ERIC.h @@ -96,6 +96,7 @@ #define CONFIG_PPC4xx_EMAC #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 1 /* PHY address */ +#define CONFIG_NET_MULTI
/* diff --git a/include/configs/EXBITGEN.h b/include/configs/EXBITGEN.h index 4729464..4d08243 100644 --- a/include/configs/EXBITGEN.h +++ b/include/configs/EXBITGEN.h @@ -81,6 +81,7 @@
#define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 0 /* PHY address */ +#define CONFIG_NET_MULTI
/* diff --git a/include/configs/HUB405.h b/include/configs/HUB405.h index 0e7d2c0..ea502d4 100644 --- a/include/configs/HUB405.h +++ b/include/configs/HUB405.h @@ -60,6 +60,7 @@ #define CONFIG_LXT971_NO_SLEEP 1 /* disable sleep mode in LXT971 */
#define CONFIG_PHY_CLK_FREQ EMAC_STACR_CLK_66MHZ /* 66 MHz OPB clock*/ +#define CONFIG_NET_MULTI
/* diff --git a/include/configs/JSE.h b/include/configs/JSE.h index 8aca1f9..80c70e4 100644 --- a/include/configs/JSE.h +++ b/include/configs/JSE.h @@ -135,6 +135,7 @@ #define CONFIG_PPC4xx_EMAC #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 1 /* PHY address */ +#define CONFIG_NET_MULTI
/* diff --git a/include/configs/MIP405.h b/include/configs/MIP405.h index a3869c8..8315cfe 100644 --- a/include/configs/MIP405.h +++ b/include/configs/MIP405.h @@ -341,6 +341,7 @@ #define CONFIG_PHY_ADDR 1 /* PHY address */ #define CONFIG_PHY_RESET_DELAY 300 /* Intel LXT971A needs this */ #define CONFIG_PHY_CMD_DELAY 40 /* Intel LXT971A needs this */ +#define CONFIG_NET_MULTI /************************************************************ * RTC ***********************************************************/ diff --git a/include/configs/OCRTC.h b/include/configs/OCRTC.h index 2591f1d..860ec52 100644 --- a/include/configs/OCRTC.h +++ b/include/configs/OCRTC.h @@ -54,6 +54,7 @@ #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 0 /* PHY address */ #define CONFIG_LXT971_NO_SLEEP 1 /* disable sleep mode in LXT971 */ +#define CONFIG_NET_MULTI
/* diff --git a/include/configs/ORSG.h b/include/configs/ORSG.h index 13d6e04..b2e2d41 100644 --- a/include/configs/ORSG.h +++ b/include/configs/ORSG.h @@ -54,6 +54,7 @@ #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 0 /* PHY address */ #define CONFIG_LXT971_NO_SLEEP 1 /* disable sleep mode in LXT971 */ +#define CONFIG_NET_MULTI
/* diff --git a/include/configs/PIP405.h b/include/configs/PIP405.h index 5c4d69b..e214d70 100644 --- a/include/configs/PIP405.h +++ b/include/configs/PIP405.h @@ -281,6 +281,7 @@ #define CONFIG_PPC4xx_EMAC #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 1 /* PHY address */ +#define CONFIG_NET_MULTI /************************************************************ * RTC ***********************************************************/ diff --git a/include/configs/W7OLMC.h b/include/configs/W7OLMC.h index ceef76e..553845d 100644 --- a/include/configs/W7OLMC.h +++ b/include/configs/W7OLMC.h @@ -68,6 +68,7 @@ #define CONFIG_PPC4xx_EMAC #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 0 /* PHY address */ +#define CONFIG_NET_MULTI
#define CONFIG_RTC_M48T35A 1 /* ST Electronics M48 timekeeper */
diff --git a/include/configs/W7OLMG.h b/include/configs/W7OLMG.h index 11e0630..73d6d24 100644 --- a/include/configs/W7OLMG.h +++ b/include/configs/W7OLMG.h @@ -68,6 +68,7 @@ #define CONFIG_PPC4xx_EMAC #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 0 /* PHY address */ +#define CONFIG_NET_MULTI
#define CONFIG_RTC_M48T35A 1 /* ST Electronics M48 timekeeper */ #define CONFIG_DTT_LM75 1 /* ON Semi's LM75 */ diff --git a/include/configs/WUH405.h b/include/configs/WUH405.h index 99188bc..5c281a1 100644 --- a/include/configs/WUH405.h +++ b/include/configs/WUH405.h @@ -58,6 +58,7 @@ #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 0 /* PHY address */ #define CONFIG_LXT971_NO_SLEEP 1 /* disable sleep mode in LXT971 */ +#define CONFIG_NET_MULTI
#define CONFIG_PHY_CLK_FREQ EMAC_STACR_CLK_66MHZ /* 66 MHz OPB clock*/
diff --git a/include/configs/csb272.h b/include/configs/csb272.h index 204aea0..aed6f50 100644 --- a/include/configs/csb272.h +++ b/include/configs/csb272.h @@ -184,6 +184,7 @@ #define CONFIG_PHY_CMD_DELAY 40 /* PHY COMMAND delay */ /* 32usec min. for LXT971A */ #define CONFIG_PHY_RESET_DELAY 300 /* PHY RESET recovery delay */ +#define CONFIG_NET_MULTI
/* * RTC configuration diff --git a/include/configs/csb472.h b/include/configs/csb472.h index 9b3a11c..24b961f 100644 --- a/include/configs/csb472.h +++ b/include/configs/csb472.h @@ -183,6 +183,7 @@ #define CONFIG_PHY_CMD_DELAY 40 /* PHY COMMAND delay */ /* 32usec min. for LXT971A */ #define CONFIG_PHY_RESET_DELAY 300 /* PHY RESET recovery delay */ +#define CONFIG_NET_MULTI
/* * RTC configuration diff --git a/include/configs/netstal-common.h b/include/configs/netstal-common.h index 4d5c1ab..4bed7ae 100644 --- a/include/configs/netstal-common.h +++ b/include/configs/netstal-common.h @@ -61,8 +61,8 @@ #define CONFIG_PPC4xx_EMAC #define CONFIG_MII /* MII PHY management */ #define CONFIG_PHY_ADDR 1 /* PHY address */ -#if defined(CONFIG_440) #define CONFIG_NET_MULTI 1 +#if defined(CONFIG_440) #define CONFIG_NETCONSOLE /* include NetConsole support */ #define CONFIG_SYS_RX_ETH_BUFFER 32 /* number of eth rx buffers */ #else diff --git a/include/configs/sbc405.h b/include/configs/sbc405.h index 7197aaf..242f42f 100644 --- a/include/configs/sbc405.h +++ b/include/configs/sbc405.h @@ -62,6 +62,7 @@ #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 0 /* PHY address */ #define CONFIG_PHY_RESET_DELAY 300 /* Intel LXT971A needs this */ +#define CONFIG_NET_MULTI
#define CONFIG_EXTRA_ENV_SETTINGS \ "bootargs=emac(0,0)host:/T221ppc/target/config/sbc405/vxWorks.st " \

Signed-off-by: Ben Warren biggerbadderben@gmail.com --- drivers/net/4xx_enet.c | 54 ------------------------------------------------ net/eth.c | 4 --- 2 files changed, 0 insertions(+), 58 deletions(-)
diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c index 918373b..adac00f 100644 --- a/drivers/net/4xx_enet.c +++ b/drivers/net/4xx_enet.c @@ -259,9 +259,6 @@ static const struct fixed_phy_port fixed_phy_port[] = { /*-----------------------------------------------------------------------------+ * Global variables. TX and RX descriptors and buffers. *-----------------------------------------------------------------------------*/ -#if !defined(CONFIG_NET_MULTI) -struct eth_device *emac0_dev = NULL; -#endif
/* * Get count of EMAC devices (doesn't have to be the max. possible number @@ -1641,11 +1638,7 @@ int enetInt (struct eth_device *dev) * Because the mal is generic, we need to get the current * eth device */ -#if defined(CONFIG_NET_MULTI) dev = eth_get_dev(); -#else - dev = emac0_dev; -#endif
hw_p = dev->priv;
@@ -2064,60 +2057,13 @@ int ppc_4xx_eth_initialize (bd_t * bis) virgin = 1; }
-#if defined(CONFIG_NET_MULTI) eth_register (dev); -#else - emac0_dev = dev; -#endif
-#if defined(CONFIG_NET_MULTI) #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) miiphy_register (dev->name, emac4xx_miiphy_read, emac4xx_miiphy_write); #endif -#endif } /* end for each supported device */
return 0; } - -#if !defined(CONFIG_NET_MULTI) -void eth_halt (void) { - if (emac0_dev) { - ppc_4xx_eth_halt(emac0_dev); - free(emac0_dev); - emac0_dev = NULL; - } -} - -int eth_init (bd_t *bis) -{ - ppc_4xx_eth_initialize(bis); - if (emac0_dev) { - return ppc_4xx_eth_init(emac0_dev, bis); - } else { - printf("ERROR: ethaddr not set!\n"); - return -1; - } -} - -int eth_send(volatile void *packet, int length) -{ - return (ppc_4xx_eth_send(emac0_dev, packet, length)); -} - -int eth_rx(void) -{ - return (ppc_4xx_eth_rx(emac0_dev)); -} - -int emac4xx_miiphy_initialize (bd_t * bis) -{ -#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) - miiphy_register ("ppc_4xx_eth0", - emac4xx_miiphy_read, emac4xx_miiphy_write); -#endif - - return 0; -} -#endif /* !defined(CONFIG_NET_MULTI) */ diff --git a/net/eth.c b/net/eth.c index caba80b..913350f 100644 --- a/net/eth.c +++ b/net/eth.c @@ -502,7 +502,6 @@ char *eth_get_name (void) #elif defined(CONFIG_CMD_NET) && !defined(CONFIG_NET_MULTI)
extern int at91rm9200_miiphy_initialize(bd_t *bis); -extern int emac4xx_miiphy_initialize(bd_t *bis); extern int mcf52x2_miiphy_initialize(bd_t *bis); extern int ns7520_miiphy_initialize(bd_t *bis);
@@ -516,9 +515,6 @@ int eth_initialize(bd_t *bis) #if defined(CONFIG_AT91RM9200) at91rm9200_miiphy_initialize(bis); #endif -#if defined(CONFIG_PPC4xx_EMAC) - emac4xx_miiphy_initialize(bis); -#endif #if defined(CONFIG_MCF52x2) mcf52x2_miiphy_initialize(bis); #endif

On Wednesday 29 April 2009, Ben Warren wrote:
Signed-off-by: Ben Warren biggerbadderben@gmail.com
drivers/net/4xx_enet.c | 54 ------------------------------------------------ net/eth.c | 4 --- 2 files changed, 0 insertions(+), 58 deletions(-)
Ben, this doesn't apply against mainline. I suppose you already based this against your "next"? Best would be if you would apply this patch directly and I'll apply the other one [[PATCH 1/2][Net][ppc4xx] Enable CONFIG_NET_MULTI on all remaining PPC4xx boards].
OK? If yes, I'll send a pull request for my "next" to Wolfgang tomorrow.
Thanks.
BTW: Please add my Signed-off-by to this patch [2/2].
Best regards, Stefan
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de =====================================================================

On Monday 04 May 2009, Stefan Roese wrote:
Ben, this doesn't apply against mainline. I suppose you already based this against your "next"? Best would be if you would apply this patch directly and I'll apply the other one [[PATCH 1/2][Net][ppc4xx] Enable CONFIG_NET_MULTI on all remaining PPC4xx boards].
OK? If yes, I'll send a pull request for my "next" to Wolfgang tomorrow.
Ben?
Best regards, Stefan
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de =====================================================================

Hi Stefan,
Stefan Roese wrote:
On Monday 04 May 2009, Stefan Roese wrote:
Ben, this doesn't apply against mainline. I suppose you already based this against your "next"? Best would be if you would apply this patch directly and I'll apply the other one [[PATCH 1/2][Net][ppc4xx] Enable CONFIG_NET_MULTI on all remaining PPC4xx boards].
OK? If yes, I'll send a pull request for my "next" to Wolfgang tomorrow.
Ben?
Sorry for the delay. Yeah, please go ahead and apply 1/2 to your tree and ask Wolfgang to pull. The second part can be applied at any time - I'll take care of it. Thanks for your help.
Best regards, Stefan
regards, Ben

Hi Stefan,
Ben Warren wrote:
Hi Stefan,
Stefan Roese wrote:
On Monday 04 May 2009, Stefan Roese wrote:
Ben, this doesn't apply against mainline. I suppose you already based this against your "next"? Best would be if you would apply this patch directly and I'll apply the other one [[PATCH 1/2][Net][ppc4xx] Enable CONFIG_NET_MULTI on all remaining PPC4xx boards].
OK? If yes, I'll send a pull request for my "next" to Wolfgang tomorrow.
Ben?
Sorry for the delay. Yeah, please go ahead and apply 1/2 to your tree and ask Wolfgang to pull. The second part can be applied at any time
- I'll take care of it. Thanks for your help.
I've gone ahead and applied the second part to the net tree. Hope that's OK.
regards, Ben

On Tuesday 26 May 2009 10:05:12 Ben Warren wrote:
Sorry for the delay. Yeah, please go ahead and apply 1/2 to your tree and ask Wolfgang to pull. The second part can be applied at any time
- I'll take care of it. Thanks for your help.
I've gone ahead and applied the second part to the net tree. Hope that's OK.
Yes, thanks.
Best regards, Stefan
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de =====================================================================

On Wednesday 29 April 2009, Ben Warren wrote:
All in-tree PPC4xx boards now use CONFIG_NET_MULTI
Signed-off-by: Ben Warren biggerbadderben@gmail.com
Applied to ppc4xx/next. Thanks.
Best regards, Stefan
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de =====================================================================
participants (2)
-
Ben Warren
-
Stefan Roese