[flashrom] Patch to add support for iCE40 FPGAs

Salvador Eduardo Tropea salvador at inti.gob.ar
Mon Apr 11 15:31:56 CEST 2016


Hi!

The following patch adds support to configure Lattice iCE40 FPGAs 
(formerly Silicon Blue parts). The support is to add support for the SPI 
flash memories attached to the FPGA.
iCE40 FPGAs read its configuration from an SPI memory.
This patch should support the HW-USBN-2B Lattice cable, but I used a 
generic FTDI FT2232 cable.
It works very well for the iCE40 Blink Evaluation Kit. This kit have an 
M25P10-A SPI flash.

Note that Lattice provides a tool for free, but I had problems with the 
command line version of the tool. Not to mention that the GUI version 
takes 1 minute, 6 seconds to configure the memory and flashrom 6 seconds ;-)

About the patch:
- The patch is for ft2232_spi.c file, it adds a new cable type to the 
ft2232_spi driver.
- The type is named ice40
- Lattice's cable used GPIOL0 as CS (named SS), for this reason the 
patch uses this pin.
- During the flash configuration the FPGA must in reset state. GPIOL3 
controls the RESET line (active low), this is the same line used by 
Lattice cable.
- Before even trying to detect a memory you must wake-up it. This is 
because the FPGA puts the memory to sleep. I know it sound a little bit 
crazy to send a command to a memory that you don't even know is there, 
but you can't detect it (read ID commands are ignored when the memory is 
in deep power down mode).
- At exit the patch puts the memory to sleep and disconnects the cable. 
This releases the reset and hence the FPGA boots from the memory. 
Ideally you should check if the FPGA successfully loaded the memory 
content. But for this you need to read the CDONE line, lamentably this 
line can't be accessed in the Blink kit.

Is this patch acceptable?

Regards, SET

-- 
Ing. Salvador Eduardo Tropea          http://utic.inti.gob.ar/
INTI - Micro y Nanoelectrónica (CMNB) http://www.inti.gob.ar/
Unidad Técnica Sistemas Inteligentes  Av. General Paz 5445
Tel: (+54 11) 4724 6300 ext. 6919     San Martín - B1650KNA
FAX: (+54 11) 4754 5194               Buenos Aires * Argentina




-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft2232_spi.diff
Type: text/x-patch
Size: 2456 bytes
Desc: not available
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20160411/1541898e/attachment.diff>


More information about the flashrom mailing list