summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorBen Warren <biggerbadderben@gmail.com>2009-10-04 22:37:03 -0700
committerBen Warren <biggerbadderben@gmail.com>2009-10-04 22:37:03 -0700
commit7194ab809532eeca3e2ee5dc12017cb901cc5842 (patch)
tree635cd41e409da222cfa7f975d1fcccfc14cc9b8c /board
parent32e7f239dda8638377edb0d3e7ac269cabbafbe6 (diff)
Convert SMC91111 Ethernet driver to CONFIG_NET_MULTI API
All in-tree boards that use this controller have CONFIG_NET_MULTI added Also: - changed CONFIG_DRIVER_SMC91111 to CONFIG_SMC91111 - cleaned up line lengths - modified all boards that override weak function in this driver - modified all eeprom standalone apps to work with new driver - updated blackfin standalone EEPROM app after testing Signed-off-by: Ben Warren <biggerbadderben@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'board')
-rw-r--r--board/altera/ep1c20/ep1c20.c12
-rw-r--r--board/altera/ep1s10/ep1s10.c12
-rw-r--r--board/altera/ep1s40/ep1s40.c12
-rw-r--r--board/armltd/integrator/integrator.c13
-rw-r--r--board/armltd/versatile/versatile.c12
-rw-r--r--board/bf533-ezkit/bf533-ezkit.c8
-rw-r--r--board/bf533-stamp/bf533-stamp.c8
-rw-r--r--board/bf538f-ezkit/bf538f-ezkit.c8
-rw-r--r--board/bf561-ezkit/bf561-ezkit.c8
-rw-r--r--board/blackstamp/blackstamp.c8
-rw-r--r--board/cerf250/cerf250.c12
-rw-r--r--board/cm-bf533/cm-bf533.c8
-rw-r--r--board/cm-bf561/cm-bf561.c8
-rw-r--r--board/cradle/cradle.c12
-rw-r--r--board/delta/delta.c12
-rw-r--r--board/dnp1110/dnp1110.c12
-rw-r--r--board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c12
-rw-r--r--board/gaisler/gr_ep2s60/gr_ep2s60.c12
-rw-r--r--board/innokom/innokom.c12
-rw-r--r--board/logodl/logodl.c12
-rw-r--r--board/lpd7a40x/lpd7a40x.c12
-rw-r--r--board/ms7722se/ms7722se.c12
-rw-r--r--board/netstar/eeprom.c57
-rw-r--r--board/netstar/netstar.c12
-rw-r--r--board/psyent/pk1c20/pk1c20.c12
-rw-r--r--board/pxa255_idp/pxa_idp.c12
-rw-r--r--board/renesas/MigoR/migo_r.c12
-rw-r--r--board/st/nhk8815/nhk8815.c12
-rw-r--r--board/voiceblue/eeprom.c57
-rw-r--r--board/voiceblue/voiceblue.c12
-rw-r--r--board/xaeniax/xaeniax.c12
-rw-r--r--board/xm250/xm250.c12
-rw-r--r--board/xsengine/xsengine.c12
-rw-r--r--board/zylonite/zylonite.c12
34 files changed, 413 insertions, 58 deletions
diff --git a/board/altera/ep1c20/ep1c20.c b/board/altera/ep1c20/ep1c20.c
index c5bfb85a71..82900f7170 100644
--- a/board/altera/ep1c20/ep1c20.c
+++ b/board/altera/ep1c20/ep1c20.c
@@ -22,6 +22,7 @@
*/
#include <common.h>
+#include <netdev.h>
int board_early_init_f (void)
{
@@ -38,3 +39,14 @@ phys_size_t initdram (int board_type)
{
return (0);
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/altera/ep1s10/ep1s10.c b/board/altera/ep1s10/ep1s10.c
index de9bf42bdc..cf886da64a 100644
--- a/board/altera/ep1s10/ep1s10.c
+++ b/board/altera/ep1s10/ep1s10.c
@@ -22,6 +22,7 @@
*/
#include <common.h>
+#include <netdev.h>
int board_early_init_f (void)
{
@@ -38,3 +39,14 @@ phys_size_t initdram (int board_type)
{
return (0);
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/altera/ep1s40/ep1s40.c b/board/altera/ep1s40/ep1s40.c
index c0eca17b92..6395de7293 100644
--- a/board/altera/ep1s40/ep1s40.c
+++ b/board/altera/ep1s40/ep1s40.c
@@ -22,6 +22,7 @@
*/
#include <common.h>
+#include <netdev.h>
int checkboard (void)
{
@@ -33,3 +34,14 @@ phys_size_t initdram (int board_type)
{
return (0);
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/armltd/integrator/integrator.c b/board/armltd/integrator/integrator.c
index a46deea448..518944e077 100644
--- a/board/armltd/integrator/integrator.c
+++ b/board/armltd/integrator/integrator.c
@@ -34,9 +34,7 @@
*/
#include <common.h>
-#ifdef CONFIG_PCI
#include <netdev.h>
-#endif
DECLARE_GLOBAL_DATA_PTR;
@@ -127,9 +125,16 @@ extern void dram_query(void);
return 0;
}
-#ifdef CONFIG_PCI
+#ifdef CONFIG_CMD_NET
int board_eth_init(bd_t *bis)
{
- return pci_eth_init(bis);
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+#ifdef CONFIG_PCI
+ rc += pci_eth_init(bis);
+#endif
+ return rc;
}
#endif
diff --git a/board/armltd/versatile/versatile.c b/board/armltd/versatile/versatile.c
index 197bc896ac..6e836dd1f9 100644
--- a/board/armltd/versatile/versatile.c
+++ b/board/armltd/versatile/versatile.c
@@ -34,6 +34,7 @@
*/
#include <common.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -89,3 +90,14 @@ int dram_init (void)
{
return 0;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/bf533-ezkit/bf533-ezkit.c b/board/bf533-ezkit/bf533-ezkit.c
index d5f0b7c689..8727dee6d9 100644
--- a/board/bf533-ezkit/bf533-ezkit.c
+++ b/board/bf533-ezkit/bf533-ezkit.c
@@ -26,6 +26,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include "psd4256.h"
#include "flash-defines.h"
@@ -57,3 +58,10 @@ int misc_init_r(void)
return 0;
}
+
+#ifdef CONFIG_SMC91111
+int board_eth_init(bd_t *bis)
+{
+ return smc91111_initialize(0, CONFIG_SMC91111_BASE);
+}
+#endif
diff --git a/board/bf533-stamp/bf533-stamp.c b/board/bf533-stamp/bf533-stamp.c
index 7108ddae45..a2269105be 100644
--- a/board/bf533-stamp/bf533-stamp.c
+++ b/board/bf533-stamp/bf533-stamp.c
@@ -26,6 +26,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <asm/io.h>
#include "bf533-stamp.h"
@@ -283,3 +284,10 @@ void __led_toggle(led_id_t mask)
}
#endif
+
+#ifdef CONFIG_SMC91111
+int board_eth_init(bd_t *bis)
+{
+ return smc91111_initialize(0, CONFIG_SMC91111_BASE);
+}
+#endif
diff --git a/board/bf538f-ezkit/bf538f-ezkit.c b/board/bf538f-ezkit/bf538f-ezkit.c
index bbee989675..15916fad64 100644
--- a/board/bf538f-ezkit/bf538f-ezkit.c
+++ b/board/bf538f-ezkit/bf538f-ezkit.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <config.h>
#include <asm/blackfin.h>
@@ -25,3 +26,10 @@ phys_size_t initdram(int board_type)
gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
return gd->bd->bi_memsize;
}
+
+#ifdef CONFIG_SMC91111
+int board_eth_init(bd_t *bis)
+{
+ return smc91111_initialize(0, CONFIG_SMC91111_BASE);
+}
+#endif
diff --git a/board/bf561-ezkit/bf561-ezkit.c b/board/bf561-ezkit/bf561-ezkit.c
index 5aede174d8..e5d7eb3388 100644
--- a/board/bf561-ezkit/bf561-ezkit.c
+++ b/board/bf561-ezkit/bf561-ezkit.c
@@ -26,6 +26,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -43,3 +44,10 @@ phys_size_t initdram(int board_type)
gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
return gd->bd->bi_memsize;
}
+
+#ifdef CONFIG_SMC91111
+int board_eth_init(bd_t *bis)
+{
+ return smc91111_initialize(0, CONFIG_SMC91111_BASE);
+}
+#endif
diff --git a/board/blackstamp/blackstamp.c b/board/blackstamp/blackstamp.c
index b671899e06..f55ab975e4 100644
--- a/board/blackstamp/blackstamp.c
+++ b/board/blackstamp/blackstamp.c
@@ -12,6 +12,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -44,3 +45,10 @@ void swap_to(int device_id)
SSYNC();
}
#endif
+
+#ifdef CONFIG_SMC91111
+int board_eth_init(bd_t *bis)
+{
+ return smc91111_initialize(0, CONFIG_SMC91111_BASE);
+}
+#endif
diff --git a/board/cerf250/cerf250.c b/board/cerf250/cerf250.c
index 307894fd61..59346bc6d4 100644
--- a/board/cerf250/cerf250.c
+++ b/board/cerf250/cerf250.c
@@ -26,6 +26,7 @@
*/
#include <common.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -71,3 +72,14 @@ int dram_init (void)
return 0;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/cm-bf533/cm-bf533.c b/board/cm-bf533/cm-bf533.c
index 7eb761dcc8..ab0bf3bf65 100644
--- a/board/cm-bf533/cm-bf533.c
+++ b/board/cm-bf533/cm-bf533.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -23,3 +24,10 @@ phys_size_t initdram(int board_type)
gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
return gd->bd->bi_memsize;
}
+
+#ifdef CONFIG_SMC91111
+int board_eth_init(bd_t *bis)
+{
+ return smc91111_initialize(0, CONFIG_SMC91111_BASE);
+}
+#endif
diff --git a/board/cm-bf561/cm-bf561.c b/board/cm-bf561/cm-bf561.c
index 5bce9eb59d..f21a015e42 100644
--- a/board/cm-bf561/cm-bf561.c
+++ b/board/cm-bf561/cm-bf561.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -23,3 +24,10 @@ phys_size_t initdram(int board_type)
gd->bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
return gd->bd->bi_memsize;
}
+
+#ifdef CONFIG_SMC91111
+int board_eth_init(bd_t *bis)
+{
+ return smc91111_initialize(0, CONFIG_SMC91111_BASE);
+}
+#endif
diff --git a/board/cradle/cradle.c b/board/cradle/cradle.c
index 6d8d55570f..21eb6550db 100644
--- a/board/cradle/cradle.c
+++ b/board/cradle/cradle.c
@@ -27,6 +27,7 @@
#include <asm/arch/pxa-regs.h>
#include <common.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -223,3 +224,14 @@ dram_init (void)
PHYS_SDRAM_3_SIZE +
PHYS_SDRAM_4_SIZE );
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/delta/delta.c b/board/delta/delta.c
index 84ff47e53c..a2942135fd 100644
--- a/board/delta/delta.c
+++ b/board/delta/delta.c
@@ -22,6 +22,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <i2c.h>
#include <da9030.h>
#include <malloc.h>
@@ -363,3 +364,14 @@ void hw_watchdog_reset(void)
i2c_reg_write(addr, SYS_CONTROL_A, val);
}
#endif
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/dnp1110/dnp1110.c b/board/dnp1110/dnp1110.c
index ab8e7beb99..c215f5f49b 100644
--- a/board/dnp1110/dnp1110.c
+++ b/board/dnp1110/dnp1110.c
@@ -23,6 +23,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <SA-1100.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -53,3 +54,14 @@ int dram_init (void)
return (0);
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c b/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c
index 105a74714b..7fe85b85ad 100644
--- a/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c
+++ b/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c
@@ -19,6 +19,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <config.h>
#include <asm/leon.h>
@@ -37,3 +38,14 @@ int misc_init_r(void)
{
return 0;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/gaisler/gr_ep2s60/gr_ep2s60.c b/board/gaisler/gr_ep2s60/gr_ep2s60.c
index 2904d32586..7241c6d1a4 100644
--- a/board/gaisler/gr_ep2s60/gr_ep2s60.c
+++ b/board/gaisler/gr_ep2s60/gr_ep2s60.c
@@ -19,6 +19,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <config.h>
#include <asm/leon.h>
@@ -37,3 +38,14 @@ int misc_init_r(void)
{
return 0;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/innokom/innokom.c b/board/innokom/innokom.c
index c2b88ae16a..3412f10d3f 100644
--- a/board/innokom/innokom.c
+++ b/board/innokom/innokom.c
@@ -24,6 +24,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <asm/arch/pxa-regs.h>
#include <asm/mach-types.h>
@@ -182,3 +183,14 @@ void show_boot_progress (int status)
return;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/logodl/logodl.c b/board/logodl/logodl.c
index c57210a95f..2562ecca35 100644
--- a/board/logodl/logodl.c
+++ b/board/logodl/logodl.c
@@ -23,6 +23,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <asm/arch/pxa-regs.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -120,3 +121,14 @@ void show_boot_progress (int status)
return;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/lpd7a40x/lpd7a40x.c b/board/lpd7a40x/lpd7a40x.c
index 7edb65e6d8..437dad0388 100644
--- a/board/lpd7a40x/lpd7a40x.c
+++ b/board/lpd7a40x/lpd7a40x.c
@@ -26,6 +26,7 @@
*/
#include <common.h>
+#include <netdev.h>
#if defined(CONFIG_LH7A400)
#include <lh7a400.h>
#elif defined(CONFIG_LH7A404)
@@ -79,3 +80,14 @@ int dram_init (void)
return 0;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/ms7722se/ms7722se.c b/board/ms7722se/ms7722se.c
index 32234d3e08..4e40b17343 100644
--- a/board/ms7722se/ms7722se.c
+++ b/board/ms7722se/ms7722se.c
@@ -24,6 +24,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <asm/io.h>
#include <asm/processor.h>
@@ -57,3 +58,14 @@ void led_set_state(unsigned short value)
{
writew(value & 0xFF, LED_BASE);
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/netstar/eeprom.c b/board/netstar/eeprom.c
index 5806128cf1..1366457b9b 100644
--- a/board/netstar/eeprom.c
+++ b/board/netstar/eeprom.c
@@ -27,43 +27,42 @@
#include <common.h>
#include <exports.h>
#include <timestamp.h>
+#include <net.h>
#include "../drivers/net/smc91111.h"
-#define SMC_BASE_ADDRESS CONFIG_SMC91111_BASE
-
-static u16 read_eeprom_reg(u16 reg)
+static u16 read_eeprom_reg(struct eth_device *dev, u16 reg)
{
int timeout;
- SMC_SELECT_BANK(2);
- SMC_outw(reg, PTR_REG);
+ SMC_SELECT_BANK(dev, 2);
+ SMC_outw(dev, reg, PTR_REG);
- SMC_SELECT_BANK(1);
- SMC_outw(SMC_inw (CTL_REG) | CTL_EEPROM_SELECT | CTL_RELOAD,
+ SMC_SELECT_BANK(dev, 1);
+ SMC_outw(dev, SMC_inw (dev, CTL_REG) | CTL_EEPROM_SELECT | CTL_RELOAD,
CTL_REG);
timeout = 100;
- while((SMC_inw (CTL_REG) & CTL_RELOAD) && --timeout)
+ while((SMC_inw (dev, CTL_REG) & CTL_RELOAD) && --timeout)
udelay(100);
if (timeout == 0) {
printf("Timeout Reading EEPROM register %02x\n", reg);
return 0;
}
- return SMC_inw (GP_REG);
+ return SMC_inw (dev, GP_REG);
}
-static int write_eeprom_reg(u16 value, u16 reg)
+static int write_eeprom_reg(struct eth_device *dev, u16 value, u16 reg)
{
int timeout;
- SMC_SELECT_BANK(2);
- SMC_outw(reg, PTR_REG);
+ SMC_SELECT_BANK(dev, 2);
+ SMC_outw(dev, reg, PTR_REG);
- SMC_SELECT_BANK(1);
- SMC_outw(value, GP_REG);
- SMC_outw(SMC_inw (CTL_REG) | CTL_EEPROM_SELECT | CTL_STORE, CTL_REG);
+ SMC_SELECT_BANK(dev, 1);
+ SMC_outw(dev, value, GP_REG);
+ SMC_outw(dev, SMC_inw (dev, CTL_REG) | CTL_EEPROM_SELECT | CTL_STORE, CTL_REG);
timeout = 100;
- while ((SMC_inw(CTL_REG) & CTL_STORE) && --timeout)
+ while ((SMC_inw(dev, CTL_REG) & CTL_STORE) && --timeout)
udelay (100);
if (timeout == 0) {
printf("Timeout Writing EEPROM register %02x\n", reg);
@@ -73,17 +72,17 @@ static int write_eeprom_reg(u16 value, u16 reg)
return 1;
}
-static int write_data(u16 *buf, int len)
+static int write_data(struct eth_device *dev, u16 *buf, int len)
{
u16 reg = 0x23;
while (len--)
- write_eeprom_reg(*buf++, reg++);
+ write_eeprom_reg(dev, *buf++, reg++);
return 0;
}
-static int verify_macaddr(char *s)
+static int verify_macaddr(struct eth_device *dev, char *s)
{
u16 reg;
int i, err = 0;
@@ -91,7 +90,7 @@ static int verify_macaddr(char *s)
printf("MAC Address: ");
err = i = 0;
for (i = 0; i < 3; i++) {
- reg = read_eeprom_reg(0x20 + i);
+ reg = read_eeprom_reg(dev, 0x20 + i);
printf("%02x:%02x%c", reg & 0xff, reg >> 8, i != 2 ? ':' : '\n');
if (s)
err |= reg != ((u16 *)s)[i];
@@ -100,7 +99,7 @@ static int verify_macaddr(char *s)
return err ? 0 : 1;
}
-static int set_mac(char *s)
+static int set_mac(struct eth_device *dev, char *s)
{
int i;
char *e, eaddr[6];
@@ -112,7 +111,7 @@ static int set_mac(char *s)
}
for (i = 0; i < 3; i++)
- write_eeprom_reg(*(((u16 *)eaddr) + i), 0x20 + i);
+ write_eeprom_reg(dev, *(((u16 *)eaddr) + i), 0x20 + i);
return 0;
}
@@ -150,6 +149,10 @@ int eeprom(int argc, char *argv[])
int i, len, ret;
unsigned char buf[58], *p;
+ struct eth_device dev = {
+ .iobase = CONFIG_SMC91111_BASE
+ };
+
app_startup(argv);
if (get_version() != XF_VERSION) {
printf("Wrong XF_VERSION.\n");
@@ -160,14 +163,14 @@ int eeprom(int argc, char *argv[])
return crcek();
- if ((SMC_inw (BANK_SELECT) & 0xFF00) != 0x3300) {
+ if ((SMC_inw (&dev, BANK_SELECT) & 0xFF00) != 0x3300) {
printf("SMSC91111 not found.\n");
return 2;
}
/* Called without parameters - print MAC address */
if (argc < 2) {
- verify_macaddr(NULL);
+ verify_macaddr(&dev, NULL);
return 0;
}
@@ -201,8 +204,8 @@ int eeprom(int argc, char *argv[])
}
/* First argument (MAC) is mandatory */
- set_mac(argv[1]);
- if (verify_macaddr(argv[1])) {
+ set_mac(&dev, argv[1]);
+ if (verify_macaddr(&dev, argv[1])) {
printf("*** MAC address does not match! ***\n");
return 4;
}
@@ -210,7 +213,7 @@ int eeprom(int argc, char *argv[])
while (len--)
*p++ = 0;
- write_data((u16 *)buf, sizeof(buf) >> 1);
+ write_data(&dev, (u16 *)buf, sizeof(buf) >> 1);
return 0;
}
diff --git a/board/netstar/netstar.c b/board/netstar/netstar.c
index ffd60bfae0..df1704be35 100644
--- a/board/netstar/netstar.c
+++ b/board/netstar/netstar.c
@@ -21,6 +21,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <i2c.h>
#include <flash.h>
#include <nand.h>
@@ -115,3 +116,14 @@ int board_nand_init(struct nand_chip *nand)
return 0;
}
#endif
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/psyent/pk1c20/pk1c20.c b/board/psyent/pk1c20/pk1c20.c
index 95b48bc57b..0a24866960 100644
--- a/board/psyent/pk1c20/pk1c20.c
+++ b/board/psyent/pk1c20/pk1c20.c
@@ -22,6 +22,7 @@
*/
#include <common.h>
+#include <netdev.h>
int board_early_init_f (void)
{
@@ -38,3 +39,14 @@ phys_size_t initdram (int board_type)
{
return (0);
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/pxa255_idp/pxa_idp.c b/board/pxa255_idp/pxa_idp.c
index e9e479c4ba..05e30ecf00 100644
--- a/board/pxa255_idp/pxa_idp.c
+++ b/board/pxa255_idp/pxa_idp.c
@@ -31,6 +31,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <command.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -133,3 +134,14 @@ U_BOOT_CMD(idpcmd, CONFIG_SYS_MAXARGS, 0, do_idpcmd,
);
#endif
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/renesas/MigoR/migo_r.c b/board/renesas/MigoR/migo_r.c
index 204ca78fa4..c0f26ac1ea 100644
--- a/board/renesas/MigoR/migo_r.c
+++ b/board/renesas/MigoR/migo_r.c
@@ -24,6 +24,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <asm/io.h>
#include <asm/processor.h>
@@ -51,3 +52,14 @@ int dram_init (void)
void led_set_state (unsigned short value)
{
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/st/nhk8815/nhk8815.c b/board/st/nhk8815/nhk8815.c
index 1fa506a889..faef8109db 100644
--- a/board/st/nhk8815/nhk8815.c
+++ b/board/st/nhk8815/nhk8815.c
@@ -26,6 +26,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <asm/io.h>
#include <asm/arch/gpio.h>
@@ -89,3 +90,14 @@ int dram_init(void)
gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
return 0;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/voiceblue/eeprom.c b/board/voiceblue/eeprom.c
index f01597ad10..2ae46d10cd 100644
--- a/board/voiceblue/eeprom.c
+++ b/board/voiceblue/eeprom.c
@@ -27,43 +27,42 @@
#include <common.h>
#include <exports.h>
#include <timestamp.h>
+#include <net.h>
#include "../drivers/net/smc91111.h"
-#define SMC_BASE_ADDRESS CONFIG_SMC91111_BASE
-
-static u16 read_eeprom_reg(u16 reg)
+static u16 read_eeprom_reg(struct eth_device *dev, u16 reg)
{
int timeout;
- SMC_SELECT_BANK(2);
- SMC_outw(reg, PTR_REG);
+ SMC_SELECT_BANK(dev, 2);
+ SMC_outw(dev, reg, PTR_REG);
- SMC_SELECT_BANK(1);
- SMC_outw(SMC_inw (CTL_REG) | CTL_EEPROM_SELECT | CTL_RELOAD,
+ SMC_SELECT_BANK(dev, 1);
+ SMC_outw(dev, SMC_inw (dev, CTL_REG) | CTL_EEPROM_SELECT | CTL_RELOAD,
CTL_REG);
timeout = 100;
- while((SMC_inw (CTL_REG) & CTL_RELOAD) && --timeout)
+ while((SMC_inw (dev, CTL_REG) & CTL_RELOAD) && --timeout)
udelay(100);
if (timeout == 0) {
printf("Timeout Reading EEPROM register %02x\n", reg);
return 0;
}
- return SMC_inw (GP_REG);
+ return SMC_inw (dev, GP_REG);
}
-static int write_eeprom_reg(u16 value, u16 reg)
+static int write_eeprom_reg(struct eth_device *dev, u16 value, u16 reg)
{
int timeout;
- SMC_SELECT_BANK(2);
- SMC_outw(reg, PTR_REG);
+ SMC_SELECT_BANK(dev, 2);
+ SMC_outw(dev, reg, PTR_REG);
- SMC_SELECT_BANK(1);
- SMC_outw(value, GP_REG);
- SMC_outw(SMC_inw (CTL_REG) | CTL_EEPROM_SELECT | CTL_STORE, CTL_REG);
+ SMC_SELECT_BANK(dev, 1);
+ SMC_outw(dev, value, GP_REG);
+ SMC_outw(dev, SMC_inw (dev, CTL_REG) | CTL_EEPROM_SELECT | CTL_STORE, CTL_REG);
timeout = 100;
- while ((SMC_inw(CTL_REG) & CTL_STORE) && --timeout)
+ while ((SMC_inw(dev, CTL_REG) & CTL_STORE) && --timeout)
udelay (100);
if (timeout == 0) {
printf("Timeout Writing EEPROM register %02x\n", reg);
@@ -73,17 +72,17 @@ static int write_eeprom_reg(u16 value, u16 reg)
return 1;
}
-static int write_data(u16 *buf, int len)
+static int write_data(struct eth_device *dev, u16 *buf, int len)
{
u16 reg = 0x23;
while (len--)
- write_eeprom_reg(*buf++, reg++);
+ write_eeprom_reg(dev, *buf++, reg++);
return 0;
}
-static int verify_macaddr(char *s)
+static int verify_macaddr(struct eth_device *dev, char *s)
{
u16 reg;
int i, err = 0;
@@ -91,7 +90,7 @@ static int verify_macaddr(char *s)
printf("MAC Address: ");
err = i = 0;
for (i = 0; i < 3; i++) {
- reg = read_eeprom_reg(0x20 + i);
+ reg = read_eeprom_reg(dev, 0x20 + i);
printf("%02x:%02x%c", reg & 0xff, reg >> 8, i != 2 ? ':' : '\n');
if (s)
err |= reg != ((u16 *)s)[i];
@@ -100,7 +99,7 @@ static int verify_macaddr(char *s)
return err ? 0 : 1;
}
-static int set_mac(char *s)
+static int set_mac(struct eth_device *dev, char *s)
{
int i;
char *e, eaddr[6];
@@ -112,7 +111,7 @@ static int set_mac(char *s)
}
for (i = 0; i < 3; i++)
- write_eeprom_reg(*(((u16 *)eaddr) + i), 0x20 + i);
+ write_eeprom_reg(dev, *(((u16 *)eaddr) + i), 0x20 + i);
return 0;
}
@@ -148,6 +147,10 @@ int eeprom(int argc, char *argv[])
int i, len, ret;
unsigned char buf[58], *p;
+ struct eth_device dev = {
+ .iobase = CONFIG_SMC91111_BASE
+ };
+
app_startup(argv);
if (get_version() != XF_VERSION) {
printf("Wrong XF_VERSION.\n");
@@ -156,14 +159,14 @@ int eeprom(int argc, char *argv[])
return 1;
}
- if ((SMC_inw (BANK_SELECT) & 0xFF00) != 0x3300) {
+ if ((SMC_inw (&dev, BANK_SELECT) & 0xFF00) != 0x3300) {
printf("SMSC91111 not found.\n");
return 2;
}
/* Called without parameters - print MAC address */
if (argc < 2) {
- verify_macaddr(NULL);
+ verify_macaddr(&dev, NULL);
return 0;
}
@@ -197,8 +200,8 @@ int eeprom(int argc, char *argv[])
}
/* First argument (MAC) is mandatory */
- set_mac(argv[1]);
- if (verify_macaddr(argv[1])) {
+ set_mac(&dev, argv[1]);
+ if (verify_macaddr(&dev, argv[1])) {
printf("*** MAC address does not match! ***\n");
return 4;
}
@@ -206,7 +209,7 @@ int eeprom(int argc, char *argv[])
while (len--)
*p++ = 0;
- write_data((u16 *)buf, sizeof(buf) >> 1);
+ write_data(&dev, (u16 *)buf, sizeof(buf) >> 1);
return 0;
}
diff --git a/board/voiceblue/voiceblue.c b/board/voiceblue/voiceblue.c
index 59b3310ae8..5f8af2bd24 100644
--- a/board/voiceblue/voiceblue.c
+++ b/board/voiceblue/voiceblue.c
@@ -20,6 +20,7 @@
*/
#include <common.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -66,3 +67,14 @@ int board_late_init(void)
return 0;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/xaeniax/xaeniax.c b/board/xaeniax/xaeniax.c
index 9baa457c04..4c19c4dd4e 100644
--- a/board/xaeniax/xaeniax.c
+++ b/board/xaeniax/xaeniax.c
@@ -29,6 +29,7 @@
*/
#include <common.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -71,3 +72,14 @@ int dram_init (void)
return 0;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/xm250/xm250.c b/board/xm250/xm250.c
index 56b1cd4f46..246bdde750 100644
--- a/board/xm250/xm250.c
+++ b/board/xm250/xm250.c
@@ -27,6 +27,7 @@
#include <asm/arch/pxa-regs.h>
#include <common.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -80,3 +81,14 @@ dram_init (void)
return (0);
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/xsengine/xsengine.c b/board/xsengine/xsengine.c
index 65923e92c5..4464fd4a0a 100644
--- a/board/xsengine/xsengine.c
+++ b/board/xsengine/xsengine.c
@@ -26,6 +26,7 @@
*/
#include <common.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -61,3 +62,14 @@ int dram_init (void)
return 0;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/zylonite/zylonite.c b/board/zylonite/zylonite.c
index 58291706c0..749a40f529 100644
--- a/board/zylonite/zylonite.c
+++ b/board/zylonite/zylonite.c
@@ -26,6 +26,7 @@
*/
#include <common.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -68,3 +69,14 @@ int dram_init (void)
return 0;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC91111
+ rc = smc91111_initialize(0, CONFIG_SMC91111_BASE);
+#endif
+ return rc;
+}
+#endif