# HG changeset patch # User jlarmour # Date 1050115299 0 # Node ID 0e713ca5bb8b2f1fc9df8a7d4c92139acabd4c66 # Parent 249dd9889974f25c1865122fcfe6daf2974a3a2c * 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 diff --git a/packages/devs/flash/arm/iq80310/current/ChangeLog b/packages/devs/flash/arm/iq80310/current/ChangeLog --- 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 + + * 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 * cdl/flash_iq80310.cdl: New Xscale platforms layout. diff --git a/packages/devs/flash/arm/iq80310/current/src/flash_erase_block.c b/packages/devs/flash/arm/iq80310/current/src/flash_erase_block.c --- 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 #include -#include // // 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; } diff --git a/packages/devs/flash/arm/iq80310/current/src/flash_lock_block.c b/packages/devs/flash/arm/iq80310/current/src/flash_lock_block.c --- 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 // // 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; } diff --git a/packages/devs/flash/arm/iq80310/current/src/flash_program_buf.c b/packages/devs/flash/arm/iq80310/current/src/flash_program_buf.c --- 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 #include -#include // // 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; } diff --git a/packages/devs/flash/arm/iq80310/current/src/flash_query.c b/packages/devs/flash/arm/iq80310/current/src/flash_query.c --- 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 #include -#include #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; } diff --git a/packages/devs/flash/arm/iq80310/current/src/flash_unlock_block.c b/packages/devs/flash/arm/iq80310/current/src/flash_unlock_block.c --- 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 // // 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; }