summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-06-06 11:20:01 +0000
committerwdenk <wdenk>2003-06-06 11:20:01 +0000
commit487778b781257831aa9b9140dd3c7ad4176e8314 (patch)
tree9e6465b0df23d42d338dd23cccfba8189ab74395
parent8b601449e840a5d1e29859dc2a968c43284cee66 (diff)
downloadu-boot-487778b781257831aa9b9140dd3c7ad4176e8314.tar.gz
u-boot-487778b781257831aa9b9140dd3c7ad4176e8314.tar.xz
u-boot-487778b781257831aa9b9140dd3c7ad4176e8314.zip
Patch by Robert Schwebel, April 02, 2003:
fix for SMSC91111 driver
-rw-r--r--CHANGELOG3
-rw-r--r--drivers/smc91111.c14
-rw-r--r--drivers/smc91111.h2
3 files changed, 18 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index bcb7776738..f9790683bf 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,9 @@
Changes since U-Boot 0.3.1:
======================================================================
+* Patch by Robert Schwebel, April 02, 2003:
+ fix for SMSC91111 driver
+
* Patch by Vladimir Gurevich, 04 Jun 2003:
make ppc405 ethernet driver compatible with CONFIG_NET_MULTI option
diff --git a/drivers/smc91111.c b/drivers/smc91111.c
index 652d859dc6..748830e01c 100644
--- a/drivers/smc91111.c
+++ b/drivers/smc91111.c
@@ -317,6 +317,17 @@ static int poll4int( byte mask, int timeout ) {
return 0;
}
+/* Only one release command at a time, please */
+static inline void smc_wait_mmu_release_complete(void)
+{
+ int count = 0;
+ /* assume bank 2 selected */
+ while ( SMC_inw(MMU_CMD_REG) & MC_BUSY ) {
+ udelay(1); // Wait until not busy
+ if( ++count > 200) break;
+ }
+}
+
/*
. Function: smc_reset( void )
. Purpose:
@@ -374,6 +385,7 @@ static void smc_reset( void )
/* Reset the MMU */
SMC_SELECT_BANK( 2 );
+ smc_wait_mmu_release_complete();
SMC_outw( MC_RESET, MMU_CMD_REG );
while ( SMC_inw( MMU_CMD_REG ) & MC_BUSY )
udelay(1); /* Wait until not busy */
@@ -674,6 +686,8 @@ static int smc_open()
/* SMC_SELECT_BANK(0); */
/* SMC_outw(0, RPC_REG); */
+ SMC_SELECT_BANK(1);
+
#ifdef USE_32_BIT
for ( i = 0; i < 6; i += 2 ) {
word address;
diff --git a/drivers/smc91111.h b/drivers/smc91111.h
index a372c2734d..3ac0a03d5d 100644
--- a/drivers/smc91111.h
+++ b/drivers/smc91111.h
@@ -80,7 +80,7 @@ typedef unsigned long int dword;
#define SMC_inw(r) (*((volatile word *)(SMC_BASE_ADDRESS+(r))))
#define SMC_inb(p) ({ \
unsigned int __p = (unsigned int)(SMC_BASE_ADDRESS + (p)); \
- unsigned int __v = *(volatile unsigned short *)((SMC_BASE_ADDRESS + __p) & ~1); \
+ unsigned int __v = *(volatile unsigned short *)((__p) & ~1); \
if (__p & 1) __v >>= 8; \
else __v &= 0xff; \
__v; })