[Avila] Programming JTAG from Linux and tweaking Redboot
Tim Harvey
tim_harvey at yahoo.com
Wed Jul 5 17:13:32 EDT 2006
--- gw at lunstad.com wrote:
> Hi Tim et al,
>
> I'm afraid that I'm doing something wrong, or that there is something
> special about /dev/mtd0. When I try to update the redboot image using
> netflash I get the following:
>
> # netflash -knb -r /dev/mtd0 redboot.bin
> netflash: open(/dev/mtd0) failed: Permission denied
undef CONFIG_MTD_REDBOOT_PARTS_READONLY in your kernel config (in the mtd
section)
>
> Here is what I have for mtd:
>
> cat /proc/mtd
> dev: size erasesize name
> mtd0: 00080000 00020000 "RedBoot"
> mtd1: 00800000 00020000 "user"
> mtd2: 00160000 00020000 "zimage"
> mtd3: 00300000 00020000 "ramdisk"
> mtd4: 00300000 00020000 "unallocated"
> mtd5: 0001f000 00020000 "FIS directory"
> mtd6: 00001000 00020000 "RedBoot config"
>
> If I try my "user" (jffs2) partition for yucks I get further:
>
> # netflash -k -r /dev/mtd3 redboot.bin
>
..........................................................................................................................
> netflash: got "redboot.bin", length=333572
> netflash: bad image checksum=0x94f0, expected checksum=0x4c4b40
you forgot the '-n' option which tells netflash that there is no checksum
tacked onto the tail of the image (use -knb).
There is no documentation that I've found on netflash other than the usage
(netflash -h), therefore you have to look at the code to see what it means to
have a checksum. I did this at one time and if I recall correctly the checksum
is a CRC16 checksum simply cat'ed onto the end of the file.
Personally I no longer use netflash as it doesn't suit my purpose but the code
was great for reference.
>
> I didn't actually want to overwrite it, so I left the checksum checking in.
>
> Any assistance would be appreaciated. For now I will continue to FLASH.EXE.
>
> Thanks,
>
> Andrew
>
> PS -- In case you were wondering about my perms:
>
> # ls -l /dev/mtd0
> crw-rw-rw- 1 0 0 90, 0 /dev/mtd0
> # whoami
> root
>
>
> > This has been discussed here in the past (look through the archives for
> > possibly more info)
> >
> > Personally for JTAG I use a personalized VMWare Virtual Machine (using the
> > free VMWare player) that boots FREEDos with a PXE network stack and leaves
> > me with a DOS cmdprompt with a drive mapped to a network share where I get
> > my images from. This may be a little complicated to setup but the gist of
> > it is that you can use FLASH.EXE just fine with a paralell port over
> > VMWare if its the whole DOS floppy disk thing that bothers you. Keep in
> > mind its realy slow so I only use this as a failsafe on a board I rendered
> > unbootable.
> >
> > Otherwise to update redboot I use the same method I would use to update
> > any other portion of flash - boot the board to a linux kernel and use
> > netflash. If you conifgure your kernel right, you'll have block/char
> > devices for each flash partition including the bootloader. Also keep in
> > mind that the binary image you would flash in via this method is NOT the
> > byte-swapped image you would feed to FLASH.EXE.
> >
and here's the details regarding disabling the FIS check that redboot v2.02
does by default when loading an image from flash:
packages/redboot/current/cdl/redboot.cdl line 791 change 'default_value 1' to
'default_value 0' to disable FIS checksum checks
Tim
> > Tim
> >
> > ----- Original Message ----
> > From: gw at lunstad.com
> > To: Avila <avila at lists.unixstudios.net>
> > Sent: Wednesday, June 28, 2006 8:26:33 AM
> > Subject: [Avila] Programming JTAG from Linux and tweaking Redboot
> >
> > Hi Folks,
> >
> > I am beginning to tweak redboot on our 2348 and was wondering if anyone
> > had found a work-around to creating a DOS floppy and running FLASH.EXE
> > from it to program the flash. Failing that, is it possible to test a
> > redboot image from RAM (e.g. load the image and then exec it)?
> >
> > Thanks in advance,
> >
> > Andrew
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
>
More information about the Avila
mailing list