summaryrefslogtreecommitdiffstats
path: root/cpu/ppc4xx
diff options
context:
space:
mode:
authorMatthias Fuchs <matthias.fuchs@esd-electronics.com>2007-11-09 15:36:44 +0100
committerStefan Roese <sr@denx.de>2007-11-09 16:42:15 +0100
commitfbde2169d2c48fcc9ff03489534a78ffb0a8a0d4 (patch)
tree95b5f82ac3145e0ed63e03a3d9f926feb29984b5 /cpu/ppc4xx
parentb53313dbfc74525d85f1e7e0102f902d5c863beb (diff)
downloadtalos-obmc-uboot-fbde2169d2c48fcc9ff03489534a78ffb0a8a0d4.tar.gz
talos-obmc-uboot-fbde2169d2c48fcc9ff03489534a78ffb0a8a0d4.zip
ppc4xx: Remove redundant code from 4xx network driver
This patch removes some redundant code and decrements the end address of cache flush and invalidate by 1. Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'cpu/ppc4xx')
-rw-r--r--cpu/ppc4xx/4xx_enet.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/cpu/ppc4xx/4xx_enet.c b/cpu/ppc4xx/4xx_enet.c
index c08bf61e48..c20dc730ef 100644
--- a/cpu/ppc4xx/4xx_enet.c
+++ b/cpu/ppc4xx/4xx_enet.c
@@ -849,9 +849,7 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
}
#ifdef CONFIG_4xx_DCACHE
- flush_dcache_range(bd_cached, bd_cached + MAL_ALLOC_SIZE);
- hw_p->tx_phys = bd_cached;
- hw_p->rx_phys = bd_cached + MAL_TX_DESC_SIZE;
+ flush_dcache_range(bd_cached, bd_cached + MAL_ALLOC_SIZE - 1);
bd_uncached = bis->bi_memsize;
program_tlb(bd_cached, bd_uncached, MAL_ALLOC_SIZE,
TLB_WORD2_I_ENABLE);
@@ -1066,7 +1064,7 @@ static int ppc_4xx_eth_send (struct eth_device *dev, volatile void *ptr,
/* memcpy ((void *) &tx_buff[tx_slot], (const void *) ptr, len); */
memcpy ((void *) hw_p->txbuf_ptr, (const void *) ptr, len);
- flush_dcache_range((u32)hw_p->txbuf_ptr, (u32)hw_p->txbuf_ptr + len);
+ flush_dcache_range((u32)hw_p->txbuf_ptr, (u32)hw_p->txbuf_ptr + len - 1);
/*-----------------------------------------------------------------------+
* set TX Buffer busy, and send it
@@ -1568,7 +1566,7 @@ static int ppc_4xx_eth_rx (struct eth_device *dev)
/* NetReceive(NetRxPackets[i], length); */
invalidate_dcache_range((u32)hw_p->rx[user_index].data_ptr,
(u32)hw_p->rx[user_index].data_ptr +
- length - 4);
+ length - 4 - 1);
NetReceive (NetRxPackets[user_index], length - 4);
/* Free Recv Buffer */
hw_p->rx[user_index].ctrl |= MAL_RX_CTRL_EMPTY;
OpenPOWER on IntegriCloud