This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
strata and caches patch
- From: Jani Monoses <jani at iv dot ro>
- To: ecos-patches at sources dot redhat dot com
- Date: Thu, 3 Apr 2003 19:26:04 +0300
- Subject: strata and caches patch
And here is for strataflash
Index: devs/flash/intel/strata//current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/ChangeLog,v
retrieving revision 1.12
diff -u -r1.12 ChangeLog
--- devs/flash/intel/strata//current/ChangeLog 12 Aug 2002 12:20:49 -0000 1.12
+++ devs/flash/intel/strata//current/ChangeLog 3 Apr 2003 16:17:25 -0000
@@ -1,3 +1,12 @@
+2002-04-03 Jani Monoses <jani at iv dot ro>
+
+ * src/flash_lock_block.c (flash_lock_block):
+ * src/flash_unlock_block.c (flash_unlock_block):
+ * src/flash_erase_block.c (flash_erase_block):
+ * src/flash_query.c (flash_query):
+ * src/flash_program_buf.c (flash_program_buf):
+ Cache enabling and disabling are already handled by generic flash
+
2002-08-12 Mark Salter <msalter at redhat dot com>
* src/flash_unlock_block.c: Add synchronous strataflash support.
Index: devs/flash/intel/strata//current/src/flash_erase_block.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/src/flash_erase_block.c,v
retrieving revision 1.4
diff -u -r1.4 flash_erase_block.c
--- devs/flash/intel/strata//current/src/flash_erase_block.c 23 May 2002 23:01:02 -0000 1.4
+++ devs/flash/intel/strata//current/src/flash_erase_block.c 3 Apr 2003 16:17:25 -0000
@@ -54,7 +54,6 @@
#include <pkgconf/hal.h>
#include <cyg/hal/hal_arch.h>
-#include <cyg/hal/hal_cache.h>
//
// CAUTION! This code must be copied to RAM before execution. Therefore,
@@ -66,16 +65,9 @@
volatile flash_t *ROM;
flash_t stat = 0;
int timeout = 50000;
- int cache_on;
int len, block_len, erase_block_size;
volatile flash_t *eb;
- HAL_DCACHE_IS_ENABLED(cache_on);
- if (cache_on) {
- HAL_DCACHE_SYNC();
- HAL_DCACHE_DISABLE();
- }
-
// Get base address and map addresses to virtual addresses
ROM = FLASH_P2V(CYGNUM_FLASH_BASE_MASK & (unsigned int)block);
eb = block = FLASH_P2V(block);
@@ -120,10 +112,6 @@
len -= sizeof(*block);
}
if (len == 0) stat = 0;
- }
-
- if (cache_on) {
- HAL_DCACHE_ENABLE();
}
return stat;
Index: devs/flash/intel/strata//current/src/flash_lock_block.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/src/flash_lock_block.c,v
retrieving revision 1.3
diff -u -r1.3 flash_lock_block.c
--- devs/flash/intel/strata//current/src/flash_lock_block.c 23 May 2002 23:01:02 -0000 1.3
+++ devs/flash/intel/strata//current/src/flash_lock_block.c 3 Apr 2003 16:17:25 -0000
@@ -52,7 +52,6 @@
#include "strata.h"
-#include <cyg/hal/hal_cache.h>
//
// CAUTION! This code must be copied to RAM before execution. Therefore,
@@ -65,18 +64,11 @@
volatile flash_t *ROM;
flash_t stat;
int timeout = 5000000;
- int cache_on;
// Get base address and map addresses to virtual addresses
ROM = FLASH_P2V(CYGNUM_FLASH_BASE_MASK & (unsigned int)block);
block = FLASH_P2V(block);
- HAL_DCACHE_IS_ENABLED(cache_on);
- if (cache_on) {
- HAL_DCACHE_SYNC();
- HAL_DCACHE_DISABLE();
- }
-
// Clear any error conditions
ROM[0] = FLASH_Clear_Status;
@@ -89,10 +81,6 @@
// Restore ROM to "normal" mode
ROM[0] = FLASH_Reset;
-
- if (cache_on) {
- HAL_DCACHE_ENABLE();
- }
return stat;
}
Index: devs/flash/intel/strata//current/src/flash_program_buf.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/src/flash_program_buf.c,v
retrieving revision 1.6
diff -u -r1.6 flash_program_buf.c
--- devs/flash/intel/strata//current/src/flash_program_buf.c 23 May 2002 23:01:02 -0000 1.6
+++ devs/flash/intel/strata//current/src/flash_program_buf.c 3 Apr 2003 16:17:26 -0000
@@ -54,7 +54,6 @@
#include <pkgconf/hal.h>
#include <cyg/hal/hal_arch.h>
-#include <cyg/hal/hal_cache.h>
//
// CAUTION! This code must be copied to RAM before execution. Therefore,
@@ -69,17 +68,10 @@
volatile flash_t *BA;
flash_t stat = 0;
int timeout = 50000;
- int cache_on;
#ifdef FLASH_Write_Buffer
int i, wc;
#endif
- HAL_DCACHE_IS_ENABLED(cache_on);
- if (cache_on) {
- HAL_DCACHE_SYNC();
- HAL_DCACHE_DISABLE();
- }
-
// Get base address and map addresses to virtual addresses
ROM = FLASH_P2V( CYGNUM_FLASH_BASE_MASK & (unsigned int)addr );
BA = FLASH_P2V( block_mask & (unsigned int)addr );
@@ -163,10 +155,6 @@
// Restore ROM to "normal" mode
bad:
ROM[0] = FLASH_Reset;
-
- if (cache_on) {
- HAL_DCACHE_ENABLE();
- }
return stat;
}
Index: devs/flash/intel/strata//current/src/flash_query.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/src/flash_query.c,v
retrieving revision 1.4
diff -u -r1.4 flash_query.c
--- devs/flash/intel/strata//current/src/flash_query.c 23 May 2002 23:01:02 -0000 1.4
+++ devs/flash/intel/strata//current/src/flash_query.c 3 Apr 2003 16:17:27 -0000
@@ -54,7 +54,6 @@
#include <pkgconf/hal.h>
#include <cyg/hal/hal_arch.h>
-#include <cyg/hal/hal_cache.h>
#include CYGHWR_MEMORY_LAYOUT_H
//
@@ -69,13 +68,6 @@
{
volatile flash_t *ROM;
int i, cnt;
- int cache_on;
-
- HAL_DCACHE_IS_ENABLED(cache_on);
- if (cache_on) {
- HAL_DCACHE_SYNC();
- HAL_DCACHE_DISABLE();
- }
// Get base address and map addresses to virtual addresses
ROM = FLASH_P2V( CYGNUM_FLASH_BASE );
@@ -104,10 +96,6 @@
#endif
}
ROM[0] = FLASH_Reset;
-
- if (cache_on) {
- HAL_DCACHE_ENABLE();
- }
return 0;
}
Index: devs/flash/intel/strata//current/src/flash_unlock_block.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/src/flash_unlock_block.c,v
retrieving revision 1.4
diff -u -r1.4 flash_unlock_block.c
--- devs/flash/intel/strata//current/src/flash_unlock_block.c 12 Aug 2002 12:20:50 -0000 1.4
+++ devs/flash/intel/strata//current/src/flash_unlock_block.c 3 Apr 2003 16:17:27 -0000
@@ -52,7 +52,6 @@
#include "strata.h"
-#include <cyg/hal/hal_cache.h>
//
// CAUTION! This code must be copied to RAM before execution. Therefore,
@@ -75,19 +74,12 @@
volatile flash_t *ROM;
flash_t stat;
int timeout = 5000000;
- int cache_on;
#ifndef CYGOPT_FLASH_IS_SYNCHRONOUS
int i;
volatile flash_t *bp, *bpv;
unsigned char is_locked[MAX_FLASH_BLOCKS];
#endif
- HAL_DCACHE_IS_ENABLED(cache_on);
- if (cache_on) {
- HAL_DCACHE_SYNC();
- HAL_DCACHE_DISABLE();
- }
-
// Get base address and map addresses to virtual addresses
ROM = FLASH_P2V( CYGNUM_FLASH_BASE_MASK & (unsigned int)block );
block = FLASH_P2V(block);
@@ -147,10 +139,6 @@
// Restore ROM to "normal" mode
ROM[0] = FLASH_Reset;
-
- if (cache_on) {
- HAL_DCACHE_ENABLE();
- }
return stat;
}