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]

edb7211 flash without CYGHWR_IO_FLASH_DEVICE_NOT_IN_RAM


Hi
this makes the flash of edb7xxx put flash functions in 2ram. sections
instead of implementing CYGHWR_IO_FLASH_DEVICE_NOT_IN_RAM and use flash_dev_query
instead of directly calling flash_query.
I tested this and it's ok.
Jani.


Index: devs/flash/arm/edb7xxx//current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/edb7xxx/current/ChangeLog,v
retrieving revision 1.9
diff -u -r1.9 ChangeLog
--- devs/flash/arm/edb7xxx//current/ChangeLog	23 May 2002 23:00:51 -0000	1.9
+++ devs/flash/arm/edb7xxx//current/ChangeLog	1 Apr 2003 13:18:53 -0000
@@ -1,3 +1,12 @@
+2003-04-01  Jani Monoses <jani at iv dot ro>
+	
+	* cdl/flash_edb7xxx.cdl:
+	* src/edb7xxx_flash.c.c:
+	* src/flash_query.c:
+	* src/flash_erase_block.c:
+	* src/flash_program_buf.c: Place flash functions in RAM sections
+	and no longer implement CYGHWR_IO_FLASH_DEVICE_NOT_IN_RAM
+	
 2001-10-14  Gary Thomas  <gthomas at redhat dot com>
 
 	* cdl/flash_edb7xxx.cdl: Missed change in include file location
Index: devs/flash/arm/edb7xxx//current/cdl/flash_edb7xxx.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/edb7xxx/current/cdl/flash_edb7xxx.cdl,v
retrieving revision 1.5
diff -u -r1.5 flash_edb7xxx.cdl
--- devs/flash/arm/edb7xxx//current/cdl/flash_edb7xxx.cdl	23 May 2002 23:00:51 -0000	1.5
+++ devs/flash/arm/edb7xxx//current/cdl/flash_edb7xxx.cdl	1 Apr 2003 13:18:54 -0000
@@ -67,34 +67,9 @@
         calculated    1
         no_define
         implements    CYGHWR_IO_FLASH_DEVICE
-        implements    CYGHWR_IO_FLASH_DEVICE_NOT_IN_RAM
     
-        compile       edb7xxx_flash.c
+        compile       edb7xxx_flash.c flash_query.c flash_program_buf.c flash_erase_block.c
     
