[coreboot] Yet another idea of an SPI flash chip programmer

Peter Stuge peter at stuge.se
Mon Dec 22 15:42:15 CET 2008

FENG Yu Ning wrote:
> I would like a programmer to be:
>  * able to program SPI flash chips,
>  * not slow (program 512k bytes in 3 mins),

Can you specify your speed requirement? What would be acceptable?
It's easier to calculate backwards then.

>  * with a driver whose source code is available (or not difficult
>    to write one),
>  * simple, and
>  * cheap.
> There is one that almost does the job,
>   http://www.malinov.com/Home/sergeys-projects/spi-flash-programmer
> but
> [0] would it be very slow?

Yes. It bitbangs SPI on the parallell port, which doesn't have very
fast output drivers and is connected to the CPU through a slow bus.

I thought a little bit more about the numbers I provided for doing
this and depending on which opcodes are supported by the flash chip,
bitbanging SPI could actually be faster than LPC, so 256kbyte would
take maybe 3-4 minutes instead of the 5 minutes needed by LPC.

> Recently I find a chip FT2232x
>   http://www.ftdichip.com/Products/FT2232C.htm
> It seems that the chip's IO could be configured to work in bit-bang
> mode and thus able to implement as an SPI I/F.
> [1] I think it is easy to build a prototype programmer using this
> chip. Is it?

The chip is surface mount with somewhat fine pitch (pins close
together) but you can find ready-made modules with the chip that will
make it very easy to build a programmer. FTDI make some modules, and
there are also third-party modules. Modules using FT232 seem to be
more common, but I'm not sure if they have the bitbanging capability.

> [2] Is the programmer going to meet my requirement?

It is an interesting question. USB has significantly more overhead
per bit to be banged, but the bus is also much faster. It may
actually be much faster.

To get the highest performance the SPI protocol has to be implemented
in hardware. I would recommend using a microcontroller with a fast
SPI master peripheral. I think 16MHz SPI clock is safe for all flash
chips, or is it 33MHz, but some chips can even run up to 75MHz.

To drive the flash chip at those high speed will require the design
to be more complicated, especially if you first need to download data
from a PC somehow. Then you need 128 Mbits of RAM too, and a RAM


More information about the coreboot mailing list