This is the mail archive of the ecos-patches@sourceware.org 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]

Fix RedBoot build error


Introduced by "redundant FIS" patch :-(

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
Index: redboot/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.243
diff -u -5 -p -r1.243 ChangeLog
--- redboot/current/ChangeLog	9 May 2006 15:52:01 -0000	1.243
+++ redboot/current/ChangeLog	23 May 2006 11:56:11 -0000
@@ -1,5 +1,10 @@
+2006-05-23  Gary Thomas  <gary@mlbassoc.com>
+
+	* src/flash.c (fis_update_directory): Fix problems building on systems
+	with no FLASH locking.
+
 2006-04-19 Alexander Neundorf <alexander.neundorf@jenoptik.com>
 	* src/flash.c, src/main.c, src/fconfig.c: 
         * include/fis.h, include/redboot.h:
         * cdl/redboot.cdl:
         add support for redundant FIS tables, configurable via CYGOPT_REDBOOT_REDUNDANT_FIS
Index: redboot/current/src/flash.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/flash.c,v
retrieving revision 1.80
diff -u -5 -p -r1.80 flash.c
--- redboot/current/src/flash.c	9 May 2006 19:07:22 -0000	1.80
+++ redboot/current/src/flash.c	23 May 2006 11:43:37 -0000
@@ -293,16 +293,18 @@ int fis_start_update_directory(int autol
 int
 fis_update_directory(int autolock, int error)
 {
    void* err_addr=0;
 
+#ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING
 #ifdef CYGSEM_REDBOOT_FLASH_LOCK_SPECIAL
    // Ensure [quietly] that the directory is unlocked before trying to update and locked again afterwards
    int do_autolock=1;
 #else
    int do_autolock=autolock;
 #endif
+#endif
 
 #ifdef CYGOPT_REDBOOT_REDUNDANT_FIS
 
    struct fis_image_desc* img=(struct fis_image_desc*)fis_work_block;
 
@@ -328,12 +330,14 @@ fis_update_directory(int autolock, int e
       img->u.valid_info.valid_flag[0]=CYG_REDBOOT_RFIS_VALID;
       img->u.valid_info.valid_flag[1]=CYG_REDBOOT_RFIS_VALID;
 
       flash_program(tmp_fis_addr, img->u.valid_info.valid_flag, sizeof(img->u.valid_info.valid_flag), (void **)&err_addr);
    }
+#ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING
    if (do_autolock)
       flash_lock((void *)fis_addr, fisdir_size, (void **)&err_addr);
+#endif
 
 #else // CYGOPT_REDBOOT_REDUNDANT_FIS
     int blk_size = fisdir_size;
     int stat;
 
@@ -341,12 +345,14 @@ fis_update_directory(int autolock, int e
 #ifdef CYGSEM_REDBOOT_FLASH_COMBINED_FIS_AND_CONFIG
     memcpy((char *)fis_work_block+fisdir_size, config, cfg_size);
     conf_endian_fixup((char *)fis_work_block+fisdir_size);
     blk_size += cfg_size;
 #endif
+#ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING
     if (do_autolock)
-    flash_unlock((void *)fis_addr, blk_size, (void **)&err_addr);
+        flash_unlock((void *)fis_addr, blk_size, (void **)&err_addr);
+#endif
 
     if ((stat = flash_erase(fis_addr, blk_size, (void **)&err_addr)) != 0) {
         diag_printf("Error erasing FIS directory at %p: %s\n", err_addr, flash_errmsg(stat));
     } else {
         if ((stat = FLASH_PROGRAM(fis_addr, fis_work_block,
@@ -354,12 +360,14 @@ fis_update_directory(int autolock, int e
             diag_printf("Error writing FIS directory at %p: %s\n", 
                         err_addr, flash_errmsg(stat));
         }
     }
     fis_endian_fixup(fis_work_block);
+#ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING
     if (do_autolock)
        flash_lock((void *)fis_addr, blk_size, (void **)&err_addr);
+#endif
 
 #endif // CYGOPT_REDBOOT_REDUNDANT_FIS
 
     return 0;
 }

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