diff options
author | Wolfgang Denk <wd@denx.de> | 2007-09-10 23:21:16 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2007-09-10 23:21:16 +0200 |
commit | 978aec12faffb4bb8d887894fffd16960356b343 (patch) | |
tree | b567826f38444f928051f4c9f9a5c600751134c5 | |
parent | 38c1ef728d19950414a8ab1ccfc53767848fa346 (diff) | |
parent | 7a888d6b3c32a126dbb504ef146bb4c26574ca7b (diff) | |
download | u-boot-imx-978aec12faffb4bb8d887894fffd16960356b343.zip u-boot-imx-978aec12faffb4bb8d887894fffd16960356b343.tar.gz u-boot-imx-978aec12faffb4bb8d887894fffd16960356b343.tar.bz2 |
Merge with /home/raj/git/u-boot#ads5121_fec_optimize
-rw-r--r-- | cpu/mpc512x/fec.c | 8 | ||||
-rw-r--r-- | cpu/mpc512x/fec.h | 7 |
2 files changed, 9 insertions, 6 deletions
diff --git a/cpu/mpc512x/fec.c b/cpu/mpc512x/fec.c index 8104576..675b7a2 100644 --- a/cpu/mpc512x/fec.c +++ b/cpu/mpc512x/fec.c @@ -32,7 +32,7 @@ int fec512x_miiphy_read(char *devname, uint8 phyAddr, uint8 regAddr, uint16 * re int fec512x_miiphy_write(char *devname, uint8 phyAddr, uint8 regAddr, uint16 data); int mpc512x_fec_init_phy(struct eth_device *dev, bd_t * bis); -static uchar rx_buff[FEC_MAX_PKT_SIZE]; +static uchar rx_buff[FEC_BUFFER_SIZE]; static int rx_buff_idx = 0; /********************************************************************/ @@ -237,8 +237,8 @@ static int mpc512x_fec_init (struct eth_device *dev, bd_t * bis) /* Set Opcode/Pause Duration Register */ fec->eth->op_pause = 0x00010020; - /* Frame length=1518; MII mode */ - fec->eth->r_cntrl = 0x05ee0024; + /* Frame length=1522; MII mode */ + fec->eth->r_cntrl = (FEC_MAX_FRAME_LEN << 16) | 0x24; /* Half-duplex, heartbeat disabled */ fec->eth->x_cntrl = 0x00000000; @@ -248,7 +248,7 @@ static int mpc512x_fec_init (struct eth_device *dev, bd_t * bis) /* Setup recv fifo start and buff size */ fec->eth->r_fstart = 0x500; - fec->eth->r_buff_size = 0x5e0; + fec->eth->r_buff_size = FEC_BUFFER_SIZE; /* Setup BD base addresses */ fec->eth->r_des_start = (uint32)fec->bdBase->rbd; diff --git a/cpu/mpc512x/fec.h b/cpu/mpc512x/fec.h index d2d877a..9c38502 100644 --- a/cpu/mpc512x/fec.h +++ b/cpu/mpc512x/fec.h @@ -164,10 +164,13 @@ typedef enum { #define FEC_RBD_NUM 32 /* The user can adjust this value */ /* packet size limit */ -#define FEC_MAX_PKT_SIZE 1536 +#define FEC_MAX_FRAME_LEN 1522 /* recommended default value */ + +/* Buffer size must be evenly divisible by 16 */ +#define FEC_BUFFER_SIZE ((FEC_MAX_FRAME_LEN + 0x10) & (~0xf)) typedef struct { - uint8 frame[FEC_MAX_PKT_SIZE]; + uint8 frame[FEC_BUFFER_SIZE]; } mpc512x_frame; typedef struct { |