summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2009-05-13 11:36:06 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2009-05-13 11:36:06 +0000
commitb4dcb7188ff557c6722f862a61e806f901c17889 (patch)
treeda5272689632779b482a959fc745c23c90da7494 /flashrom.c
parent01624f40eeec33c546150a240f194f057f6dd36e (diff)
downloadast2050-flashrom-b4dcb7188ff557c6722f862a61e806f901c17889.zip
ast2050-flashrom-b4dcb7188ff557c6722f862a61e806f901c17889.tar.gz
Add support for 3COM NICs as "external programmer" and Atmel AT49BV512
This allows flashrom to identify, read, write, erase and verify flash chips on (some) 3COM network cards. The patch uses the external programmer infrastructure, the network card is basically treated as an external flash programmer. Usage: $ ./flashrom -p nic3com flashrom v0.9.0-r498 Found NIC "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200), addr = 0xa400 Calibrating delay loop... OK. Found chip "Atmel AT49BV512" (64 KB) at physical address 0xffff0000. No operations were specified. $ ./flashrom -p nic3com -E flashrom v0.9.0-r498 Found NIC "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200), addr = 0xa400 Calibrating delay loop... OK. Found chip "Atmel AT49BV512" (64 KB) at physical address 0xffff0000. Erasing flash chip... SUCCESS. $ ./flashrom -p nic3com -wv backup.bin flashrom v0.9.0-r498 Found NIC "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200), addr = 0xa400 Calibrating delay loop... OK. Found chip "Atmel AT49BV512" (64 KB) at physical address 0xffff0000. Flash image seems to be a legacy BIOS. Disabling checks. Programming page: 1023 at address: 0x0000ffc0 Verifying flash... VERIFIED. $ ./flashrom -p nic3com -r backup.bin flashrom v0.9.0-r498 Found NIC "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200), addr = 0xa400 Calibrating delay loop... OK. Found chip "Atmel AT49BV512" (64 KB) at physical address 0xffff0000. Reading flash... done. I have tested this on actual hardware (see PCI IDs above) and all operations worked fine. Support for other 3COM cards will follow (I added some more which should be supportable by this code, but they're untested so far), as well as support for NICs from other vendors. The patch also adds support for the Atmel AT49BV512 which is soldered onto the 3COM NIC I used for testing. Corresponding to flashrom svn r499. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Mateusz Murawski <matowy@tlen.pl> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/flashrom.c b/flashrom.c
index f76722a..4e0e579 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -63,6 +63,19 @@ const struct programmer_entry programmer_table[] = {
.chip_writel = dummy_chip_writel,
},
+ {
+ .init = nic3com_init,
+ .shutdown = nic3com_shutdown,
+ .map_flash_region = nic3com_map,
+ .unmap_flash_region = nic3com_unmap,
+ .chip_readb = nic3com_chip_readb,
+ .chip_readw = nic3com_chip_readw,
+ .chip_readl = nic3com_chip_readl,
+ .chip_writeb = nic3com_chip_writeb,
+ .chip_writew = nic3com_chip_writew,
+ .chip_writel = nic3com_chip_writel,
+ },
+
{},
};
@@ -439,6 +452,8 @@ int main(int argc, char *argv[])
programmer = PROGRAMMER_INTERNAL;
} else if (strncmp(optarg, "dummy", 5) == 0) {
programmer = PROGRAMMER_DUMMY;
+ } else if (strncmp(optarg, "nic3com", 7) == 0) {
+ programmer = PROGRAMMER_NIC3COM;
} else {
printf("Error: Unknown programmer.\n");
exit(1);
OpenPOWER on IntegriCloud