[Avila] problem with updating flash from Linux

Burns, Darrell dburns1 at ibahn.com
Fri Nov 3 12:27:50 EST 2006


Ahmet,

There is an alternative that I previously posted to this list in April.
You can search the mailing list archive for more information, but here
is the text from my original post:

----- Original Message -----=20
From: "Burns, Darrell" <dburns1 at ibahn.com>
To: "Avila" <avila at lists.unixstudios.net>
Sent: Thursday, April 13, 2006 9:31 AM
Subject: RE: [Avila] Programming the flash from Linux
Subject: [Avila] One way to access the flash is to create a fis file that encompasses the
free space (space not used by redboot, kernel, or ramdisk images).  In
my case, I have two files - flash1 and ipstorage:

   RedBoot> fis lis
   Name              FLASH addr  Mem addr    Length      Entry point
   RedBoot           0x50000000  0x50000000  0x00040000  0x00000000
   RedBoot config    0x50FC0000  0x50FC0000  0x00001000  0x00000000
   FIS directory     0x50FE0000  0x50FE0000  0x00020000  0x00000000
   zimage            0x50040000  0x01600000  0x00100000  0x00800000
   ramdisk           0x50140000  0x00800000  0x00480000  0x00800000
   flash1            0x505C0000  0x00800000  0x00920000  0x00800000
   ipstorage         0x50EE0000  0x00800000  0x000E0000  0x00800000
   RedBoot>

It doesn't matter what you put in those locations, or the Mem addr or
the Entry point.  Just create the partition.

Next, if you have the kernel option "Memory Technology Devices
(MTD)---><*>   RedBoot partition table parsing" selected, then once
Linux is loaded, you can see the redboot partitions in the /proc/mtd
file:

   # cat /proc/mtd
   dev:    size   erasesize  name
   mtd0: 00040000 00020000 "RedBoot"
   mtd1: 00100000 00020000 "zimage"
   mtd2: 00480000 00020000 "ramdisk"
   mtd3: 00920000 00020000 "flash1"
   mtd4: 000e0000 00020000 "ipstorage"
   mtd5: 00001000 00020000 "RedBoot config"
   mtd6: 00020000 00020000 "FIS directory"

So - once this is done, creating /dev/mtd3 and /dev/mtdblock3 devices
allows access to the flash.  Here are the files created in /dev:

   crw-rw-r--    1 0        0         90,   0 Aug 30  2005 /dev/mtd0
   crw-rw-r--    1 0        0         90,   2 Aug 30  2005 /dev/mtd1
   crw-rw-r--    1 0        0         90,   4 Aug 30  2005 /dev/mtd2
   crw-rw-r--    1 0        0         90,   6 Aug 30  2005 /dev/mtd3
   crw-rw-r--    1 0        0         90,   8 Aug 30  2005 /dev/mtd4
   crw-rw-r--    1 0        0         90,  10 Aug 30  2005 /dev/mtd5
   crw-rw-r--    1 0        0         90,  12 Aug 30  2005 /dev/mtd6
   brw-rw-r--    1 0        0         31,   0 Aug 30  2005
/dev/mtdblock0
   brw-rw-r--    1 0        0         31,   1 Aug 30  2005
/dev/mtdblock1
   brw-rw-r--    1 0        0         31,   2 Aug 30  2005
/dev/mtdblock2
   brw-rw-r--    1 0        0         31,   3 Aug 30  2005
/dev/mtdblock3
   brw-rw-r--    1 0        0         31,   4 Aug 30  2005
/dev/mtdblock4
   brw-rw-r--    1 0        0         31,   5 Aug 30  2005
/dev/mtdblock5
   brw-rw-r--    1 0        0         31,   6 Aug 30  2005
/dev/mtdblock6

In my case, I use jffs2 as a file system on /dev/mtdblock3 (the file
named 'flash1' in redboot):

mkdir /mnt/flash
mount -t jffs2 /dev/mtdblock3 /mnt/flash

But you can access the /dev/mtd3 as a character device also.

This method is very useful for updating the kernel or ramdisk (or even
the RedBoot image if the write-protect option isn't selected in the
kernel) from Linux.  For example, I have a ramdisk.img file - I can
actually copy it as follows:

cp ramdisk.img /dev/mtdblock2

Next time I boot up and load the "ramdisk" file in redboot, it will be
the new ramdisk.img I copied over the top.

Darrell Burns
Sr. Firmware Engineer
iBAHN
10757 S. River Front Parkway, Suite 300
Salt Lake City, UT 84095
801.563.2023 direct
=20

-----Original Message-----
From: Ahmet Basagalar [mailto:ahmet at thebluezone.com]=20
Sent: Friday, November 03, 2006 10:08 AM
To: avila
Subject: [Avila] problem with updating flash from Linux
Subject: [Avila] Hi,

I am running into problems while updating flash from Linux. I have
compiled=20
Redboot without checksum control, so that is not an issue anymore. But
when=20
I do a kernel upgrade using 'netflash' in Linux sometimes it works and=20
sometimes it does not, meaning redboot tries to load the kernel but
system=20
just hangs as if it is a corrupt kernel. The same happens for the=20
filesystem, when I upgrade it by 'netflash' sometimes I got error
messages=20
during mount. Updating flash through redboot works fine.

This is a big headache for us right now. We are planning to deploy the=20
product but we can not upgrade the firmware remotely due to this issue
and=20
that is holding us. Any help will be appreciated. Is there a more
reliable=20
tool that I can use? Or should I tweak something in netflash for proper=20
operation? Any other alternatives to updating flash through Linux?

Regards,
Ahmet B.=20

---------------------------------------------------------------------
To unsubscribe, e-mail: avila-unsubscribe at lists.unixstudios.net
For additional commands, e-mail: avila-help at lists.unixstudios.net





More information about the Avila mailing list