X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=arch%2Fpowerpc%2Fcpu%2Fmpc8220%2Ffec.c;h=43fa802ca96db0a5a4e6f0542fb5873877d3ecd5;hb=d828a16ba1f62bdab21d2a7c6bc13c94d019f96f;hp=5df973533287955839ffafb7991a8d17fe720a7f;hpb=922d27b596c179c5a7d68abe45ede5adb1b6589c;p=karo-tx-uboot.git diff --git a/arch/powerpc/cpu/mpc8220/fec.c b/arch/powerpc/cpu/mpc8220/fec.c index 5df9735332..43fa802ca9 100644 --- a/arch/powerpc/cpu/mpc8220/fec.c +++ b/arch/powerpc/cpu/mpc8220/fec.c @@ -15,8 +15,7 @@ #include "fec.h" #undef DEBUG -#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI) && \ - defined(CONFIG_MPC8220_FEC) +#if defined(CONFIG_CMD_NET) && defined(CONFIG_MPC8220_FEC) #if !(defined(CONFIG_MII) || defined(CONFIG_CMD_MII)) #error "CONFIG_MII has to be defined!" @@ -34,8 +33,8 @@ typedef struct { u8 head[16]; /* MAC header(6 + 6 + 2) + 2(aligned) */ } NBUF; -int fec8220_miiphy_read (char *devname, u8 phyAddr, u8 regAddr, u16 * retVal); -int fec8220_miiphy_write (char *devname, u8 phyAddr, u8 regAddr, u16 data); +int fec8220_miiphy_read (const char *devname, u8 phyAddr, u8 regAddr, u16 *retVal); +int fec8220_miiphy_write (const char *devname, u8 phyAddr, u8 regAddr, u16 data); /********************************************************************/ #ifdef DEBUG @@ -289,9 +288,11 @@ static int mpc8220_fec_init (struct eth_device *dev, bd_t * bis) * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock * and do not drop the Preamble. */ - /* tbd - rtm */ - /*fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); */ - /* No MII for 7-wire mode */ + /* + * tbd - rtm + * fec->eth->mii_speed = (((gd->arch.ipb_clk >> 20) / 5) << 1); + * No MII for 7-wire mode + */ fec->eth->mii_speed = 0x00000030; } @@ -625,7 +626,7 @@ static void rfifo_print (char *devname, mpc8220_fec_priv * fec) /********************************************************************/ -static int mpc8220_fec_send (struct eth_device *dev, volatile void *eth_data, +static int mpc8220_fec_send(struct eth_device *dev, void *eth_data, int data_length) { /* @@ -773,8 +774,8 @@ static int mpc8220_fec_recv (struct eth_device *dev) frame = (NBUF *) pRbd->dataPointer; frame_length = pRbd->dataLength - 4; -#if (0) - { + /* DEBUG code */ + if (_DEBUG) { int i; printf ("recv data hdr:"); @@ -782,14 +783,13 @@ static int mpc8220_fec_recv (struct eth_device *dev) printf ("%x ", *(frame->head + i)); printf ("\n"); } -#endif + /* * Fill the buffer and pass it to upper layers */ /* memcpy(buff, frame->head, 14); memcpy(buff + 14, frame->data, frame_length);*/ - NetReceive ((volatile uchar *) pRbd->dataPointer, - frame_length); + NetReceive((uchar *)pRbd->dataPointer, frame_length); len = frame_length; } /* @@ -840,7 +840,7 @@ int mpc8220_fec_initialize (bd_t * bis) dev->send = mpc8220_fec_send; dev->recv = mpc8220_fec_recv; - sprintf (dev->name, "FEC ETHERNET"); + sprintf (dev->name, "FEC"); eth_register (dev); #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) @@ -881,7 +881,7 @@ int mpc8220_fec_initialize (bd_t * bis) /* MII-interface related functions */ /********************************************************************/ -int fec8220_miiphy_read (char *devname, u8 phyAddr, u8 regAddr, u16 * retVal) +int fec8220_miiphy_read (const char *devname, u8 phyAddr, u8 regAddr, u16 *retVal) { ethernet_regs *eth = (ethernet_regs *) MMAP_FEC1; u32 reg; /* convenient holder for the PHY register */ @@ -925,7 +925,7 @@ int fec8220_miiphy_read (char *devname, u8 phyAddr, u8 regAddr, u16 * retVal) } /********************************************************************/ -int fec8220_miiphy_write (char *devname, u8 phyAddr, u8 regAddr, u16 data) +int fec8220_miiphy_write(const char *devname, u8 phyAddr, u8 regAddr, u16 data) { ethernet_regs *eth = (ethernet_regs *) MMAP_FEC1; u32 reg; /* convenient holder for the PHY register */