This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ETH - Fix some cache issues on PowerPC


Index: devs/eth/powerpc/fec/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/eth/powerpc/fec/current/ChangeLog,v
retrieving revision 1.7
diff -u -5 -p -r1.7 ChangeLog
--- devs/eth/powerpc/fec/current/ChangeLog	14 Jun 2002 22:01:41 -0000	1.7
+++ devs/eth/powerpc/fec/current/ChangeLog	9 Aug 2002 00:13:47 -0000
@@ -1,5 +1,10 @@
+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: 
 	Need to include <pkgconf/io_eth_drivers.h> for proper configuration
 	of stand-alone (polled) vs. system (interrupt driven) mode.
Index: devs/eth/powerpc/fec/current/src/if_fec.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/eth/powerpc/fec/current/src/if_fec.c,v
retrieving revision 1.7
diff -u -5 -p -r1.7 if_fec.c
--- devs/eth/powerpc/fec/current/src/if_fec.c	14 Jun 2002 22:01:42 -0000	1.7
+++ devs/eth/powerpc/fec/current/src/if_fec.c	9 Aug 2002 00:12:48 -0000
@@ -640,11 +640,11 @@ fec_eth_RxEvent(struct eth_drv_sc *sc)
 
     // Note: the MPC860 does not seem to snoop/invalidate the data cache properly!
     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;
     while (true) {
         if ((rxbd->ctrl & FEC_BD_Rx_Empty) == 0) {
@@ -663,11 +663,11 @@ fec_eth_RxEvent(struct eth_drv_sc *sc)
     }
     // Remember where we left off
     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
 }
 
Index: devs/eth/powerpc/quicc/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/eth/powerpc/quicc/current/ChangeLog,v
retrieving revision 1.14
diff -u -5 -p -r1.14 ChangeLog
--- devs/eth/powerpc/quicc/current/ChangeLog	14 Jun 2002 22:01:44 -0000	1.14
+++ devs/eth/powerpc/quicc/current/ChangeLog	9 Aug 2002 00:14:45 -0000
@@ -1,5 +1,11 @@
+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: 
 	Need to include <pkgconf/io_eth_drivers.h> for proper configuration
 	of stand-alone (polled) vs. system (interrupt driven) mode.
Index: devs/eth/powerpc/quicc/current/src/if_quicc.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/eth/powerpc/quicc/current/src/if_quicc.c,v
retrieving revision 1.13
diff -u -5 -p -r1.13 if_quicc.c
--- devs/eth/powerpc/quicc/current/src/if_quicc.c	14 Jun 2002 22:01:46 -0000	1.13
+++ devs/eth/powerpc/quicc/current/src/if_quicc.c	9 Aug 2002 00:14:57 -0000
@@ -7,10 +7,11 @@
 //==========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // 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
 // Software Foundation; either version 2 or (at your option) any later version.
 //
@@ -480,11 +481,11 @@ quicc_eth_send(struct eth_drv_sc *sc, st
         bp += sg_list[i].len;
     }
     // 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;
     if (txbd->length < IEEE_8023_MIN_FRAME) {
         ctrl |= QUICC_BD_TX_PAD;


-- 
------------------------------------------------------------
Gary Thomas                  |
eCosCentric, Ltd.            |  
+1 (970) 229-1963            |  eCos & RedBoot experts
gthomas@ecoscentric.com      |
http://www.ecoscentric.com/  |
------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]