This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

am29 flash patch


This gets rid of cache operations in the AMD flash driver.
It even compiles with the innovator target
If all's well I'll send separate patches for the rest of the drivers.


Index: devs/flash/amd/am29xxxxx//current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/amd/am29xxxxx/current/ChangeLog,v
retrieving revision 1.21
diff -u -r1.21 ChangeLog
--- devs/flash/amd/am29xxxxx//current/ChangeLog	11 Feb 2003 15:02:19 -0000	1.21
+++ devs/flash/amd/am29xxxxx//current/ChangeLog	3 Apr 2003 15:52:46 -0000
@@ -1,3 +1,10 @@
+2003-04-03  Jani Monoses <jani at iv dot ro> 
+
+	* include/flash_am29xxxxx.inl:
+	Removed wrapper functions which enabled/disabled cache around query,
+	erase and program operations since the generic flash driver takes
+	care of the cache already.
+	
 2003-02-11  Gary Thomas  <gary at mlbassoc dot com>
 
 	* include/flash_am29xxxxx_parts.inl:
Index: devs/flash/amd/am29xxxxx//current/include/flash_am29xxxxx.inl
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx.inl,v
retrieving revision 1.17
diff -u -r1.17 flash_am29xxxxx.inl
--- devs/flash/amd/am29xxxxx//current/include/flash_am29xxxxx.inl	25 Nov 2002 23:19:57 -0000	1.17
+++ devs/flash/amd/am29xxxxx//current/include/flash_am29xxxxx.inl	3 Apr 2003 15:52:48 -0000
@@ -168,11 +168,6 @@
     __attribute__ ((section (".2ram.flash_erase_block")));
 int  flash_program_buf(void* addr, void* data, int len)
     __attribute__ ((section (".2ram.flash_program_buf")));
-static void _flash_query(void* data) __attribute__ ((section (".2ram._flash_query")));
-static int  _flash_erase_block(void* block, unsigned int size) 
-    __attribute__ ((section (".2ram._flash_erase_block")));
-static int  _flash_program_buf(void* addr, void* data, int len)
-    __attribute__ ((section (".2ram._flash_program_buf")));
 
 //----------------------------------------------------------------------------
 // Flash Query
@@ -181,8 +176,8 @@
 // device(s) in series. It is assumed that any devices in series
 // will be of the same type.
 
-static void
-_flash_query(void* data)
+void
+flash_query(void* data)
 {
     volatile flash_data_t *ROM;
     volatile flash_data_t *f_s1, *f_s2;
@@ -218,21 +213,6 @@
     while ((--timeout != 0) && (w != *(FLASH_P2V(ROM)))) ;
 }
 
-void
-flash_query(void* data)
-{
-    int cache_on;
-
-    HAL_DCACHE_IS_ENABLED(cache_on);
-    if (cache_on) {
-        HAL_DCACHE_SYNC();
-        HAL_DCACHE_DISABLE();
-    }
-    _flash_query(data);
-    if (cache_on) {
-        HAL_DCACHE_ENABLE();
-    }
-}
 
 //----------------------------------------------------------------------------
 // Initialize driver details
@@ -295,8 +275,8 @@
 //----------------------------------------------------------------------------
 // Erase Block
 
-static int
-_flash_erase_block(void* block, unsigned int size)
+int
+flash_erase_block(void* block, unsigned int size)
 {
     volatile flash_data_t* ROM, *BANK;
     volatile flash_data_t* b_p = (flash_data_t*) block;
@@ -430,26 +410,11 @@
     return res;
 }
 
-int
-flash_erase_block(void* block, unsigned int size)
-{
-    int ret, cache_on;
-    HAL_DCACHE_IS_ENABLED(cache_on);
-    if (cache_on) {
-        HAL_DCACHE_SYNC();
-        HAL_DCACHE_DISABLE();
-    }
-    ret = _flash_erase_block(block, size);
-    if (cache_on) {
-        HAL_DCACHE_ENABLE();
-    }
-    return ret;
-}
 
 //----------------------------------------------------------------------------
 // Program Buffer
-static int
-_flash_program_buf(void* addr, void* data, int len)
+int
+flash_program_buf(void* addr, void* data, int len)
 {
     volatile flash_data_t* ROM;
     volatile flash_data_t* BANK;
@@ -529,19 +494,4 @@
     return res;
 }
 
-int
-flash_program_buf(void* addr, void* data, int len)
-{
-    int ret, cache_on;
-    HAL_DCACHE_IS_ENABLED(cache_on);
-    if (cache_on) {
-        HAL_DCACHE_SYNC();
-        HAL_DCACHE_DISABLE();
-    }
-    ret = _flash_program_buf(addr, data, len);
-    if (cache_on) {
-        HAL_DCACHE_ENABLE();
-    }
-    return ret;
-}
 #endif // CYGONCE_DEVS_FLASH_AMD_AM29XXXXX_INL


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]