diff options
author | Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> | 2009-02-25 14:27:24 +0900 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-04-28 00:18:10 +0200 |
commit | d4c02e6f5d49880123e7f584b88f857ffd874381 (patch) | |
tree | 40f22cb79ca2c973ffca60fb077d6b9c3dbe58f2 /drivers | |
parent | 9c48a8ea383098a5b217aba91b6d44cefd5cbeeb (diff) | |
download | bootable_bootloader_goldelico_gta04-d4c02e6f5d49880123e7f584b88f857ffd874381.zip bootable_bootloader_goldelico_gta04-d4c02e6f5d49880123e7f584b88f857ffd874381.tar.gz bootable_bootloader_goldelico_gta04-d4c02e6f5d49880123e7f584b88f857ffd874381.tar.bz2 |
rtl8169: fix cache coherency problem
Fix the problem that cannot access actual data when CPU data cache enabled.
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Tested-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Acked-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/rtl8169.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c index f8c14b4..83a05b4 100644 --- a/drivers/net/rtl8169.c +++ b/drivers/net/rtl8169.c @@ -420,6 +420,8 @@ static int rtl_recv(struct eth_device *dev) ioaddr = dev->iobase; cur_rx = tpc->cur_rx; + flush_cache((unsigned long)&tpc->RxDescArray[cur_rx], + sizeof(struct RxDesc)); if ((le32_to_cpu(tpc->RxDescArray[cur_rx].status) & OWNbit) == 0) { if (!(le32_to_cpu(tpc->RxDescArray[cur_rx].status) & RxRES)) { unsigned char rxdata[RX_BUF_LEN]; @@ -437,6 +439,8 @@ static int rtl_recv(struct eth_device *dev) cpu_to_le32(OWNbit + RX_BUF_SIZE); tpc->RxDescArray[cur_rx].buf_addr = cpu_to_le32((unsigned long)tpc->RxBufferRing[cur_rx]); + flush_cache((unsigned long)tpc->RxBufferRing[cur_rx], + RX_BUF_SIZE); } else { puts("Error Rx"); } @@ -478,6 +482,7 @@ static int rtl_send(struct eth_device *dev, volatile void *packet, int length) /* point to the current txb incase multiple tx_rings are used */ ptxb = tpc->Tx_skbuff[entry * MAX_ETH_FRAME_SIZE]; memcpy(ptxb, (char *)packet, (int)length); + flush_cache((unsigned long)ptxb, length); while (len < ETH_ZLEN) ptxb[len++] = '\0'; @@ -497,7 +502,10 @@ static int rtl_send(struct eth_device *dev, volatile void *packet, int length) tpc->cur_tx++; to = currticks() + TX_TIMEOUT; - while ((le32_to_cpu(tpc->TxDescArray[entry].status) & OWNbit) + do { + flush_cache((unsigned long)&tpc->TxDescArray[entry], + sizeof(struct TxDesc)); + } while ((le32_to_cpu(tpc->TxDescArray[entry].status) & OWNbit) && (currticks() < to)); /* wait */ if (currticks() >= to) { @@ -639,6 +647,7 @@ static void rtl8169_init_ring(struct eth_device *dev) tpc->RxBufferRing[i] = &rxb[i * RX_BUF_SIZE]; tpc->RxDescArray[i].buf_addr = cpu_to_le32((unsigned long)tpc->RxBufferRing[i]); + flush_cache((unsigned long)tpc->RxBufferRing[i], RX_BUF_SIZE); } #ifdef DEBUG_RTL8169 |