changeset 275:c3ec301f39df

Fix some cache flush/invalidate booboos.
author gthomas
date Fri, 09 Aug 2002 00:15:28 +0000
parents 0f9e01c77078
children ca456a5c2de6
files packages/devs/eth/powerpc/fec/current/ChangeLog packages/devs/eth/powerpc/fec/current/src/if_fec.c packages/devs/eth/powerpc/quicc/current/ChangeLog packages/devs/eth/powerpc/quicc/current/src/if_quicc.c
diffstat 4 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/eth/powerpc/fec/current/ChangeLog
+++ b/packages/devs/eth/powerpc/fec/current/ChangeLog
@@ -1,3 +1,8 @@
+2002-08-08  Gary Thomas  <gthomas@ecoscentric.com>
+
+	* src/if_fec.c (fec_eth_RxEvent): Cache needs to be invalidated
+	to avoid any possible corruption.
+
 2002-06-14  Gary Thomas  <gary@chez-thomas.org>
 
 	* src/if_fec.c: 
--- a/packages/devs/eth/powerpc/fec/current/src/if_fec.c
+++ b/packages/devs/eth/powerpc/fec/current/src/if_fec.c
@@ -642,7 +642,7 @@ fec_eth_RxEvent(struct eth_drv_sc *sc)
     HAL_DCACHE_IS_ENABLED(cache_state);
 #ifndef FEC_USE_EPPC_BD
     if (cache_state) {
-        HAL_DCACHE_FLUSH(fec_eth_rxring, sizeof(fec_eth_rxring));  // Make sure no stale data
+        HAL_DCACHE_INVALIDATE(fec_eth_rxring, sizeof(fec_eth_rxring));  // Make sure no stale data
     }
 #endif
     rxbd = rxfirst = qi->rnext;
@@ -665,7 +665,7 @@ fec_eth_RxEvent(struct eth_drv_sc *sc)
     qi->rnext = (struct fec_bd *)rxbd;
 #ifndef FEC_USE_EPPC_BD
     if (cache_state) {
-        HAL_DCACHE_FLUSH(fec_eth_rxring, sizeof(fec_eth_rxring));  // Make sure no stale data
+        HAL_DCACHE_INVALIDATE(fec_eth_rxring, sizeof(fec_eth_rxring));  // Make sure no stale data
     }
 #endif
     qi->fec->RxUpdate = 0x0F0F0F0F;  // Any write tells machine to look for work
--- a/packages/devs/eth/powerpc/quicc/current/ChangeLog
+++ b/packages/devs/eth/powerpc/quicc/current/ChangeLog
@@ -1,3 +1,9 @@
+2002-08-08  Gary Thomas  <gthomas@ecoscentric.com>
+2002-08-08  Luoqi Chen <lchen@onetta.com>
+
+	* src/if_quicc.c (quicc_eth_send): Need to flush cache to force
+	out data, not invalidate it.
+
 2002-06-14  Gary Thomas  <gary@chez-thomas.org>
 
 	* src/if_quicc.c: 
--- a/packages/devs/eth/powerpc/quicc/current/src/if_quicc.c
+++ b/packages/devs/eth/powerpc/quicc/current/src/if_quicc.c
@@ -9,6 +9,7 @@
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2002 Gary Thomas
 //
 // eCos is free software; you can redistribute it and/or modify it under
 // the terms of the GNU General Public License as published by the Free
@@ -482,7 +483,7 @@ quicc_eth_send(struct eth_drv_sc *sc, st
     // Note: the MBX860 does not seem to snoop/invalidate the data cache properly!
     HAL_DCACHE_IS_ENABLED(cache_state);
     if (cache_state) {
-        HAL_DCACHE_INVALIDATE(txbd->buffer, txbd->length);  // Make sure no stale data
+        HAL_DCACHE_FLUSH(txbd->buffer, txbd->length);  // Make sure no stale data
     }
     // Send it on it's way
     ctrl = txbd->ctrl & ~QUICC_BD_TX_PAD;