Skip to contentSkip to conversation

smc91111_eeprom: move board-specific init into SMC91111_EEPROM_INIT()

PATCH New Mike Frysinger 2 participants 2 messages Mar 23, 2009 – Apr 4, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smc91111_eeprom: move board-specific init into SMC91111_EEPROM_INIT()

Rather than sticking Blackfin-specific stuff into the eeprom example, use an indirect macro so that any board can override it with their own magic sauce in their board config file.

Also fix some spurious semi-colons in defines while I'm at it ...

---
 examples/smc91111_eeprom.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)
examples/smc91111_eeprom.c +6 -9
index 62347c7..39e5306 100644
@@ -33,15 +33,14 @@
 
 #ifdef CONFIG_DRIVER_SMC91111
 
-#ifdef pFIO0_DIR
-# define pFIO_DIR    pFIO0_DIR
-# define pFIO_FLAG_S pFIO0_FLAG_S
+#ifndef SMC91111_EEPROM_INIT
+# define SMC91111_EEPROM_INIT()
 #endif
 
 #define SMC_BASE_ADDRESS CONFIG_SMC91111_BASE
-#define EEPROM		0x1;
-#define MAC		0x2;
-#define	UNKNOWN		0x4;
+#define EEPROM		0x1
+#define MAC		0x2
+#define UNKNOWN		0x4
 
 void dump_reg (void);
 void dump_eeprom (void);
@@ -66,9 +65,7 @@ int smc91111_eeprom (int argc, char *argv[])
 		return (0);
 	}
 
-	*pFIO_DIR = 0x01;
-	*pFIO_FLAG_S = 0x01;
-	SSYNC();
+	SMC91111_EEPROM_INIT();
 
 	if ((SMC_inw (BANK_SELECT) & 0xFF00) != 0x3300) {
 		printf ("Can't find SMSC91111\n");
Signature · 1 line
1.6.2
#1 lore raw

PATCH 1/1 smc91111_eeprom: move board-specific init into SMC91111_EEPROM_INIT()

Dear Mike Frysinger,

Quoted 11 lines · In message <[email protected]> you wrote:

Rather than sticking Blackfin-specific stuff into the eeprom example, use an indirect macro so that any board can override it with their own magic sauce in their board config file.

Also fix some spurious semi-colons in defines while I'm at it ...

---
 examples/smc91111_eeprom.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Many Myths are based on truth
	-- Spock, "The Way to Eden",  stardate 5832.3