Mercurial > ecos
changeset 938:0e713ca5bb8b
* 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 | Sat, 12 Apr 2003 02:41:39 +0000 |
| parents | 249dd9889974 |
| children | 3f3c556ac977 |
| files | packages/devs/flash/arm/iq80310/current/ChangeLog packages/devs/flash/arm/iq80310/current/src/flash_erase_block.c packages/devs/flash/arm/iq80310/current/src/flash_lock_block.c packages/devs/flash/arm/iq80310/current/src/flash_program_buf.c packages/devs/flash/arm/iq80310/current/src/flash_query.c packages/devs/flash/arm/iq80310/current/src/flash_unlock_block.c |
| diffstat | 6 files changed, 11 insertions(+), 61 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/devs/flash/arm/iq80310/current/ChangeLog +++ b/packages/devs/flash/arm/iq80310/current/ChangeLog @@ -1,3 +1,12 @@ +2002-04-04 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-11-12 Gary Thomas <gary@mlbassoc.com> * cdl/flash_iq80310.cdl: New Xscale platforms layout.
--- a/packages/devs/flash/arm/iq80310/current/src/flash_erase_block.c +++ b/packages/devs/flash/arm/iq80310/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,8 @@ int flash_erase_block(volatile unsigned volatile unsigned char *ROM; unsigned short stat; int timeout = 50000; - int cache_on; int len; - HAL_DCACHE_IS_ENABLED(cache_on); - if (cache_on) { - HAL_DCACHE_SYNC(); - HAL_DCACHE_DISABLE(); - } - - // First 4K page of flash at physcial address zero is // virtually mapped to address 0xa0000000. ROM = FLASH_P2V((unsigned)block & 0xFF800000); @@ -106,9 +97,5 @@ int flash_erase_block(volatile unsigned if (len == 0) stat = 0; } - if (cache_on) { - HAL_DCACHE_ENABLE(); - } - return stat; }
--- a/packages/devs/flash/arm/iq80310/current/src/flash_lock_block.c +++ b/packages/devs/flash/arm/iq80310/current/src/flash_lock_block.c @@ -52,7 +52,6 @@ #include "flash.h" -#include <cyg/hal/hal_cache.h> // // CAUTION! This code must be copied to RAM before execution. Therefore, @@ -65,16 +64,9 @@ flash_lock_block(volatile unsigned char volatile unsigned char *ROM; unsigned short stat; int timeout = 5000000; - int cache_on; ROM = FLASH_P2V((unsigned long)block & 0xFF800000); - HAL_DCACHE_IS_ENABLED(cache_on); - if (cache_on) { - HAL_DCACHE_SYNC(); - HAL_DCACHE_DISABLE(); - } - // Clear any error conditions ROM[0] = FLASH_Clear_Status; @@ -88,9 +80,5 @@ flash_lock_block(volatile unsigned char // Restore ROM to "normal" mode ROM[0] = FLASH_Reset; - if (cache_on) { - HAL_DCACHE_ENABLE(); - } - return stat; }
--- a/packages/devs/flash/arm/iq80310/current/src/flash_program_buf.c +++ b/packages/devs/flash/arm/iq80310/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, @@ -68,13 +67,7 @@ flash_program_buf(volatile unsigned char volatile unsigned char *BA; unsigned short stat; int timeout = 5000000; - int i, wc, cache_on; - - HAL_DCACHE_IS_ENABLED(cache_on); - if (cache_on) { - HAL_DCACHE_SYNC(); - HAL_DCACHE_DISABLE(); - } + int i, wc; ROM = FLASH_P2V((unsigned long)addr & 0xFF800000); BA = FLASH_P2V((unsigned long)addr & 0xFFFE0000); @@ -146,10 +139,6 @@ flash_program_buf(volatile unsigned char bad: ROM[0] = FLASH_Reset; - if (cache_on) { - HAL_DCACHE_ENABLE(); - } - return stat; }
--- a/packages/devs/flash/arm/iq80310/current/src/flash_query.c +++ b/packages/devs/flash/arm/iq80310/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 unsigned short *ROM; int i, cnt; - int cache_on; - - HAL_DCACHE_IS_ENABLED(cache_on); - if (cache_on) { - HAL_DCACHE_SYNC(); - HAL_DCACHE_DISABLE(); - } ROM = FLASH_P2V(0); ROM[0] = FLASH_Read_Query; @@ -86,9 +78,5 @@ flash_query(unsigned char *data) ROM[0] = FLASH_Reset; - if (cache_on) { - HAL_DCACHE_ENABLE(); - } - return 0; }
--- a/packages/devs/flash/arm/iq80310/current/src/flash_unlock_block.c +++ b/packages/devs/flash/arm/iq80310/current/src/flash_unlock_block.c @@ -52,7 +52,6 @@ #include "flash.h" -#include <cyg/hal/hal_cache.h> // // CAUTION! This code must be copied to RAM before execution. Therefore, @@ -76,13 +75,7 @@ flash_unlock_block(volatile unsigned cha unsigned short stat; int timeout = 5000000; unsigned short is_locked[MAX_FLASH_BLOCKS]; - int i, cache_on; - - HAL_DCACHE_IS_ENABLED(cache_on); - if (cache_on) { - HAL_DCACHE_SYNC(); - HAL_DCACHE_DISABLE(); - } + int i; ROM = FLASH_P2V((unsigned long)block & 0xFF800000); @@ -128,9 +121,5 @@ flash_unlock_block(volatile unsigned cha // Restore ROM to "normal" mode ROM[0] = FLASH_Reset; - if (cache_on) { - HAL_DCACHE_ENABLE(); - } - return stat; }
