[Avila] problem with updating flash from Linux

Tim Harvey tim_harvey at yahoo.com
Fri Nov 3 12:37:25 EST 2006


Ahmet,=0A=0AWhile there is nothing wrong with what Darrell is saying below,=
 I don't see why you would need to muck with the FIS partitions already cre=
ated if your just trying to get to the kernel/initrd - you should have thos=
e already defined.=0A=0AThe following is what I've used (never failed) for =
updating the redboot (note that you need a non-byteswapped version here),ke=
rnel and rfs using 'netflash' (once you've turned off FIS checksumming in r=
edboot):=0A=0A/bin/netflash -knb -r /dev/mtd0 ${TFTPSERVER} ${DIR}/redboot=
=0A/bin/netflash -knb -r /dev/mtd1 ${TFTPSERVER} ${DIR}/zImage=0A/bin/netfl=
ash -knb -r /dev/mtd2 ${TFTPSERVER} ${DIR}/ramdisk.gz=0A=0Athis assumes of =
course that /dev/mtd0,1,2 are correctly realized in /proc/mtd (various kern=
el compile options will affect this).=0A=0AMy guess is that if you have it =
working sometimes and not others you are probably trying to flash in an ima=
ge thats too large for your partition (cat /proc/mtd will show you the size=
s and you can use Darell's excellent info below to re-create your FIS parti=
tions if needed)=0A=0ATim=0A=0A----- Original Message ----=0AFrom: "Burns, =
Darrell" <dburns1 at ibahn.com>=0ATo: Avila <avila at lists.unixstudios.net>=0ASe=
nt: Friday, November 3, 2006 9:27:50 AM=0ASubject: RE: [Avila] problem with=
 updating flash from Linux=0A=0AAhmet,=0A=0AThere is an alternative that I =
previously posted to this list in April.=0AYou can search the mailing list =
archive for more information, but here=0Ais the text from my original post:=
=0A=0A----- Original Message ----- =0AFrom: "Burns, Darrell" <dburns1 at ibahn=
.com>=0ATo: "Avila" <avila at lists.unixstudios.net>=0ASent: Thursday, April 1=
3, 2006 9:31 AM=0ASubject: RE: [Avila] Programming the flash from Linux=0A=
=0A=0AOne way to access the flash is to create a fis file that encompasses =
the=0Afree space (space not used by redboot, kernel, or ramdisk images).  I=
n=0Amy case, I have two files - flash1 and ipstorage:=0A=0A   RedBoot> fis =
lis=0A   Name              FLASH addr  Mem addr    Length      Entry point=
=0A   RedBoot           0x50000000  0x50000000  0x00040000  0x00000000=0A  =
 RedBoot config    0x50FC0000  0x50FC0000  0x00001000  0x00000000=0A   FIS =
directory     0x50FE0000  0x50FE0000  0x00020000  0x00000000=0A   zimage   =
         0x50040000  0x01600000  0x00100000  0x00800000=0A   ramdisk       =
    0x50140000  0x00800000  0x00480000  0x00800000=0A   flash1            0=
x505C0000  0x00800000  0x00920000  0x00800000=0A   ipstorage         0x50EE=
0000  0x00800000  0x000E0000  0x00800000=0A   RedBoot>=0A=0AIt doesn't matt=
er what you put in those locations, or the Mem addr or=0Athe Entry point.  =
Just create the partition.=0A=0ANext, if you have the kernel option "Memory=
 Technology Devices=0A(MTD)---><*>   RedBoot partition table parsing" selec=
ted, then once=0ALinux is loaded, you can see the redboot partitions in the=
 /proc/mtd=0Afile:=0A=0A   # cat /proc/mtd=0A   dev:    size   erasesize  n=
ame=0A   mtd0: 00040000 00020000 "RedBoot"=0A   mtd1: 00100000 00020000 "zi=
mage"=0A   mtd2: 00480000 00020000 "ramdisk"=0A   mtd3: 00920000 00020000 "=
flash1"=0A   mtd4: 000e0000 00020000 "ipstorage"=0A   mtd5: 00001000 000200=
00 "RedBoot config"=0A   mtd6: 00020000 00020000 "FIS directory"=0A=0ASo - =
once this is done, creating /dev/mtd3 and /dev/mtdblock3 devices=0Aallows a=
ccess to the flash.  Here are the files created in /dev:=0A=0A   crw-rw-r--=
    1 0        0         90,   0 Aug 30  2005 /dev/mtd0=0A   crw-rw-r--    =