-        make -priority 1 {
-            flash_erase_block.o: $(REPOSITORY)/$(PACKAGE)/src/flash_erase_block.c
-            $(CC) -S $(INCLUDE_PATH) $(CFLAGS) -g0 -mcpu=strongarm -fno-function-sections $(REPOSITORY)/$(PACKAGE)/src/flash_erase_block.c
-            echo " .globl flash_erase_block_end" >>flash_erase_block.s
-            echo "flash_erase_block_end:" >>flash_erase_block.s
-            $(CC) -c -o flash_erase_block.o flash_erase_block.s
-            $(AR) rcs $(PREFIX)/lib/libtarget.a flash_erase_block.o
-        }
-        make -priority 1 {
-            flash_program_buf.o: $(REPOSITORY)/$(PACKAGE)/src/flash_program_buf.c
-            $(CC) -S $(INCLUDE_PATH) $(CFLAGS) -g0 -mcpu=strongarm -fno-function-sections $(REPOSITORY)/$(PACKAGE)/src/flash_program_buf.c
-            echo " .globl flash_program_buf_end" >>flash_program_buf.s
-            echo "flash_program_buf_end:" >>flash_program_buf.s
-            $(CC) -c -o flash_program_buf.o flash_program_buf.s
-            $(AR) rcs $(PREFIX)/lib/libtarget.a flash_program_buf.o
-        }
-        make -priority 1 {
-            flash_query.o: $(REPOSITORY)/$(PACKAGE)/src/flash_query.c
-            $(CC) -S $(INCLUDE_PATH) $(CFLAGS) -g0 -mcpu=strongarm -fno-function-sections $(REPOSITORY)/$(PACKAGE)/src/flash_query.c
-            echo " .globl flash_query_end" >>flash_query.s
-            echo "flash_query_end:" >>flash_query.s
-            $(CC) -c -o flash_query.o flash_query.s
-            $(AR) rcs $(PREFIX)/lib/libtarget.a flash_query.o
-        }
     }
     cdl_component CYGPKG_DEVS_FLASH_STRATA_EDB7XXX {
         display       "Cirrus Logic EDB7xxx StrataFLASH memory support"
Index: devs/flash/arm/edb7xxx//current/src/edb7xxx_flash.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/edb7xxx/current/src/edb7xxx_flash.c,v
retrieving revision 1.6
diff -u -r1.6 edb7xxx_flash.c
--- devs/flash/arm/edb7xxx//current/src/edb7xxx_flash.c	23 May 2002 23:00:52 -0000	1.6
+++ devs/flash/arm/edb7xxx//current/src/edb7xxx_flash.c	1 Apr 2003 13:18:55 -0000
@@ -65,16 +65,7 @@
 flash_hwr_init(void)
 {
     unsigned short data[4];
-    extern char flash_query, flash_query_end;
-    typedef int code_fun(unsigned char *);
-    code_fun *_flash_query;
-    int code_len, stat, num_regions, region_size;
-
-    // Copy 'program' code to RAM for execution
-    code_len = (unsigned long)&flash_query_end - (unsigned long)&flash_query;
-    _flash_query = (code_fun *)flash_info.work_space;
-    memcpy(_flash_query, &flash_query, code_len);
-    HAL_DCACHE_SYNC();  // Should guarantee this code will run
+    int stat, num_regions, region_size;
 
 #if 0
     {
@@ -105,7 +96,7 @@
     }
 #endif
 
-    stat = (*_flash_query)(data);
+    flash_dev_query(data);
 #if 0
     (*flash_info.pf)("stat = %x\n", stat);
     dump_buf(data, sizeof(data));
Index: devs/flash/arm/edb7xxx//current/src/flash_erase_block.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/edb7xxx/current/src/flash_erase_block.c,v
retrieving revision 1.3
diff -u -r1.3 flash_erase_block.c
--- devs/flash/arm/edb7xxx//current/src/flash_erase_block.c	23 May 2002 23:00:52 -0000	1.3
+++ devs/flash/arm/edb7xxx//current/src/flash_erase_block.c	1 Apr 2003 13:18:56 -0000
@@ -56,10 +56,8 @@
 #include <cyg/hal/hal_arch.h>
 #include <cyg/hal/hal_cache.h>
 
-//
-// CAUTION!  This code must be copied to RAM before execution.  Therefore,
-// it must not contain any code which might be position dependent!
-//
+int  flash_erase_block(volatile unsigned long * block) 
+    __attribute__ ((section (".2ram.flash_erase_block")));
 
 int flash_erase_block(volatile unsigned long *block)
 {
Index: devs/flash/arm/edb7xxx//current/src/flash_program_buf.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/edb7xxx/current/src/flash_program_buf.c,v
retrieving revision 1.3
diff -u -r1.3 flash_program_buf.c
--- devs/flash/arm/edb7xxx//current/src/flash_program_buf.c	23 May 2002 23:00:52 -0000	1.3
+++ devs/flash/arm/edb7xxx//current/src/flash_program_buf.c	1 Apr 2003 13:18:56 -0000
@@ -56,10 +56,8 @@
 #include <cyg/hal/hal_arch.h>
 #include <cyg/hal/hal_cache.h>
 
-//
-// CAUTION!  This code must be copied to RAM before execution.  Therefore,
-// it must not contain any code which might be position dependent!
-//
+int  flash_program_buf(volatile unsigned long* addr, unsigned long* data, int len)
+    __attribute__ ((section (".2ram.flash_program_buf")));
 
 int
 flash_program_buf(volatile unsigned long *addr, unsigned long *data, int len)
Index: devs/flash/arm/edb7xxx//current/src/flash_query.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/edb7xxx/current/src/flash_query.c,v
retrieving revision 1.4
diff -u -r1.4 flash_query.c
--- devs/flash/arm/edb7xxx//current/src/flash_query.c	23 May 2002 23:00:52 -0000	1.4
+++ devs/flash/arm/edb7xxx//current/src/flash_query.c	1 Apr 2003 13:18:58 -0000
@@ -57,12 +57,10 @@
 #include <cyg/hal/hal_cache.h>
 #include CYGHWR_MEMORY_LAYOUT_H
 
-//
-// CAUTION!  This code must be copied to RAM before execution.  Therefore,
-// it must not contain any code which might be position dependent!
-//
 
 #define CNT 2000*1000*10  // At least 20ms
+
+int flash_query(unsigned short* data) __attribute__ ((section (".2ram.flash_query")));
 
 int
 flash_query(unsigned short *data)


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