#include "cs8900.h"
#include <net.h>
-#ifdef CONFIG_DRIVER_CS8900
-
-#if defined(CONFIG_CMD_NET)
-
#undef DEBUG
/* packet page register access functions */
c = CS8900_BUS16_0;
CS8900_PPTR = regno;
- return (unsigned short) CS8900_PDATA;
+ return CS8900_PDATA;
}
#endif
static unsigned short get_reg (int regno)
{
CS8900_PPTR = regno;
- return (unsigned short) CS8900_PDATA;
+ return CS8900_PDATA;
}
udelay (200000);
/* Wait until the chip is reset */
- tmo = get_timer (0) + 1 * CFG_HZ;
+ tmo = get_timer (0) + 1 * CONFIG_SYS_HZ;
while ((((us = get_reg_init_bus (PP_SelfSTAT)) & PP_SelfSTAT_InitD) == 0)
&& tmo < get_timer (0))
/*NOP*/;
if (get_reg_init_bus (PP_ChipID) != 0x630e)
return;
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)) {
/* Load the MAC from EEPROM */
addr[0], addr[1],
addr[2], addr[3],
addr[4], addr[5]) ;
- debug ("### Set environment from HW MAC addr = \"%s\"\n", ethaddr);
+ debug ("### Set environment from HW MAC addr = \"%s\"\n", ethaddr);
setenv ("ethaddr", ethaddr);
}
-
}
}
int eth_init (bd_t * bd)
{
-
/* verify chip id */
if (get_reg_init_bus (PP_ChipID) != 0x630e) {
printf ("CS8900 Ethernet chip not found?!\n");
}
/* Get a data block via Ethernet */
-extern int eth_rx (void)
+int eth_rx (void)
{
int i;
unsigned short rxlen;
}
/* 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;
int tmo;
#ifdef DEBUG
printf ("cs: unable to send packet; retrying...\n");
#endif
- for (tmo = get_timer (0) + 5 * CFG_HZ; get_timer (0) < tmo;)
+ for (tmo = get_timer (0) + 5 * CONFIG_SYS_HZ; get_timer (0) < tmo;)
/*NOP*/;
eth_reset ();
eth_reginit ();
CS8900_RTDATA = *addr++;
/* wait for transfer to succeed */
- tmo = get_timer (0) + 5 * CFG_HZ;
+ tmo = get_timer (0) + 5 * CONFIG_SYS_HZ;
while ((s = get_reg (PP_TER) & ~0x1F) == 0) {
if (get_timer (0) >= tmo)
break;
static void cs8900_e2prom_ready(void)
{
- while(get_reg(PP_SelfST) & SI_BUSY);
+ while (get_reg(PP_SelfSTAT) & SI_BUSY)
+ ;
}
/***********************************************************/
return 0;
}
-
-#endif /* COMMANDS & CFG_NET */
-
-#endif /* CONFIG_DRIVER_CS8900 */