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]

strata for bootblock flashes


A pointer arithmetic fix for bootblock parts and introduction
of CYGNUM_FLASH_SERIES for telling strata how many parts are 
on the same lines but different chip selects.Both of these are 
needed for strata to work with the edb7xxx

Jani

Index: devs/flash/intel/strata/current//ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/ChangeLog,v
retrieving revision 1.15
diff -u -r1.15 ChangeLog
--- devs/flash/intel/strata/current//ChangeLog	12 Apr 2003 05:09:45 -0000	1.15
+++ devs/flash/intel/strata/current//ChangeLog	14 Apr 2003 12:07:31 -0000
@@ -1,3 +1,10 @@
+2003-04-14  Jani Monoses <jani at iv dot ro>
+	
+	* src/strata.h:
+	* src/strata.c:
+	Fix boot-block flash handling. Allow multiple devices in series by 
+	introducing CYGNUM_FLASH_SERIES.
+
 2003-04-04  Jani Monoses <jani at iv dot ro>
 	
 	* src/strata.h:
Index: devs/flash/intel/strata/current//src/flash_erase_block.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/src/flash_erase_block.c,v
retrieving revision 1.5
diff -u -r1.5 flash_erase_block.c
--- devs/flash/intel/strata/current//src/flash_erase_block.c	4 Apr 2003 04:23:53 -0000	1.5
+++ devs/flash/intel/strata/current//src/flash_erase_block.c	14 Apr 2003 12:07:41 -0000
@@ -76,7 +76,7 @@
 #ifdef CYGOPT_FLASH_IS_BOOTBLOCK
 #define BLOCKSIZE (0x10000*CYGNUM_FLASH_DEVICES)
 #define ERASE_BLOCKSIZE (0x2000*CYGNUM_FLASH_DEVICES)
-    if ((eb - ROM) < BLOCKSIZE) {
+    if ((eb - ROM) < BLOCKSIZE/sizeof (*eb)) {
 // FIXME - Handle 'boot' blocks
         erase_block_size = ERASE_BLOCKSIZE;
     } else {
Index: devs/flash/intel/strata/current//src/strata.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/src/strata.c,v
retrieving revision 1.7
diff -u -r1.7 strata.c
--- devs/flash/intel/strata/current//src/strata.c	23 May 2002 23:01:02 -0000	1.7
+++ devs/flash/intel/strata/current//src/strata.c	14 Apr 2003 12:07:48 -0000
@@ -140,16 +140,16 @@
 
         flash_info.block_size = region_size*CYGNUM_FLASH_DEVICES;
         flash_info.buffer_size = buffer_size;
-        flash_info.blocks = num_regions;
+        flash_info.blocks = num_regions*CYGNUM_FLASH_SERIES;
         flash_info.start = (void *)CYGNUM_FLASH_BASE;
         flash_info.end = (void *)(CYGNUM_FLASH_BASE +
-                        (num_regions*region_size*CYGNUM_FLASH_DEVICES));
+                        (num_regions*CYGNUM_FLASH_SERIES*region_size*CYGNUM_FLASH_DEVICES));
 #ifdef CYGNUM_FLASH_BASE_MASK
         // Then this gives us a maximum size for the (visible) device.
         // This is to cope with oversize devices fitted, with some high
         // address lines ignored.
-        if ( ((unsigned int)flash_info.start & CYGNUM_FLASH_BASE_MASK) !=
-             (((unsigned int)flash_info.end - 1) & CYGNUM_FLASH_BASE_MASK ) ) {
+        if ( ((unsigned int)flash_info.start & (CYGNUM_FLASH_BASE_MASK * CYGNUM_FLASH_SERIES)) !=
+             (((unsigned int)flash_info.end - 1) & (CYGNUM_FLASH_BASE_MASK * CYGNUM_FLASH_SERIES) ) ) {
             // then the size of the device appears to span >1 device-worth!
             unsigned int x;
             x = (~(CYGNUM_FLASH_BASE_MASK)) + 1; // expected device size
Index: devs/flash/intel/strata/current//src/strata.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/src/strata.h,v
retrieving revision 1.5
diff -u -r1.5 strata.h
--- devs/flash/intel/strata/current//src/strata.h	12 Apr 2003 02:47:46 -0000	1.5
+++ devs/flash/intel/strata/current//src/strata.h	14 Apr 2003 12:07:49 -0000
@@ -93,6 +93,9 @@
 // the device is managed using only 16bit bus operations.
 
 #define CYGNUM_FLASH_INTERLEAVE CYGNUM_FLASH_DEVICES
+#ifndef CYGNUM_FLASH_SERIES
+#define CYGNUM_FLASH_SERIES	1
+#endif
 #define _FLASH_PRIVATE_
 #include <cyg/io/flash_dev.h>
 


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