diff options
author | wdenk <wdenk> | 2003-06-27 21:31:46 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2003-06-27 21:31:46 +0000 |
commit | 8bde7f776c77b343aca29b8c7b58464d915ac245 (patch) | |
tree | 20f1fd99975215e7c658454a15cdb4ed4694e2d4 /drivers/plb2800_eth.c | |
parent | 993cad9364c6b87ae429d1ed1130d8153f6f027e (diff) | |
download | u-boot-8bde7f776c77b343aca29b8c7b58464d915ac245.tar.gz u-boot-8bde7f776c77b343aca29b8c7b58464d915ac245.tar.xz u-boot-8bde7f776c77b343aca29b8c7b58464d915ac245.zip |
* Code cleanup:LABEL_2003_06_27_2340
- remove trailing white space, trailing empty lines, C++ comments, etc.
- split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)
* Patches by Kenneth Johansson, 25 Jun 2003:
- major rework of command structure
(work done mostly by Michal Cendrowski and Joakim Kristiansen)
Diffstat (limited to 'drivers/plb2800_eth.c')
-rw-r--r-- | drivers/plb2800_eth.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/plb2800_eth.c b/drivers/plb2800_eth.c index 7c7f9f8bfa..4c683d7a5c 100644 --- a/drivers/plb2800_eth.c +++ b/drivers/plb2800_eth.c @@ -57,7 +57,7 @@ #define MBOX_STAT_MB 0x00000001 #define EN_MA_LEARN 0x02000000 #define EN_DA_LKUP 0x01000000 -#define MA_DEST_SHF 11 +#define MA_DEST_SHF 11 #define DA_DEST_SHF 11 #define DA_STATE_SHF 19 #define TSTAMP_MS 0x00000000 @@ -121,23 +121,23 @@ int plb2800_eth_initialize(bd_t * bis) eth_register(dev); - /* bug fix */ - *(ulong *)0xb800e800 = 0x838; + /* bug fix */ + *(ulong *)0xb800e800 = 0x838; /* Set MBOX ownership */ temp = CMAC_CRIT << MBOX_STAT_ID_SHF; MBOX_REG(0)->stat = temp; MBOX_REG(1)->stat = temp; - temp = CMAC_NON_CRIT << MBOX_STAT_ID_SHF; + temp = CMAC_NON_CRIT << MBOX_STAT_ID_SHF; MBOX_REG(2)->stat = temp; MBOX_REG(3)->stat = temp; - + plb2800_set_mac_addr(dev, plb2800_get_mac_addr()); /* Disable all Mbox interrupt */ temp = MIPS_H_MASK; - temp &= ~ (SW_H_MBOX1_MASK | SW_H_MBOX2_MASK | SW_H_MBOX3_MASK | SW_H_MBOX4_MASK) ; + temp &= ~ (SW_H_MBOX1_MASK | SW_H_MBOX2_MASK | SW_H_MBOX3_MASK | SW_H_MBOX4_MASK) ; MIPS_H_MASK = temp; #ifdef DEBUG @@ -222,7 +222,7 @@ static int plb2800_eth_send(struct eth_device *dev, volatile void *packet, CMAC_CRX_CTRL = temp; mb->cmd = MBOX_STAT_CP; - + #ifdef DEBUG printf("2 mb->stat = 0x%x\n", mb->stat); #endif @@ -257,7 +257,7 @@ static int plb2800_eth_recv(struct eth_device *dev) { break; } - + length = ((*(hdr + 6) & 0x3f) << 8) + *(hdr + 7); memcpy((void *)NetRxPackets[rx_new], hdr + 12, length); @@ -323,13 +323,13 @@ static void plb2800_set_mac_addr(struct eth_device *dev, unsigned char * addr) { return; } - + /* send one packet through CPU port * in order to learn system MAC address - */ + */ /* Set DA_LOOKUP register */ - temp = EN_MA_LEARN | (0 << DA_STATE_SHF) | (63 << DA_DEST_SHF); + temp = EN_MA_LEARN | (0 << DA_STATE_SHF) | (63 << DA_DEST_SHF); DA_LOOKUP = temp; /* Set MA_LEARN register */ @@ -339,7 +339,7 @@ static void plb2800_set_mac_addr(struct eth_device *dev, unsigned char * addr) /* set destination address */ for (ix=0;ix<6;ix++) packet[ix] = 0xff; - + /* set source address = system MAC address */ for (ix=0;ix<6;ix++) packet[6+ix] = addr[ix]; @@ -351,7 +351,7 @@ static void plb2800_set_mac_addr(struct eth_device *dev, unsigned char * addr) /* set data field */ for(ix=14;ix<60;ix++) packet[ix] = 0x00; - + #ifdef DEBUG for (ix=0;ix<6;ix++) printf("mac_addr[%d]=%02X\n", ix, (unsigned char)packet[6+ix]); @@ -364,10 +364,10 @@ static void plb2800_set_mac_addr(struct eth_device *dev, unsigned char * addr) for(ix=0;ix<65535;ix++) temp = ~temp; - /* Set CMAC_CTX_CTRL register */ + /* Set CMAC_CTX_CTRL register */ temp = TSTAMP_MS; /* no autocast */ CMAC_CTX_CTRL = temp; - + /* Set DA_LOOKUP register */ temp = EN_DA_LKUP; DA_LOOKUP = temp; @@ -380,10 +380,10 @@ static unsigned char * plb2800_get_mac_addr(void) static unsigned char addr[6]; char *tmp, *end; int i; - + tmp = getenv ("ethaddr"); if (NULL == tmp) return NULL; - + for (i=0; i<6; i++) { addr[i] = tmp ? simple_strtoul(tmp, &end, 16) : 0; if (tmp) |