summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate all 'inline's from the flashrom codeUwe Hermann2009-05-166-77/+82
| | | | | | | | | | | | They serve pretty much no purpose, compilers can optimize pretty much all of what we might mark as inline anyway, _and_ inlines are not enforced in any way by the compiler either. They're totally unneeded. Kill them. Corresponding to flashrom svn r522. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Drop unused/duplicated #includes and some dead codeUwe Hermann2009-05-1630-153/+4
| | | | | | | | | Build-tested on 32bit x86. Corresponding to flashrom svn r521. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Add proper workaround for 3COM 3C90xB cards, which need special fixups (the ↵Uwe Hermann2009-05-164-4/+49
| | | | | | | | | | | | | | | | 3C90xC ones don't) This is tested on hardware. Also, add initial support for the Atmel AT29C010A chip (which I inserted in a 3COM 3C90xB card for testing). It can be detected, read works, erase works, but write will need some additional code (will post in another patch later). Corresponding to flashrom svn r520. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Introduce a type "chipaddr" to abstract the offsets within flash regionsCarl-Daniel Hailfinger2009-05-1623-203/+203
| | | | | | | | | | | | | | | | | | | Use chipaddr instead of volatile uint8_t * because when we access chips in external flashers, they are not accessed via pointers at all. Benefits: This allows us to differentiate between volatile machine memory accesses and flash chip accesses. It also enforces usage of chip_{read,write}[bwl] to access flash chips, so nobody will unintentionally use pointers to access chips anymore. Some unneeded casts are removed as well. Grepping for chip operations and machine memory operations doesn't yield any false positives anymore. Compile tested on 32 bit and 64 bit Linux. Corresponding to flashrom svn r519. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Older libpci versions (e.gUwe Hermann2009-05-161-1/+4
| | | | | | | | | | | | | | 2.2.8, as it's default on current FreeBSD 7.2) don't properly fill the base_addr[0] struct member, so revert back to an explicit pci_read_long() call, otherwise detection of PCI devices and their base address will fail with strange error messages. Thanks Idwer Vollering <vidwer@gmail.com> for reporting and testing. Corresponding to flashrom svn r518. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Add generic 16 bit and 32 bit chip read/write emulation to the external ↵Carl-Daniel Hailfinger2009-05-164-26/+39
| | | | | | | | | | | | | flasher infrastructure The emulation works by splitting 32 bit accesses into 16 bit accesses and 16 bit accesses into to 8 bit accesses. That way, external flashers can mix and match the amount of emulation they need. Corresponding to flashrom svn r517. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Uwe tested the recent SB600 SPI commit and notified me of one unexpected problemCarl-Daniel Hailfinger2009-05-151-1/+25
| | | | | | | | | | | | It seems some boards do not use SPI_HOLD at all. Take that into account when trying to figure out if SPI is available. Print the SB600 ROM strap override register status for better debugging. Corresponding to flashrom svn r516. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Refactor parts of the 3COM NIC codeUwe Hermann2009-05-155-92/+151
| | | | | | | | | | | | | | | Move the reusable PCI specific parts into pcidev.c, they'll be usable for other NIC code (Realtek, VIA, ...) and also for SATA/IDE controller cards as external programmers (for every PCI device which can program EEPROMs basically). Also add print_supported_pcidevs() to show the supported PCI devices (currently only NICs, soon more) in the 'flashrom -L' output. Corresponding to flashrom svn r515. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Additionally to WREN also handle WRSR failures gracefully for ICHSPICarl-Daniel Hailfinger2009-05-151-4/+29
| | | | | | | | | | | | | | | | | | | | | Until the ICH SPI driver can handle preopcodes as standalone opcodes, we should handle such special opcode failure gracefully on ICH and compatible chipsets. This fixes status register writes on almost all ICH+VIA SPI masters. The fix is almost identical to r484, but this time it affects the EWSR (Enable Write Status Register) opcode instead of the WREN (Write Enable) opcode. With the differentiated return codes introduced in r500, the workaround is more precise this time. The old WREN workaround was updated as well. Corresponding to flashrom svn r514. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: FENG Yu Ning <fengyuning1984@gmail.com> Acked-by: Cristi Magherusan <cristi.magherusan@net.utcluj.ro>
* Make the nic3com code check how many supported NICs are foundUwe Hermann2009-05-142-28/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we find multiple ones, abort with a message to the user, suggesting to use the flashrom -p nic3com=bb:dd.f syntax. If exactly one supported NIC is found, use it. If none is found, abort with an error. Print the bb:dd.f numbers for all supported NICs we find, so the user doesn't have to poke around in lspci output to find the desired bb:dd.f. Also, drop one pci_read_long() in favor of using the already existing base_addr[0] struct field. Drop the BAR in user messages, it's not really useful for us. Instead, explain the BDF syntax a bit more verbosely. While I'm at it, update the manpage some more to mention and fully document the external programmer support we have (or will have soon). The patch is tested on hardware: $ flashrom -p nic3com flashrom v0.9.0-r512 Found NIC "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200, BDF 05:04.0) Found NIC "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200, BDF 05:03.0) Error: Multiple supported NICs found. Please use 'flashrom -p nic3com=bb:dd.f' to explicitly select the card with the given BDF (PCI bus, device, function). $ flashrom -p nic3com=05:04.0 flashrom v0.9.0-r512 Found NIC "3COM 3C905C: EtherLink 10/100 PCI (TX)" (10b7:9200, BDF 05:04.0) Calibrating delay loop... OK. Found chip "Atmel AT49BV512" (64 KB) at physical address 0xffff0000. No operations were specified. Corresponding to flashrom svn r513. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Fix compilation of nic3com on 64bitCarl-Daniel Hailfinger2009-05-143-3/+4
| | | | | | | Corresponding to flashrom svn r512. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Unify usage of iopl-like code by introducing get_io_perms()Uwe Hermann2009-05-143-20/+17
| | | | | | | | | | Factor out portable iopl()-style code into a global function which all programmers can use, add missing close() call. Corresponding to flashrom svn r511. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* nic3com: allow selection of a particular PCI device to use as programmerChristian Ruppert2009-05-144-21/+64
| | | | | | | | | | | | Add support for users to specify a certain NIC via PCI bus:slot.func notation, in case there are multiple NICs in one system. Usage: flashrom -p nic3com=bb:ss.f Corresponding to flashrom svn r510. Signed-off-by: Christian Ruppert <spooky85@gmail.com> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Cosmetics and eliminate unneeded vars as per IRC discussionUwe Hermann2009-05-141-9/+6
| | | | | | | | | Build-tested and 'make PREFIX=/tmp/foo install' tested by me. Corresponding to flashrom svn r509. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Improve makefile structure a bitChristian Ruppert2009-05-141-13/+17
| | | | | | | Corresponding to flashrom svn r508. Signed-off-by: Christian Ruppert <spooky85@gmail.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Add a dummy SPI controller driver, similar to the dummy LPC/FWH/Parallel ↵Carl-Daniel Hailfinger2009-05-143-3/+33
| | | | | | | | | | | | | | | | | flasher driver Does not support reading or writing the fake chip yet. flashrom --programmer dummy also enables the dummy SPI controller driver. Testing the dummy SPI driver revealed a RDID debug printing bug in the SPI core. Fix that as well. Corresponding to flashrom svn r507. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Fix spelling error in commentDaniel McLellan2009-05-141-1/+1
| | | | | | | | | Author: raijin Corresponding to flashrom svn r506. Signed-off-by: Daniel McLellan <daniel.mclellan@gmail.com> Acked-by: Peter Stuge <peter@stuge.se>
* Generic status register prettyprinting for SST25*Carl-Daniel Hailfinger2009-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Even if we don't tell the user about the areas the block locking bits correspond to, printing a detailed list of which lock bits are set is a definite improvement. Corresponding to flashrom svn r505. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Sample output: [...] Probing for SST SST25VF032B, 4096 KB: RDID returned bf 25 4a. probe_spi_rdid_generic: id1 0xbf, id2 0x254a Chip status register is 1c Chip status register: Block Protect Write Disable (BPL) is not set Chip status register: Auto Address Increment Programming (AAI) is not set Chip status register: Bit 5 / Block Protect 3 (BP3) is not set Chip status register: Bit 4 / Block Protect 2 (BP2) is set Chip status register: Bit 3 / Block Protect 1 (BP1) is set Chip status register: Bit 2 / Block Protect 0 (BP0) is set Chip status register: Write Enable Latch (WEL) is not set Chip status register: Write In Progress (WIP/BUSY) is not set Found chip "SST SST25VF032B" (4096 KB) at physical address 0xffc00000. Acked-by: Cristi Magherusan <cristi.magherusan@net.utcluj.ro>
* SST25 chips do not support page program, only byte programCarl-Daniel Hailfinger2009-05-131-5/+5
| | | | | | | | | | Downgrade the chips from 256-byte writes to 1-byte writes. This fixes writing to them on ICH/VIA SPI masters. Corresponding to flashrom svn r504. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: FENG Yu Ning <fengyuning1984@gmail.com>
* Winbond W39V040A TEST_OK_ PROBE READMateusz Murawski2009-05-131-1/+1
| | | | | | | | | Thanks to Mateusz for testing and reporting! Corresponding to flashrom svn r503. Signed-off-by: Mateusz Murawski <matowy@tlen.pl> Acked-by: Peter Stuge <peter@stuge.se>
* Mark SST 39VF512 as fully testedMateusz Murawski2009-05-131-1/+1
| | | | | | | | | | Tested with 3COM 3C905C: EtherLink 10/100 PCI (TX) http://www.coreboot.org/pipermail/coreboot/2009-May/048163.html Corresponding to flashrom svn r502. Signed-off-by: Mateusz Murawski <matowy@tlen.pl> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Fix nic3com.c build issues on *BSDUwe Hermann2009-05-131-1/+7
| | | | | | | Corresponding to flashrom svn r501. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* There are various reasons why a SPI command can failCarl-Daniel Hailfinger2009-05-134-12/+50
| | | | | | | | | | | | | | | | | | | | | Among others, I have seen the following problems: - The SPI opcode is not supported by the controller. ICH-style controllers exhibit this if SPI config is locked down. - The address in in a prohibited area. This can happen on ICH for any access (BBAR) and for writes in chipset write protected areas. - There is no SPI controller. Introduce separate error codes for unsupported opcode and prohibited address. Add the ability to adjust REMS and RES addresses to the minium supported read address with the help of spi_get_valid_read_addr(). That function needs to call SPI controller specific functions like reading BBAR on ICH. Corresponding to flashrom svn r500. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Add support for 3COM NICs as "external programmer" and Atmel AT49BV512Uwe Hermann2009-05-136-2/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Use helper functions chip_{read,write}[bwl] to access flash chipsCarl-Daniel Hailfinger2009-05-124-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The semantic patch I used in r418 to make the original conversion to accessor functions was missing one isomorphism: a[b] <=> *(a+b) The semantic patcher Coccinelle was used to create this patch. Semantic patch follows: @@ typedef uint8_t; expression a; volatile uint8_t *b; @@ - b[a] + *(b + a) @@ expression a; volatile uint8_t *b; @@ - *(b) = (a); + chip_writeb(a, b); @@ volatile uint8_t *b; @@ - *(b) + chip_readb(b) @@ type T; T b; @@ ( chip_readb | chip_writeb ) (..., - (T) - (b) + b ) Corresponding to flashrom svn r498. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Unify write_39sf020() and write_49f002() functionsUwe Hermann2009-05-124-60/+14
| | | | | | | | | | The write_39sf020() and write_49f002() functions are identical except for whitespace differences, so drop one of them. Corresponding to flashrom svn r497. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Rename the STM50FLW register variable flash_addr used for block write ↵Carl-Daniel Hailfinger2009-05-111-5/+5
| | | | | | | | | | | | protect handling All other chips call it wrprotect which is less confusing. As a side benefit, flash_addr is now a name usable for other stuff. Corresponding to flashrom svn r496. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Ronald G. Minnich <rminnich@gmail.com>
* Print dummy programmer messages only if verbose mode is selectedCarl-Daniel Hailfinger2009-05-112-26/+26
| | | | | | | | | | | | Print the return value of dummy_chip_read[bwl]. Align entries in programmer_table. This is a cosmetic patch and has no effect on code flow. Corresponding to flashrom svn r495. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Ronald G. Minnich <rminnich@gmail.com>
* Check probing results for flash contentsCarl-Daniel Hailfinger2009-05-111-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | When flashrom JEDEC code sends the ID command to the chip, it expects to see IDs in the default flash location. However, sometimes the chip does not react to the ID command, either because it doesn't understand the command or because the command never reached it. One way to detect this is to compare ID output with flash chip contents for the same location. If they are identical, there is a high chance you're not actually seeing ID output. Warn the user in that case. This patch helps a lot when a chip is not recognized and we want to check if the probe responses are real IDs or just random flash chip contents. This should probably be added to all probe functions, but probe_jedec is called for all sizes and thus flashrom will check this condition at least once per size, making sure we can cross-match the warning. Corresponding to flashrom svn r494. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: FENG Yu Ning <fengyuning1984@gmail.com>
* Abstract mapping/unmapping of flash regionsCarl-Daniel Hailfinger2009-05-114-18/+57
| | | | | | | | | | | | | | | | Flash mapping/unmapping was performed without an abstraction layer, so even the dummy flasher caused memory mappings to be set up. Add map/unmap functions to the external flasher abstraction. Fix a possible scribble-over-low-memory corner case which fortunately never triggered so far. With this patch, --programmer dummy works fine as non-root. Corresponding to flashrom svn r493. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Handle (un)locking of SST FWH chipsCarl-Daniel Hailfinger2009-05-112-3/+62
| | | | | | | | | | | | | | | | Add lock bit handling (printing, setting and checking) to SST FWH chips and abort any writes to locked sectors. Verbose mode gives you all the info. Normal mode only tells you of unlocking failed, but gives enough details to debug. Add a comment about flash register placement to flashrom.c. Thanks to Uwe for testing multiple iterations of this patch. Corresponding to flashrom svn r492. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Create a SB600 SPI detection heuristicCarl-Daniel Hailfinger2009-05-101-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | I know that the data sheets say we can't read the ROM straps, but creative interpretation of the data sheets yielded a heuristic which should work pretty well. NOTE: If you test this, make sure you power down and _unplug_ the machine for a few minutes before you boot and run flashrom with this patch. If the machine is not unplugged for some time, the test will yield incorrect results. If you run a slightly older flashrom version than svn HEAD, the test will yield incorrect results. If you run any flashrom version (except svn HEAD plus this patch) after poweron, the test will yield incorrect results. Explanation: Older flashrom versions unconditionally write to registers which are used for this heuristic. These registers are in the S5 power domain, so even powering down does not clear them, you really have to unplug the machine and remove the battery if this is a laptop. Corresponding to flashrom svn r491. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de>
* Add support for EPoX EP-8K5A2 and separate out common VT823x board enable codeLuc Verhaegen2009-05-091-53/+87
| | | | | | | Corresponding to flashrom svn r490. Signed-off-by: Luc Verhaegen <libv@skynet.be> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Kill one superfluous variable and improve code readabilityCarl-Daniel Hailfinger2009-05-091-3/+2
| | | | | | | Corresponding to flashrom svn r489. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Fix Elan SC520 handlingCarl-Daniel Hailfinger2009-05-091-2/+1
| | | | | | | | | | | | | | | | | | Flashbase is a variable which should never be set outside chipset code. It is only used to calculate the base address of the flash space at exactly one location in the code. Setting flashbase during probe caused subsequent probes to fail unless special handling code was used. We had such code and it caused every probe except the first to fail on Elan SC520. Remove the superfluous flashbase assignment and simplify the rest of the code. Corresponding to flashrom svn r488. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Ronald G. Minnich <rminnich@gmail.com>
* Trim default ICH SPI delay from 1000 to 10 microsecondsCarl-Daniel Hailfinger2009-05-091-4/+4
| | | | | | | | | | | | | | | | Since many commands take around 10 microseconds to complete, it is totally pointless to wait for 1000 microseconds before checking the status again. This patch is tested and reduced write time on ICH7 with SST25VF080B from over one hour to 62 seconds. Thanks to Ali Nadalizadeh for testing! Corresponding to flashrom svn r487. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Myles Watson <mylesgw@gmail.com>
* Convert all flashchips.c entries with SPI programing to the 256-byte version ↵Carl-Daniel Hailfinger2009-05-093-59/+59
| | | | | | | | | | | | | by default Change the flashchips entry for SST SST25VF080B to 1-byte writing. Tested-by: Ali Nadalizadeh. Corresponding to flashrom svn r486. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Chips like the SST SST25VF080B can only handle single byte writes outside ↵Carl-Daniel Hailfinger2009-05-096-16/+50
| | | | | | | | | | | | | | | | | | AAI mode Change SPI architecture to handle 1-byte chunk chip writing differently from 256-byte chunk chip writing. Annotate SPI chip write functions with _256 or _1 suffix denoting the number of bytes they write at maximum. The 1-byte chunk writing is cut-n-pasted to different SPI drivers right now. A later patch can move them to the generic spi_chip_write_1. Corresponding to flashrom svn r485. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Refine handling of spi_write_enable() failures to fix chip erases on ichspiCarl-Daniel Hailfinger2009-05-094-16/+54
| | | | | | | | | | | | | | | Until the ICH SPI driver can handle preopcodes as standalone opcodes, we should handle such special opcode failure gracefully on ICH and compatible chipsets. This fixes chip erase on almost all ICH+VIA SPI masters. Thanks to Ali Nadalizadeh for helping track down this bug! Corresponding to flashrom svn r484. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Add a dummy external flasher which just prints each operationCarl-Daniel Hailfinger2009-05-095-2/+104
| | | | | | | | | | | | Usage: flashrom --programmer dummy This is a great way to test flashrom without root access. Corresponding to flashrom svn r483. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* board_enable: split vendor name and board name into two fieldsUwe Hermann2009-05-091-42/+47
| | | | | | | | | | This will allow generation of supported boards for wiki output to be split to distinct columns. Corresponding to flashrom svn r482. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Add --programmer to help text and man pageCarl-Daniel Hailfinger2009-05-092-0/+6
| | | | | | | Corresponding to flashrom svn r481. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Make chipset list alphabetically ordered as the other listsUwe Hermann2009-05-081-39/+40
| | | | | | | Corresponding to flashrom svn r477. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Add external flasher supportCarl-Daniel Hailfinger2009-05-084-91/+233
| | | | | | | | | | | | | | | | | - Read/write accesses through function pointers - Command line parameter for internal/external flasher - Board and chipset setup moved to internal init function - Shutdown stuff moved to internal shutdown function As a side benefit, this will allow us to undo chipset write enable during shutdown. Tested by Uwe on real hardware. Corresponding to flashrom svn r476. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Re-add a line which got deleted in r473 by accidentCarl-Daniel Hailfinger2009-05-081-0/+2
| | | | | | | Corresponding to flashrom svn r475. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Keep list of boards alphabetically sortedUwe Hermann2009-05-081-20/+21
| | | | | | | | | | This is (among other things) useful/required for the -L output and the upcoming wiki-syntax output of supported boards. Corresponding to flashrom svn r474. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Don't assume flash is accessible via MMIO for chips with no read functionCarl-Daniel Hailfinger2009-05-083-13/+134
| | | | | | | | | | | | | | | | Flashrom assumes that the flash chip contents are available via mmap if no read function is defined. This special case is handled in lots of places all over the code. Remove the special case and use the read_memmapped function. Not only does this allow us to fix a read bug in flashrom I recently uncovered on ICH SPI, it also allows us to add support for Paraflasher to flashrom. Corresponding to flashrom svn r473. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
* Store and display chipset test status (not only chip status)Uwe Hermann2009-05-071-83/+91
| | | | | | | | | | | | The list of tested chipsets is synced from the wiki. Also, split the chipset vendor and name into two fields for easier wiki-syntax output later. Corresponding to flashrom svn r472. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Always print the flashrom version as first output lineCarl-Daniel Hailfinger2009-05-071-1/+3
| | | | | | | | | Suggested by Peter Stuge. Corresponding to flashrom svn r471. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
* Document uncertainty regarding ASD chipsCarl-Daniel Hailfinger2009-05-061-0/+1
| | | | | | | | | | | ASD chips may exist, but all available docs suggest they are just rebranded Winbond chips with Winbond IDs. The ASD vendor/chip IDs in flash.h are very likely just misinterpreted LHA headers. Corresponding to flashrom svn r470. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
OpenPOWER on IntegriCloud