diff --git a/common/miiphyutil.c b/common/miiphyutil.c --- a/common/miiphyutil.c +++ b/common/miiphyutil.c @@ -58,6 +58,12 @@ struct mii_dev { static struct list_head mii_devs; static struct mii_dev *current_mii; +void miiphy_init(void) +{ + INIT_LIST_HEAD(&mii_devs); + current_mii = NULL; +} + /***************************************************************************** * * Register read and write MII access routines for the device . diff --git a/cpu/ppc4xx/4xx_enet.c b/cpu/ppc4xx/4xx_enet.c --- a/cpu/ppc4xx/4xx_enet.c +++ b/cpu/ppc4xx/4xx_enet.c @@ -1360,6 +1360,10 @@ int ppc_4xx_eth_initialize (bd_t * bis) #endif #endif +#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) + miiphy_init(); +#endif + for (eth_num = 0; eth_num < LAST_EMAC_NUM; eth_num++) { /* See if we can actually bring up the interface, otherwise, skip it */ diff --git a/include/miiphy.h b/include/miiphy.h --- a/include/miiphy.h +++ b/include/miiphy.h @@ -62,6 +62,7 @@ void miiphy_register(char *devname, int miiphy_set_current_dev(char *devname); char *miiphy_get_current_dev(void); +void miiphy_init(void); void miiphy_listdev(void); #define BB_MII_DEVNAME "bbmii"