1 0        0         90,   2 Aug 30  2005 /dev/mtd1=0A   crw-rw-r--    1 0 =
       0         90,   4 Aug 30  2005 /dev/mtd2=0A   crw-rw-r--    1 0     =
   0         90,   6 Aug 30  2005 /dev/mtd3=0A   crw-rw-r--    1 0        0=
         90,   8 Aug 30  2005 /dev/mtd4=0A   crw-rw-r--    1 0        0    =
     90,  10 Aug 30  2005 /dev/mtd5=0A   crw-rw-r--    1 0        0        =
 90,  12 Aug 30  2005 /dev/mtd6=0A   brw-rw-r--    1 0        0         31,=
   0 Aug 30  2005=0A/dev/mtdblock0=0A   brw-rw-r--    1 0        0         =
31,   1 Aug 30  2005=0A/dev/mtdblock1=0A   brw-rw-r--    1 0        0      =
   31,   2 Aug 30  2005=0A/dev/mtdblock2=0A   brw-rw-r--    1 0        0   =
      31,   3 Aug 30  2005=0A/dev/mtdblock3=0A   brw-rw-r--    1 0        0=
         31,   4 Aug 30  2005=0A/dev/mtdblock4=0A   brw-rw-r--    1 0      =
  0         31,   5 Aug 30  2005=0A/dev/mtdblock5=0A   brw-rw-r--    1 0   =
     0         31,   6 Aug 30  2005=0A/dev/mtdblock6=0A=0AIn my case, I use=
 jffs2 as a file system on /dev/mtdblock3 (the file=0Anamed 'flash1' in red=
boot):=0A=0Amkdir /mnt/flash=0Amount -t jffs2 /dev/mtdblock3 /mnt/flash=0A=
=0ABut you can access the /dev/mtd3 as a character device also.=0A=0AThis m=
ethod is very useful for updating the kernel or ramdisk (or even=0Athe RedB=
oot image if the write-protect option isn't selected in the=0Akernel) from =
Linux.  For example, I have a ramdisk.img file - I can=0Aactually copy it a=
s follows:=0A=0Acp ramdisk.img /dev/mtdblock2=0A=0ANext time I boot up and =
load the "ramdisk" file in redboot, it will be=0Athe new ramdisk.img I copi=
ed over the top.=0A=0ADarrell Burns=0ASr. Firmware Engineer=0AiBAHN=0A10757=
 S. River Front Parkway, Suite 300=0ASalt Lake City, UT 84095=0A801.563.202=
3 direct=0A =0A=0A-----Original Message-----=0AFrom: Ahmet Basagalar [mailt=
o:ahmet at thebluezone.com] =0ASent: Friday, November 03, 2006 10:08 AM=0ATo: =
avila=0ASubject: [Avila] problem with updating flash from Linux=0A=0AHi,=0A=
=0AI am running into problems while updating flash from Linux. I have=0Acom=
piled =0ARedboot without checksum control, so that is not an issue anymore.=
 But=0Awhen =0AI do a kernel upgrade using 'netflash' in Linux sometimes it=
 works and =0Asometimes it does not, meaning redboot tries to load the kern=
el but=0Asystem =0Ajust hangs as if it is a corrupt kernel. The same happen=
s for the =0Afilesystem, when I upgrade it by 'netflash' sometimes I got er=
ror=0Amessages =0Aduring mount. Updating flash through redboot works fine.=
=0A=0AThis is a big headache for us right now. We are planning to deploy th=
e =0Aproduct but we can not upgrade the firmware remotely due to this issue=
=0Aand =0Athat is holding us. Any help will be appreciated. Is there a more=
=0Areliable =0Atool that I can use? Or should I tweak something in netflash=
 for proper =0Aoperation? Any other alternatives to updating flash through =
Linux?=0A=0ARegards,=0AAhmet B. =0A=0A=0A----------------------------------=
-----------------------------------=0ATo unsubscribe, e-mail: avila-unsubsc=
ribe at lists.unixstudios.net=0AFor additional commands, e-mail: avila-help at li=
sts.unixstudios.net=0A=0A=0A-----------------------------------------------=
----------------------=0ATo unsubscribe, e-mail: avila-unsubscribe at lists.un=
ixstudios.net=0AFor additional commands, e-mail: avila-help at lists.unixstudi=
os.net=0A=0A=0A=0A





More information about the Avila mailing list