Changes for U-Boot 1.1.4:
======================================================================
+* Fix miiphy global data initialization (problem on 4xx boards when no
+ ethaddr is assigned). Initialization moved from miiphy_register() to
+ eth_initialize().
+
+ Based on initial patch for 4xx platform by Matthias Fuchs.
+
* Remove unnnecessary #include <linux/types.h> from include/asm-*/u-boot.h
* Allow use of include/image.h and include/asm-*/u-boot.h in proprietary code.
static struct list_head mii_devs;
static struct mii_dev *current_mii;
+/*****************************************************************************
+ *
+ * Initialize global data. Need to be called before any other miiphy routine.
+ */
+void miiphy_init()
+{
+ INIT_LIST_HEAD(&mii_devs);
+ current_mii = NULL;
+}
+
/*****************************************************************************
*
* Register read and write MII access routines for the device <name>.
struct list_head *entry;
struct mii_dev *new_dev;
struct mii_dev *miidev;
- static int head_initialized = 0;
unsigned int name_len;
- if (head_initialized == 0) {
- INIT_LIST_HEAD(&mii_devs);
- current_mii = NULL;
- head_initialized = 1;
- }
-
/* check if we have unique name */
list_for_each(entry, &mii_devs) {
miidev = list_entry(entry, struct mii_dev, link);
int miiphy_link(char *devname, unsigned char addr);
#endif
+void miiphy_init(void);
+
void miiphy_register(char *devname,
int (* read)(char *devname, unsigned char addr,
unsigned char reg, unsigned short *value),
#include <common.h>
#include <command.h>
#include <net.h>
+#include <miiphy.h>
#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI)
eth_devices = NULL;
eth_current = NULL;
+#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+ miiphy_init();
+#endif
+
#ifdef CONFIG_DB64360
mv6436x_eth_initialize(bis);
#endif
int eth_initialize(bd_t *bis)
{
+#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
+ miiphy_init();
+#endif
+
#if defined(CONFIG_AT91RM9200)
at91rm9200_miiphy_initialize(bis);
#endif