Network iPXE Flashrom 3COM 3C905C

Please see the Network gPXE and iPXE Flashrom Intel Pro 100 for a more detailed explanation of whats going on.

Get hardware info with lspci -v
04:09.0 Ethernet controller: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 78) Subsystem: 3Com Corporation 3C905CX-TX/TX-M Fast Etherlink for PC Management NIC Flags: bus master, medium devsel, latency 32, IRQ 17 I/O ports at 9800 [size=128] Memory at fdbfe000 (32-bit, non-prefetchable) [size=128] Expansion ROM at fda00000 [disabled] [size=128K] Capabilities: Kernel driver in use: 3c59x Kernel modules: 3c59x

Get hardware bus id with lspci -n
04:09.0 0200: 10b7:9200 (rev 78)

Back existing flash up

 * Note sometimes you may need to run this more than once, I have had it say 'No EEPROM/flash device found' and running it a second time it will work fine.

$ sudo flashrom -p nic3com:pci=04:09.0 -r 10b79200-orig.rom flashrom v0.9.4-r1394 on Linux 3.0.0-16-generic (x86_64), built with libpci 3.1.7, GCC 4.6.1, little endian flashrom is free software, get the source code at http://www.flashrom.org

Calibrating delay loop... OK. Found "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200, BDF 04:09.0). Found Atmel flash chip "AT49BV512" (64 kB, Parallel) on nic3com. Reading flash... done.

Check it is really 64k (65536 bytes)
$ ls -al *.rom -rw-r--r-- 1 root root 65536 2012-02-29 20:02 10b79200-orig.rom

Build ROM
~/ipxe/src$ make ARCH=i386 CC="gcc -m32" CXX="g++ -m32" bin/10b79200.rom [LD] bin/10b79200.rom.tmp [BIN] bin/10b79200.rom.bin [ZINFO] bin/10b79200.rom.zinfo [ZBIN] bin/10b79200.rom.zbin [FINISH] bin/10b79200.rom rm bin/10b79200.rom.bin bin/10b79200.rom.zinfo bin/10b79200.rom.zbin
 * Note already built previous roms hence compiling isn't being redone

Create dummy file and overwrite with real
This is to get a padded file 65536 bytes long otherwise flashrom throws "Error: Image size doesn't match" dd if=/dev/zero of=test.rom bs=1 count=65536 dd if=10b79200.rom of=test.rom conv=notrunc

$ ls -al *.rom -rw-rw-r-- 1 xxxx xxxx 64000 2012-02-29 20:04 10b79200.rom -rw-rw-r-- 1 xxxx xxxx 64512 2012-02-29 19:35 10ec8139.rom -rw-rw-r-- 1 xxxx xxxx 64512 2012-02-29 19:30 80861229.rom -rw-rw-r-- 1 xxxx xxxx 65536 2012-02-29 20:07 test.rom

Flash it
$ sudo flashrom -p nic3com:pci=04:09.0 -w test.rom flashrom v0.9.4-r1394 on Linux 3.0.0-16-generic (x86_64), built with libpci 3.1.7, GCC 4.6.1, little endian flashrom is free software, get the source code at http://www.flashrom.org

Calibrating delay loop... OK. Found "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200, BDF 04:09.0). Found Atmel flash chip "AT49BV512" (64 kB, Parallel) on nic3com. Reading old flash chip contents... done. Erasing and writing flash chip... writing sector at 0x0 failed! FAILED! Uh oh. Erase/write failed. Checking if anything changed. Your flash chip is in an unknown state. Get help on IRC at irc.freenode.net (channel #flashrom) or mail flashrom@flashrom.org with FAILED: your board name in the subject line! --- DO NOT REBOOT OR POWEROFF!

Oh crumbs...
 * Update - this seems to happen quite often with various failure messages, if you keep redoing it, it eventually works.

$ sudo flashrom -p nic3com:pci=04:09.0 -w test.rom flashrom v0.9.4-r1394 on Linux 3.0.0-16-generic (x86_64), built with libpci 3.1.7, GCC 4.6.1, little endian flashrom is free software, get the source code at http://www.flashrom.org

Calibrating delay loop... OK. Found "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200, BDF 04:09.0). Found Atmel flash chip "AT49BV512" (64 kB, Parallel) on nic3com. Reading old flash chip contents... done. Erasing and writing flash chip... Erase/write done. Verifying flash... VERIFIED.

Phew, dont know what went wrong there? I left the output on here rather than edit it out to show a failure isn't a disaster and immediate panic need not ensue.