This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
iq80310 flash
- From: Jani Monoses <jani at iv dot ro>
- To: ecos-patches at sources dot redhat dot com
- Date: Fri, 4 Apr 2003 11:20:50 +0300
- Subject: iq80310 flash
and for the iq80310.
the two remaining drivers are edb which will use the strata soon and the
at91 which will probably be reworked anyway by the big at91 patch
Index: devs/flash/arm/iq80310//current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/iq80310/current/ChangeLog,v
retrieving revision 1.8
diff -u -r1.8 ChangeLog
--- devs/flash/arm/iq80310//current/ChangeLog 12 Nov 2002 17:38:40 -0000 1.8
+++ devs/flash/arm/iq80310//current/ChangeLog 4 Apr 2003 08:02:22 -0000
@@ -1,3 +1,12 @@
+2002-04-04 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-11-12 Gary Thomas <gary at mlbassoc dot com>
* cdl/flash_iq80310.cdl: New Xscale platforms layout.
Index: devs/flash/arm/iq80310//current/src/flash_erase_block.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/iq80310/current/src/flash_erase_block.c,v
retrieving revision 1.3
diff -u -r1.3 flash_erase_block.c
--- devs/flash/arm/iq80310//current/src/flash_erase_block.c 23 May 2002 23:00:54 -0000 1.3
+++ devs/flash/arm/iq80310//current/src/flash_erase_block.c 4 Apr 2003 08:02:23 -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,8 @@
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);
@@ -104,10 +95,6 @@
len -= sizeof(*block);
}
if (len == 0) stat = 0;
- }
-
- if (cache_on) {
- HAL_DCACHE_ENABLE();
}
return stat;
Index: devs/flash/arm/iq80310//current/src/flash_lock_block.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/iq80310/current/src/flash_lock_block.c,v
retrieving revision 1.3
diff -u -r1.3 flash_lock_block.c
--- devs/flash/arm/iq80310//current/src/flash_lock_block.c 23 May 2002 23:00:54 -0000 1.3
+++ devs/flash/arm/iq80310//current/src/flash_lock_block.c 4 Apr 2003 08:02:23 -0000
@@ -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 @@
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;
@@ -87,10 +79,6 @@
// Restore ROM to "normal" mode
ROM[0] = FLASH_Reset;
-
- if (cache_on) {
- HAL_DCACHE_ENABLE();
- }
return stat;
}
Index: devs/flash/arm/iq80310//current/src/flash_program_buf.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/iq80310/current/src/flash_program_buf.c,v
retrieving revision 1.3
diff -u -r1.3 flash_program_buf.c
--- devs/flash/arm/iq80310//current/src/flash_program_buf.c 23 May 2002 23:00:54 -0000 1.3
+++ devs/flash/arm/iq80310//current/src/flash_program_buf.c 4 Apr 2003 08:02:23 -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,
@@ -68,13 +67,7 @@
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);
@@ -145,10 +138,6 @@
// Restore ROM to "normal" mode
bad:
ROM[0] = FLASH_Reset;
-
- if (cache_on) {
- HAL_DCACHE_ENABLE();
- }
return stat;
}
Index: devs/flash/arm/iq80310//current/src/flash_query.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/iq80310/current/src/flash_query.c,v
retrieving revision 1.3
diff -u -r1.3 flash_query.c
--- devs/flash/arm/iq80310//current/src/flash_query.c 23 May 2002 23:00:54 -0000 1.3
+++ devs/flash/arm/iq80310//current/src/flash_query.c 4 Apr 2003 08:02:24 -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 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;
@@ -85,10 +77,6 @@
}
ROM[0] = FLASH_Reset;
-
- if (cache_on) {
- HAL_DCACHE_ENABLE();
- }
return 0;
}
Index: devs/flash/arm/iq80310//current/src/flash_unlock_block.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/iq80310/current/src/flash_unlock_block.c,v
retrieving revision 1.3
diff -u -r1.3 flash_unlock_block.c
--- devs/flash/arm/iq80310//current/src/flash_unlock_block.c 23 May 2002 23:00:54 -0000 1.3
+++ devs/flash/arm/iq80310//current/src/flash_unlock_block.c 4 Apr 2003 08:02:24 -0000
@@ -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 @@
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);
@@ -127,10 +120,6 @@
done:
// Restore ROM to "normal" mode
ROM[0] = FLASH_Reset;
-
- if (cache_on) {
- HAL_DCACHE_ENABLE();
- }
return stat;
}