[Avila] problem with updating flash from Linux

David Acker dacker at roinet.com
Fri Nov 3 17:15:33 EST 2006


--------------010608040306050604050304
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Tim Harvey wrote:
> Actually the program mentioned below will not change redboots cfg data unless its stored in an EEPROM, which it isn't on the Gateworks boards (although conceivably you could modify redboot to do this).  However the program will 'read' the redboot configuration data.
> 
> Tim 
> 

Actually, it will work with some help.  :-)  The author states that it 
will not but I believe he just hit a setup issue...the partitions are 
not setup the way the MTD layer wants them by the default redboot so 
that they are not writable.  It put the "RedBoot config" and the "FIS 
directory" into one flash block.  The MTD code wants all partitions to 
end on a flash block.  It is pretty easy to fix though.  First, Redboot 
has a config parameter to control it.  Turn off:
CYGSEM_REDBOOT_FLASH_COMBINED_FIS_AND_CONFIG

Next, I patched redboot to size the "RedBoot config" so that it was at 
least a flash block.  MTD will not let you write to partitions that end 
before the flash block does.

Checkout the attached patch...it fixes both issues.  Note, you will have 
  to fis init after this.

You will also need to use flash_unlock to open the flash.  On our board 
just running flash_unlock /dev/mtd0 opens up all the partitions.

-Ack

--------------010608040306050604050304
Content-Type: text/x-patch;
 name="redbootConfig.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="redbootConfig.diff"

diff -urpN redboot.orig/packages/redboot/current/cdl/redboot.cdl redboot/packages/redboot/current/cdl/redboot.cdl
--- redboot.orig/packages/redboot/current/cdl/redboot.cdl	2005-10-08 15:16:50.000000000 -0400
+++ redboot/packages/redboot/current/cdl/redboot.cdl	2006-10-17 17:46:54.000000000 -0400
@@ -849,7 +849,7 @@ cdl_package CYGPKG_REDBOOT {
                 display       "Merged config data and FIS directory"
                 flavor        bool              
                 active_if     { CYGOPT_REDBOOT_FIS && (CYGHWR_REDBOOT_FLASH_CONFIG_MEDIA == "FLASH") }
-                default_value 1
+                default_value 0
                 description "
                   If this option is set, then the FIS directory and FLASH 
                   configuration database will be stored in the same physical
diff -urpN redboot.orig/packages/redboot/current/src/fconfig.c redboot/packages/redboot/current/src/fconfig.c
--- redboot.orig/packages/redboot/current/src/fconfig.c	2005-04-25 16:28:54.000000000 -0400
+++ redboot/packages/redboot/current/src/fconfig.c	2006-10-17 17:45:44.000000000 -0400
@@ -1143,7 +1143,7 @@ load_flash_config(void)
     fisdir_size -= cfg_size;
 #else
     cfg_size = (flash_block_size > sizeof(struct _config)) ? 
-        sizeof(struct _config) : 
+        flash_block_size : 
         _rup(sizeof(struct _config), flash_block_size);
     if (CYGNUM_REDBOOT_FLASH_CONFIG_BLOCK < 0) {
         cfg_base = (void *)((CYG_ADDRESS)flash_end + 1 -

--------------010608040306050604050304--





More information about the Avila mailing list