[Avila] Programming the flash from Linux
Tim Harvey
tim_harvey at yahoo.com
Sun Apr 30 20:07:52 EDT 2006
--0-810145156-1146442072=:29799
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
I should point out that if your using redboot v2.02 from the Gateworks BSP you'll have to rebuild it to not perform CRC checks on FIS partitions. Otherwise, updating a kernel/ramdisk FIS partition from Linux will render it unbootable from Redboot. I haven't found anything in Redboot that allows you to override this but its not difficult to disable this feature in the source and build your own redboot.
And yes, 'netflash' works fine (other than the above statement).
Tim
"Burns, Darrell" <dburns1 at ibahn.com> wrote: They aren't actually jffs2 partitions. The Linux Kernel simply is able
to mount the Redboot partitions as block devices. The mount -t jffs2
... command actually formats and creates the file system if the space is
empty.
Darrell Burns
Sr. Firmware Engineer
iBAHN
10757 S. River Front Parkway, Suite 300
Salt Lake City, UT 84095
801.563.2023 direct
dburns1 at ibahn.com
-----Original Message-----
From: Tom Houweling [mailto:Tom.Houweling at SkyWare.com]
Sent: Thursday, April 13, 2006 4:04 PM
To: Avila
Subject: Re: [Avila] Programming the flash from Linux
Subject: [Avila] Darrel,
Thanks for the elaborate reply. I did not understand that redboot
actually
created jffs2 partitions.
That makes it all much easier to handle.
Tom
----- Original Message -----
From: "Burns, Darrell"
To: "Avila"
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
dburns1 at ibahn.com
-----Original Message-----
From: devel [mailto:devel at oberonwireless.com]
Sent: Thursday, April 13, 2006 9:34 AM
To: Avila
Subject: Re: [Avila] Programming the flash from Linux
Subject: [Avila] Hey,
I too will be wanting to do this in the near future. So any feedback is
appreciated. Thanks.
Travis
----- Original Message -----
From: "Tom Houweling"
To: "Avila"
Sent: Wednesday, April 12, 2006 5:09 PM
Subject: [Avila] Programming the flash from Linux
Subject: [Avila] Hi,
I have a requirement to program the flash from a running Linux system.
Are
the flashw or netflash tools suitable for that on the GW2342(8)
platform?
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: avila-unsubscribe at lists.unixstudios.net
For additional commands, e-mail: avila-help at lists.unixstudios.net
---------------------------------------------------------------------
To unsubscribe, e-mail: avila-unsubscribe at lists.unixstudios.net
For additional commands, e-mail: avila-help at lists.unixstudios.net
---------------------------------------------------------------------
To unsubscribe, e-mail: avila-unsubscribe at lists.unixstudios.net
For additional commands, e-mail: avila-help at lists.unixstudios.net
---------------------------------------------------------------------
To unsubscribe, e-mail: avila-unsubscribe at lists.unixstudios.net
For additional commands, e-mail: avila-help at lists.unixstudios.net
--0-810145156-1146442072=:29799--
More information about the Avila
mailing list