[U-Boot] [PATCH] Trizeps IV adaptation to changes in dm9000 driver

sbabic at denx.de sbabic at denx.de
Wed May 6 08:55:22 CEST 2009


From: Stefano Babic <sbabic at denx.de>

Last patch in the dm9000 driver breaks the trizeps IV board (PXA).
Reading of eeprom is modified here to reflect the changes in
read_srom_word().

Signed-off-by: Stefano Babic <sbabic at denx.de>
---
 board/trizepsiv/eeprom.c |   10 ++++++----
 drivers/net/dm9000x.c    |    4 ++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/board/trizepsiv/eeprom.c b/board/trizepsiv/eeprom.c
index 63f1c6c..68fc754 100644
--- a/board/trizepsiv/eeprom.c
+++ b/board/trizepsiv/eeprom.c
@@ -24,16 +24,18 @@
 #include <common.h>
 #include <command.h>
 
-extern u16 read_srom_word(int);
+extern void read_srom_word(int, u8 *);
 extern void write_srom_word(int offset, u16 val);
 
 static int do_read_dm9000_eeprom ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) {
-	int i;
+	unsigned int i;
+	u8 value;
 
 	for (i=0; i < 0x40; i++) {
 		if (!(i % 0x10))
-			printf("\n%08lx:", i);
-		printf(" %04x", read_srom_word(i));
+			printf("\n%08x:", i);
+		read_srom_word(i, &value);
+		printf(" %04x", value);
 	}
 	printf ("\n");
 	return (0);
diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index 8ca2bf7..519a11d 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -113,7 +113,7 @@ 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 *);
+void read_srom_word(int, u8 *);
 static u8 DM9000_ior(int);
 static void DM9000_iow(int reg, u8 value);
 
@@ -541,7 +541,7 @@ eth_rx(void)
 /*
   Read a word data from SROM
 */
-static void read_srom_word(int offset, u8 *to)
+void read_srom_word(int offset, u8 *to)
 {
 	DM9000_iow(DM9000_EPAR, offset);
 	DM9000_iow(DM9000_EPCR, 0x4);
-- 
1.6.0.4



More information about the U-Boot mailing list