changeset 903:59e96106029e

* 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
author jlarmour
date Fri, 04 Apr 2003 04:23:53 +0000
parents 5ede1532afc0
children ded614f6b946
files packages/devs/flash/intel/strata/current/ChangeLog packages/devs/flash/intel/strata/current/src/flash_erase_block.c packages/devs/flash/intel/strata/current/src/flash_lock_block.c packages/devs/flash/intel/strata/current/src/flash_program_buf.c packages/devs/flash/intel/strata/current/src/flash_query.c packages/devs/flash/intel/strata/current/src/flash_unlock_block.c
diffstat 6 files changed, 9 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/flash/intel/strata/current/ChangeLog
+++ b/packages/devs/flash/intel/strata/current/ChangeLog
@@ -1,3 +1,12 @@
+2002-04-03  Jani Monoses <jani@iv.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@redhat.com>
 
 	* src/flash_unlock_block.c: Add synchronous strataflash support.
--- a/packages/devs/flash/intel/strata/current/src/flash_erase_block.c
+++ b/packages/devs/flash/intel/strata/current/src/flash_erase_block.c
@@ -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 @@ int flash_erase_block(volatile flash_t *
     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);
@@ -122,9 +114,5 @@ int flash_erase_block(volatile flash_t *
         if (len == 0) stat = 0;
     }
 
-    if (cache_on) {
-        HAL_DCACHE_ENABLE();
-    }
-
     return stat;
 }
--- a/packages/devs/flash/intel/strata/current/src/flash_lock_block.c
+++ b/packages/devs/flash/intel/strata/current/src/flash_lock_block.c
@@ -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 @@ flash_lock_block(volatile flash_t *block
     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;
 
@@ -90,9 +82,5 @@ flash_lock_block(volatile flash_t *block
     // Restore ROM to "normal" mode
     ROM[0] = FLASH_Reset;
 
-    if (cache_on) {
-        HAL_DCACHE_ENABLE();
-    }
-
     return stat;
 }
--- a/packages/devs/flash/intel/strata/current/src/flash_program_buf.c
+++ b/packages/devs/flash/intel/strata/current/src/flash_program_buf.c
@@ -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 @@ flash_program_buf(volatile flash_t *addr
     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 );
@@ -164,9 +156,5 @@ flash_program_buf(volatile flash_t *addr
  bad:
     ROM[0] = FLASH_Reset;            
 
-    if (cache_on) {
-        HAL_DCACHE_ENABLE();
-    }
-
     return stat;
 }
--- a/packages/devs/flash/intel/strata/current/src/flash_query.c
+++ b/packages/devs/flash/intel/strata/current/src/flash_query.c
@@ -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 @@ flash_query(unsigned char *data)
 {
     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 );
@@ -105,9 +97,5 @@ flash_query(unsigned char *data)
     }
     ROM[0] = FLASH_Reset;
 
-    if (cache_on) {
-        HAL_DCACHE_ENABLE();
-    }
-
     return 0;
 }
--- a/packages/devs/flash/intel/strata/current/src/flash_unlock_block.c
+++ b/packages/devs/flash/intel/strata/current/src/flash_unlock_block.c
@@ -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 @@ flash_unlock_block(volatile flash_t *blo
     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);
@@ -148,9 +140,5 @@ flash_unlock_block(volatile flash_t *blo
     // Restore ROM to "normal" mode
     ROM[0] = FLASH_Reset;
 
-    if (cache_on) {
-        HAL_DCACHE_ENABLE();
-    }
-
     return stat;
 }