Given the abundance of GPIOs at 3.3V, using the Raspberry Pi as programmer for Flash EEPROMs (commonly used as BIOS chips) would be awesome.
Pretty much all flash chips (Parallel/FWH/LPC/SPI interfaces) nowadays use 3.3V, so you'd just need a Raspberry Pi to recover from a failed BIOS/EFI/PXE/firmware/whatever update or to write a new image to such a flash chip. (Please note that I'm not talking about flash chips used in SSDs or USB pen drives, those are way more complicated to work with.)
The open source flashrom tool at http://flashrom.org/ is a perfect match for this task. It can use GPIO interfaces to bitbang a SPI bus/interface, or if you already have a Linux SPI driver in your kernel, it can use that driver. That alone would handle almost all flash chips on very recent x86 mainboards. Support for older LPC/FWH/Parallel type flash chips is available as well, but the bitbanging variants of those buses are fairly experimental.
If anyone with access to a beta board is willing to test how well flashrom works, I will help you to get it running and to test it.
Disclaimer: I'm the maintainer of flashrom, and I have written flashrom drivers for various pieces of hardware in the past (Bus Pirate etc.). I don't have any commercial interest in flashrom, it is a hobby for me.
Flash EEPROM programmer
16 posts
- Posts: 15
- Joined: Wed Jan 11, 2012 12:08 am
So... anyone with a beta board who is willing to give this a try?
The easiest way to test would be to rip a SPI flash chip (usually 8 pins, model number is something25something) out of a dead mainboard or a dead graphics card or a dead network card, tell me the flash chip model number and the GPIO pins you plan to attach it to, and I'll write a driver for it. If you don't know how to wire it up, just tell me the model number and I'll guide you. Compiling the flashrom source code is easy, you just download it and type "make".
The easiest way to test would be to rip a SPI flash chip (usually 8 pins, model number is something25something) out of a dead mainboard or a dead graphics card or a dead network card, tell me the flash chip model number and the GPIO pins you plan to attach it to, and I'll write a driver for it. If you don't know how to wire it up, just tell me the model number and I'll guide you. Compiling the flashrom source code is easy, you just download it and type "make".
- Posts: 15
- Joined: Wed Jan 11, 2012 12:08 am
If you are still looking for some testers, I'd like to test it ... last week I have received my RasPI and one of my friends recently killed his MB when he was flashing BIOS.
- Posts: 4
- Joined: Mon Jun 11, 2012 10:09 am
- Location: Czech Republic
Nice, finally someone who can test!
Which flash chip is on that mainboard? If it is a SPI flash chip, you could just use the in-kernel SPI driver (if your kernel is new enough and has that driver merged):
Debian testing/unstable has a flashrom which should be new enough, but it's easy to compile flashrom from source: http://www.flashrom.org/Downloads has a short howto for compiling flashrom.
If you need any help, drop by in #flashrom on irc.freenode.net.
Which flash chip is on that mainboard? If it is a SPI flash chip, you could just use the in-kernel SPI driver (if your kernel is new enough and has that driver merged):
- Code: Select all
flashrom -p linux_spi:dev=/dev/spidevX.Y
Debian testing/unstable has a flashrom which should be new enough, but it's easy to compile flashrom from source: http://www.flashrom.org/Downloads has a short howto for compiling flashrom.
If you need any help, drop by in #flashrom on irc.freenode.net.
- Posts: 15
- Joined: Wed Jan 11, 2012 12:08 am
Oh, and you need Linux kernel 3.2 from http://www.bootc.net/projects/raspberry-pi-kernel/ which has the SPI driver needed by flashrom.
- Posts: 15
- Joined: Wed Jan 11, 2012 12:08 am
It uses SST25VF080B ... from the datasheet it seems that it has SPI ... unfortunatelly it's already a little late today to pick up soldering iron and have some fun ... also my hands are a little shaky for soldering SMDs today (I will probably have to lower my caffeine intake
)
Anyway, thanks for the info, I'll update this thread when I get to it (hopefully on Sunday).
Anyway, thanks for the info, I'll update this thread when I get to it (hopefully on Sunday).
- Posts: 4
- Joined: Mon Jun 11, 2012 10:09 am
- Location: Czech Republic
SUCCESS!!! 
It worked great! I have used the kernel you have suggested and debian wheezy... flashrom wasn't in the repository, but it was no problem to compile version 0.9.5.2 ... I only had to install libpci-dev
If you want I have some ugly photos of the my setup ... the chip was SMD and I have soldered wires directly to MB ...
I have tried reading, writing and verifying the flash with RasPi's SPI and everything worked.
I have connected only VDD, VSS, SI, SO, SCK and CE# and it worked (I thought that I will have to do some magic with WP# but I was either lucky or it wasn't necessary
)
It worked great! I have used the kernel you have suggested and debian wheezy... flashrom wasn't in the repository, but it was no problem to compile version 0.9.5.2 ... I only had to install libpci-dev
If you want I have some ugly photos of the my setup ... the chip was SMD and I have soldered wires directly to MB ...
I have tried reading, writing and verifying the flash with RasPi's SPI and everything worked.
I have connected only VDD, VSS, SI, SO, SCK and CE# and it worked (I thought that I will have to do some magic with WP# but I was either lucky or it wasn't necessary
- Posts: 4
- Joined: Mon Jun 11, 2012 10:09 am
- Location: Czech Republic
Excellent, glad to hear it worked.
How long did it take to reflash the chip?
How long did it take to reflash the chip?
- Posts: 15
- Joined: Wed Jan 11, 2012 12:08 am
I THINK it was about a minute or two ... I'd say pretty fast ... I didn't think about measuring it
and you know how fast time runs when you are excited
But I would say that it didn't take (significantly) longer than the normal flashing with manufacturer supplied utility.
- Posts: 4
- Joined: Mon Jun 11, 2012 10:09 am
- Location: Czech Republic
Hi,
I'd like to know how to connect the raspberry pi to an SST 49LF020 in order to reprogram it.
If I've understood well, the SST 49LF020 has a parallel interface for writing.
Could someone write me how to connect the RPI GPIO pins to the LPC?
Thanks
I'd like to know how to connect the raspberry pi to an SST 49LF020 in order to reprogram it.
If I've understood well, the SST 49LF020 has a parallel interface for writing.
Could someone write me how to connect the RPI GPIO pins to the LPC?
Thanks
- Posts: 1
- Joined: Wed Aug 15, 2012 3:49 pm
Yeah, it would be good if Rasberry could work as EEPROM programmer. But has anyone thought about extending it for NAND flash memory programmer so that it can program NAND flash made by Hynix, Elpida, Samsung? E.g.. HY27US08121A or similar is used in Xbox360 and other kind of boxes?
- Posts: 2
- Joined: Wed Aug 08, 2012 8:28 pm
Hello,
Is this flashrom tool able to program normal EEPROMs like 24LCxx in buses like SPI, I2C and Microwire ??
It would be really nice to build a U$S35 full programmer.
Is this flashrom tool able to program normal EEPROMs like 24LCxx in buses like SPI, I2C and Microwire ??
It would be really nice to build a U$S35 full programmer.
- Posts: 6
- Joined: Mon Jan 21, 2013 2:35 am
jdiego wrote:Is this flashrom tool able to program normal EEPROMs like 24LCxx in buses like SPI, I2C and Microwire ??
For 24xx16 devices and smaller, i2c-tools & smbus are more than adequate.
For 24xx32 and larger, the device addressing goes from 8 bit to 16 bit, of which the above tools may have some issues. eeprog is another program which addresses 16 bit much easier.
There's lots more choices, which are but a search away
- Posts: 23
- Joined: Wed Jan 02, 2013 8:19 pm
- Location: Canuckistan
Thank you Hi-Z for the provided information.
Any way, if it doesn't bothers you, I will keep my question open because it wasn't answered, but rewriting:
Does somebody knows if the FLASHROM tool is able to program normal EEPROMs like 24xx,93xx,etc in buses like SPI, I2C and Microwire by itself using whatever kernel module is needed ??
I don't find explicit information on its website regarding this kind of devices.
I know that for example for microwire the spi_gpio driver can be used.
It would be gratefully appreciated.
Any way, if it doesn't bothers you, I will keep my question open because it wasn't answered, but rewriting:
Does somebody knows if the FLASHROM tool is able to program normal EEPROMs like 24xx,93xx,etc in buses like SPI, I2C and Microwire by itself using whatever kernel module is needed ??
I don't find explicit information on its website regarding this kind of devices.
I know that for example for microwire the spi_gpio driver can be used.
It would be gratefully appreciated.
- Posts: 6
- Joined: Mon Jan 21, 2013 2:35 am
Everytime i try to use flashrom I get the following problem:
pcilib: Cannot open /proc/bus/pci
pcilib: Cannot find any working access method.
Does anyone know how to resolve this ?
I might have done something wrong in installing flashrom. I just got the latest version, compiled it and then installed this libpci-dev that is mentioned a few posts up.
Thanks in advance.
pcilib: Cannot open /proc/bus/pci
pcilib: Cannot find any working access method.
Does anyone know how to resolve this ?
I might have done something wrong in installing flashrom. I just got the latest version, compiled it and then installed this libpci-dev that is mentioned a few posts up.
Thanks in advance.
- Posts: 1
- Joined: Mon Feb 18, 2013 2:28 am
try running as root or use sudo
Sand Bay, North Somerset, UK