mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 22:51:37 +00:00
minor cs8900 driver clean up
Remove a redundant register definition, clean up some coding style violations. Signed-off-by: Guennadi Liakhovetski <lg@denx.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
This commit is contained in:
parent
dd5748bcd6
commit
13e0b8f7ca
2 changed files with 7 additions and 9 deletions
|
@ -65,14 +65,14 @@ static unsigned short get_reg_init_bus (int regno)
|
||||||
c = CS8900_BUS16_0;
|
c = CS8900_BUS16_0;
|
||||||
|
|
||||||
CS8900_PPTR = regno;
|
CS8900_PPTR = regno;
|
||||||
return (unsigned short) CS8900_PDATA;
|
return CS8900_PDATA;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static unsigned short get_reg (int regno)
|
static unsigned short get_reg (int regno)
|
||||||
{
|
{
|
||||||
CS8900_PPTR = regno;
|
CS8900_PPTR = regno;
|
||||||
return (unsigned short) CS8900_PDATA;
|
return CS8900_PDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ void cs8900_get_enetaddr (uchar * addr)
|
||||||
if (get_reg_init_bus (PP_ChipID) != 0x630e)
|
if (get_reg_init_bus (PP_ChipID) != 0x630e)
|
||||||
return;
|
return;
|
||||||
eth_reset ();
|
eth_reset ();
|
||||||
if ((get_reg (PP_SelfST) & (PP_SelfSTAT_EEPROM | PP_SelfSTAT_EEPROM_OK)) ==
|
if ((get_reg (PP_SelfSTAT) & (PP_SelfSTAT_EEPROM | PP_SelfSTAT_EEPROM_OK)) ==
|
||||||
(PP_SelfSTAT_EEPROM | PP_SelfSTAT_EEPROM_OK)) {
|
(PP_SelfSTAT_EEPROM | PP_SelfSTAT_EEPROM_OK)) {
|
||||||
|
|
||||||
/* Load the MAC from EEPROM */
|
/* Load the MAC from EEPROM */
|
||||||
|
@ -168,7 +168,6 @@ void cs8900_get_enetaddr (uchar * addr)
|
||||||
debug ("### Set environment from HW MAC addr = \"%s\"\n", ethaddr);
|
debug ("### Set environment from HW MAC addr = \"%s\"\n", ethaddr);
|
||||||
setenv ("ethaddr", ethaddr);
|
setenv ("ethaddr", ethaddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,7 +182,6 @@ void eth_halt (void)
|
||||||
|
|
||||||
int eth_init (bd_t * bd)
|
int eth_init (bd_t * bd)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* verify chip id */
|
/* verify chip id */
|
||||||
if (get_reg_init_bus (PP_ChipID) != 0x630e) {
|
if (get_reg_init_bus (PP_ChipID) != 0x630e) {
|
||||||
printf ("CS8900 Ethernet chip not found?!\n");
|
printf ("CS8900 Ethernet chip not found?!\n");
|
||||||
|
@ -201,7 +199,7 @@ int eth_init (bd_t * bd)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get a data block via Ethernet */
|
/* Get a data block via Ethernet */
|
||||||
extern int eth_rx (void)
|
int eth_rx (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned short rxlen;
|
unsigned short rxlen;
|
||||||
|
@ -233,7 +231,7 @@ extern int eth_rx (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send a data block via Ethernet. */
|
/* Send a data block via Ethernet. */
|
||||||
extern int eth_send (volatile void *packet, int length)
|
int eth_send (volatile void *packet, int length)
|
||||||
{
|
{
|
||||||
volatile unsigned short *addr;
|
volatile unsigned short *addr;
|
||||||
int tmo;
|
int tmo;
|
||||||
|
@ -281,7 +279,8 @@ retry:
|
||||||
|
|
||||||
static void cs8900_e2prom_ready(void)
|
static void cs8900_e2prom_ready(void)
|
||||||
{
|
{
|
||||||
while(get_reg(PP_SelfST) & SI_BUSY);
|
while (get_reg(PP_SelfSTAT) & SI_BUSY)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************/
|
/***********************************************************/
|
||||||
|
|
|
@ -243,7 +243,6 @@
|
||||||
|
|
||||||
/* EEPROM Kram */
|
/* EEPROM Kram */
|
||||||
#define SI_BUSY 0x0100
|
#define SI_BUSY 0x0100
|
||||||
#define PP_SelfST 0x0136 /* Self State register */
|
|
||||||
#define PP_EECMD 0x0040 /* NVR Interface Command register */
|
#define PP_EECMD 0x0040 /* NVR Interface Command register */
|
||||||
#define PP_EEData 0x0042 /* NVR Interface Data Register */
|
#define PP_EEData 0x0042 /* NVR Interface Data Register */
|
||||||
#define EEPROM_WRITE_EN 0x00F0
|
#define EEPROM_WRITE_EN 0x00F0
|
||||||
|
|
Loading…
Add table
Reference in a new issue