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]

redboot fis directory layout patch (redboot_3.diff)


With this patch applied, the padding of RedBoot FIS directory entries
can be controlled by means of a configuration option. This is extremly
useful if flash sectors are tiny. I already submitted this patch some
time ago, but that one contained a bug that cause a compilation error
if RedBoot was configured to not use the FIS. This is fixed in the
patch below.

tk
----------------------------------------------- 
Thomas Koeller, Software Development 

Basler Vision Technologies 
An der Strusbek 60-62 
22926 Ahrensburg 
Germany 

Tel +49 (4102) 463-390 
Fax +49 (4102) 463-46390

mailto:Thomas.Koeller@baslerweb.com 
http://www.baslerweb.com 






diff --strip-trailing-cr -ru packages-orig/redboot/current/ChangeLog
packages/redboot/current/ChangeLog
--- packages-orig/redboot/current/ChangeLog	2002-08-20
11:37:07.000000000 +0200
+++ packages/redboot/current/ChangeLog	2002-08-22 15:38:08.000000000 +0200
@@ -1,3 +1,8 @@
+2002-08-20  Thomas Koeller  <thomas@koeller.dyndns.org>
+ 
+     	* cdl/redboot.cdl:
+ 	* include/fis.h: Allow control of FIS descriptor padding.
+
 2002-08-16  Jani Monoses  <jani@iv.ro>
 
 	* src/io.c: Do not add empty lines to command history.
diff --strip-trailing-cr -ru packages-orig/redboot/current/cdl/redboot.cdl
packages/redboot/current/cdl/redboot.cdl
--- packages-orig/redboot/current/cdl/redboot.cdl	2002-08-20
11:37:07.000000000 +0200
+++ packages/redboot/current/cdl/redboot.cdl	2002-08-22
15:38:08.000000000 +0200
@@ -43,7 +43,7 @@
 #
 # Author(s):      gthomas
 # Original data:  gthomas
-# Contributors:   Philippe Robin, Andrew Lunn
+# Contributors:   Philippe Robin, Andrew Lunn, tkoeller
 # Date:           2000-05-01
 #
 #####DESCRIPTIONEND####
@@ -558,6 +558,17 @@
                   flash to be recognized as a reserved area for RedBoot
                   by an ARM BootRom monitor."
             }
+
+	    cdl_option CYGNUM_REDBOOT_FIS_DIRECTORY_ENTRY_SIZE {
+                display         "Size of FIS directory entry"
+		flavor	    	data
+                default_value   256
+                description "
+                  The FIS directory is limited to one single flash
+		  sector. If your flash has tiny sectors, you may wish
+		  to reduce this value in order to get more slots in
+		  the FIS directory."
+ 	    }
         }
 
         cdl_component CYGSEM_REDBOOT_FLASH_CONFIG {
diff --strip-trailing-cr -ru packages-orig/redboot/current/include/fis.h
packages/redboot/current/include/fis.h
--- packages-orig/redboot/current/include/fis.h	2002-08-20
11:37:07.000000000 +0200
+++ packages/redboot/current/include/fis.h	2002-08-22
15:43:15.000000000 +0200
@@ -43,7 +43,7 @@
 //#####DESCRIPTIONBEGIN####
 //
 // Author(s):    gthomas
-// Contributors: gthomas
+// Contributors: gthomas, tkoeller
 // Date:         2000-07-28
 // Purpose:      
 // Description:  
@@ -54,6 +54,13 @@
 //
 
//==========================================================================
 
+#include <pkgconf/redboot.h>
+#ifdef CYGOPT_REDBOOT_FIS
+#include <cyg/infra/cyg_type.h>
+
+#define FIS_IMAGE_DESC_SIZE_UNPADDED \
+  (16 + 4 * sizeof(unsigned long) + 3 * sizeof(CYG_ADDRESS))
+
 struct fis_image_desc {
     unsigned char name[16];      // Null terminated name
     CYG_ADDRESS   flash_base;    // Address within FLASH of image
@@ -61,11 +68,12 @@
     unsigned long size;          // Length of image
     CYG_ADDRESS   entry_point;   // Execution entry point
     unsigned long data_length;   // Length of actual data
-    unsigned char _pad[256-(16+4*sizeof(unsigned
long)+3*sizeof(CYG_ADDRESS))];
+    unsigned char
_pad[CYGNUM_REDBOOT_FIS_DIRECTORY_ENTRY_SIZE-FIS_IMAGE_DESC_SIZE_UNPADDED];
     unsigned long desc_cksum;    // Checksum over image descriptor
     unsigned long file_cksum;    // Checksum over image data
 };
 
 struct fis_image_desc *fis_lookup(char *name, int *num);
 
+#endif // CYGOPT_REDBOOT_FIS
 #endif // _FIS_H_


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