Author Topic: a usermode reflash utility  (Read 9995 times)

0 Members and 1 Guest are viewing this topic.

Offline bushing

  • Senior Member
  • Needs to get outside.
  • *****
  • Posts: 119
  • props to my peeps
a usermode reflash utility
« on: June 06, 2005, 12:21:57 am »
Just in case people are curious:

I spent a couple hours figuring out how we can reflash the ROM with a suitable bootloader image once we have ironed out all the bugs in spin's method of running code on the phatbox.

Ideas I considered and rejected:

* Using the linux MTD driver:  The phatbox kernel is compiled without loadable module support.  Damn.

* hermit http://cvs.sourceforge.net/viewcvs.py/ceivalinux/loader/hermit-1.3-cc5: While this is made for our processor, there's only code here to reflash Intel chips -- ours is an ST Microelectronics chip.

The winner:

* flash_and_burn http://cvs.sourceforge.net/viewcvs.py/freebios/freebios2/util/flash_and_burn/ This utility comes from the freebios project, which aims to create replacement BIOS code for x86 motherboards.  Well, that's the wrong architecture, and I can't find any evidence that people have run it on ARM, but it DOES have support for programming an ST Micro chip, the M29F400BT (ID 0x20 0xD5).  If we add our chip, the M28W200B  (ID 0x20 0x57), it should be able to program it -- our CPU may be different, but the programming algorithm is the same.

For those of you who HAVEN'T ever looked into how you program a flash chip, it turns out to not be that hard.  You write a sequence of magic numbers to magic addresses within the chip's address space, and then just start writing to it as if it were ram.

I know you were all dying to hear this, but there ya go.  I'm still looking into finding a suitable replacement bootloader, if that turns out to be an easier solution than patching the existing one.

Ben

Offline spin

  • A few posts under my belt.
  • *
  • Posts: 23
Re: a usermode reflash utility
« Reply #1 on: June 06, 2005, 03:16:19 am »
Cool, sounds handy. Getting some form of interactive access (via serial or otherwise) would make much of this easier. Whats the status on the serial port hackery?

Offline bushing

  • Senior Member
  • Needs to get outside.
  • *****
  • Posts: 119
  • props to my peeps
Re: a usermode reflash utility
« Reply #2 on: June 06, 2005, 03:29:37 am »
Quote
Cool, sounds handy. Getting some form of interactive access (via serial or otherwise) would make much of this easier. Whats the status on the serial port hackery?


There apparently were both serial and JTAG ports / pads on the Rev A (Keg) board, but the Rev B board I have doesn't have anything resembling either of those.

If you're willing to solder to pins 34 and 36 on the EP7312, you can have TXD / RXD ... *sigh*

Ben

Offline ralph.deratt

  • A few posts under my belt.
  • *
  • Posts: 22
Re: a usermode reflash utility
« Reply #3 on: June 06, 2005, 04:37:15 pm »
Quote

There apparently were both serial and JTAG ports / pads on the Rev A (Keg) board, but the Rev B board I have doesn't have anything resembling either of those.

If you're willing to solder to pins 34 and 36 on the EP7312, you can have TXD / RXD ... *sigh*

Ben


Ben,
   I have a rev b and it has a connector for the serial port and a jumper for the boot rom:

JP4 -- ARM UART1 (SERIAL PORT!!!)
Pin 1   > +3.3V
Pin 3   >
Pin 5   > 7312 Pin 32 - TDX[1]
Pin 7   > 7312 Pin 36 - RXD[1]
Pin 9   > 7312 Pin 37 - DCD  (pulled low)
Pin 11 > 7312 Pin 38 - DSR (pulled low)
Pin 13 > 7312 Pin 35 - CTS (pulled low)

Pin 2  > 7312 Pin 18 - PB2
Pin 4  > 7312 Pin 19 - PB1
Pin 14 > Gnd

Note: the serial signals DCD, DSR, and CTS are active low.

JP2 -- ARM nBootRom
Pin 1  > GND
Pin 2  > 7312 Pin 155

I still need to trace out the Jtag connector, but on first look, it doesn't look like it's on Jp3.

RdeR

PS I tried jumpering JP2, but I didn't get the ">" prompt on the serial port.