diff options
author | TsiChung <tcliew@Goku.(none)> | 2007-07-10 15:45:43 -0500 |
---|---|---|
committer | John Rigby <jrigby@freescale.com> | 2007-07-10 14:29:10 -0600 |
commit | 0dca874db62718e41253659e60f3a1de7eb418ce (patch) | |
tree | 358165147025f019ff3b71149749b46dd44fd717 /drivers/net/mcffec.c | |
parent | 52b017604a8f4d4a795880ef6e7861d7f2f1b005 (diff) | |
download | u-boot-imx-0dca874db62718e41253659e60f3a1de7eb418ce.zip u-boot-imx-0dca874db62718e41253659e60f3a1de7eb418ce.tar.gz u-boot-imx-0dca874db62718e41253659e60f3a1de7eb418ce.tar.bz2 |
Cache update and added CFG_UNIFY_CACHE
Enabled cache in cpu_init_f() for faster flash to mem allocation. Updated cache handling in start.S. Applied cache invalidate in fec_send() and fec_recv(). Added CFG_UNIFY_CACHE for CF V3 only.
Signed-off-by: TsiChung <tcliew@Goku.(none)>
Diffstat (limited to 'drivers/net/mcffec.c')
-rw-r--r-- | drivers/net/mcffec.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c index 609210d..11f6721 100644 --- a/drivers/net/mcffec.c +++ b/drivers/net/mcffec.c @@ -150,23 +150,15 @@ int fec_send(struct eth_device *dev, volatile void *packet, int length) * Wait for ready */ j = 0; -#if (CONFIG_COMMANDS & CFG_CMD_CACHE) - icache_invalid(); -#endif while ((info->txbd[info->txIdx].cbd_sc & BD_ENET_TX_READY) && (j < MCFFEC_TOUT_LOOP)) { udelay(1); j++; -#if (CONFIG_COMMANDS & CFG_CMD_CACHE) - icache_invalid(); -#endif } if (j >= MCFFEC_TOUT_LOOP) { printf("TX not ready\n"); } -#if (CONFIG_COMMANDS & CFG_CMD_CACHE) - icache_invalid(); -#endif + info->txbd[info->txIdx].cbd_bufaddr = (uint) packet; info->txbd[info->txIdx].cbd_datlen = length; info->txbd[info->txIdx].cbd_sc |= BD_ENET_TX_RDY_LST; @@ -174,21 +166,19 @@ int fec_send(struct eth_device *dev, volatile void *packet, int length) /* Activate transmit Buffer Descriptor polling */ fecp->tdar = 0x01000000; /* Descriptor polling active */ - j = 0; -#if (CONFIG_COMMANDS & CFG_CMD_CACHE) +#ifdef CFG_UNIFY_CACHE icache_invalid(); #endif + j = 0; while ((info->txbd[info->txIdx].cbd_sc & BD_ENET_TX_READY) && (j < MCFFEC_TOUT_LOOP)) { udelay(1); j++; -#if (CONFIG_COMMANDS & CFG_CMD_CACHE) - icache_invalid(); -#endif } if (j >= MCFFEC_TOUT_LOOP) { printf("TX timeout\n"); } + #ifdef ET_DEBUG printf("%s[%d] %s: cycles: %d status: %x retry cnt: %d\n", __FILE__, __LINE__, __FUNCTION__, j, @@ -196,10 +186,7 @@ int fec_send(struct eth_device *dev, volatile void *packet, int length) (info->txbd[info->txIdx].cbd_sc & 0x003C) >> 2); #endif - /* return only status bits */ ; -#if (CONFIG_COMMANDS & CFG_CMD_CACHE) - icache_invalid(); -#endif + /* return only status bits */ rc = (info->txbd[info->txIdx].cbd_sc & BD_ENET_TX_STATS); info->txIdx = (info->txIdx + 1) % TX_BUF_CNT; @@ -213,6 +200,9 @@ int fec_recv(struct eth_device *dev) int length; for (;;) { +#ifdef CFG_UNIFY_CACHE + icache_invalid(); +#endif /* section 16.9.23.2 */ if (info->rxbd[info->rxIdx].cbd_sc & BD_ENET_RX_EMPTY) { length = -1; |