summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorRemy Bohmer <linux@bohmer.net>2009-05-03 12:11:40 +0200
committerBen Warren <biggerbadderben@gmail.com>2009-06-08 22:57:21 -0700
commite5a3bc2401a23f1890611f020f57f94824a534db (patch)
tree056417ad7680fa6192119f7aa4fe2daa935e5e53 /drivers/net
parent2c0234fa79122a5aa77c4e17c33eb2fe184b61a7 (diff)
downloadu-boot-imx-e5a3bc2401a23f1890611f020f57f94824a534db.zip
u-boot-imx-e5a3bc2401a23f1890611f020f57f94824a534db.tar.gz
u-boot-imx-e5a3bc2401a23f1890611f020f57f94824a534db.tar.bz2
Add config option for disabling DM9000-SROM support.
Some boards do not have SROM support for the DM9000 network adapter. Instead of listing these board names in the driver code, make this option configurable from the board config file. It also removes a build warning for the at91sam9261ek board: 'dm9000x.c:545: warning: 'read_srom_word' defined but not used' And it repaires the trizepsiv board build which was broken around the same routines Signed-off-by: Remy Bohmer <linux@bohmer.net> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/dm9000x.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index 8ca2bf7..f139435 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -53,7 +53,7 @@ v1.2 03/18/2003 Weilun Huang <weilun_huang@davicom.com.tw>:
notes (i.e. double reset)
- some minor code cleanups
These changes are tested with DM9000{A,EP,E} together
- with a 200MHz Atmel AT91SAM92161 core
+ with a 200MHz Atmel AT91SAM9261 core
TODO: external MII is not functional, only internal at the moment.
*/
@@ -62,6 +62,7 @@ TODO: external MII is not functional, only internal at the moment.
#include <command.h>
#include <net.h>
#include <asm/io.h>
+#include <dm9000.h>
#include "dm9000x.h"
@@ -113,7 +114,6 @@ void eth_halt(void);
static int dm9000_probe(void);
static u16 phy_read(int);
static void phy_write(int, u16);
-static void read_srom_word(int, u8 *);
static u8 DM9000_ior(int);
static void DM9000_iow(int reg, u8 value);
@@ -347,9 +347,9 @@ eth_init(bd_t * bd)
/* Set Node address */
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
-#if !defined(CONFIG_AT91SAM9261EK)
+#if !defined(CONFIG_DM9000_NO_SROM)
for (i = 0; i < 3; i++)
- read_srom_word(i, enetaddr + 2 * i);
+ dm9000_read_srom_word(i, enetaddr + 2 * i);
eth_setenv_enetaddr("ethaddr", enetaddr);
#endif
}
@@ -541,7 +541,8 @@ eth_rx(void)
/*
Read a word data from SROM
*/
-static void read_srom_word(int offset, u8 *to)
+#if !defined(CONFIG_DM9000_NO_SROM)
+void dm9000_read_srom_word(int offset, u8 *to)
{
DM9000_iow(DM9000_EPAR, offset);
DM9000_iow(DM9000_EPCR, 0x4);
@@ -551,8 +552,7 @@ static void read_srom_word(int offset, u8 *to)
to[1] = DM9000_ior(DM9000_EPDRH);
}
-void
-write_srom_word(int offset, u16 val)
+void dm9000_write_srom_word(int offset, u16 val)
{
DM9000_iow(DM9000_EPAR, offset);
DM9000_iow(DM9000_EPDRH, ((val >> 8) & 0xff));
@@ -561,7 +561,7 @@ write_srom_word(int offset, u16 val)
udelay(8000);
DM9000_iow(DM9000_EPCR, 0);
}
-
+#endif
/*
Read a byte from I/O port