Refine reprogram_opcode_on_the_fly to indicate wrong readcnt/writecnt combinations.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

git-svn-id: svn://coreboot.org/flashrom/trunk@1531 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
dummyflasher: Add a status register to SPI chips.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>  
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

git-svn-id: svn://coreboot.org/flashrom/trunk@1532 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add Winbond W836xx SuperI/O detection.
Add ITE IT8707F/IT8710F detection.

Note that we autodetect those chips, but we don't handle their flash
translation features automatically yet.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>


git-svn-id: svn://coreboot.org/flashrom/trunk@1533 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
dummyflasher.c: add support for SFDP by adding a new emulator chip: MX25L6436

The chip features a complete 1.0 SFDP JEDEC flash parameter table and also a
vendor-specific extension table (defining voltages, lock bits etc).
NB: the MX25L6436 uses the same RDID as the MX25L6405.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

git-svn-id: svn://coreboot.org/flashrom/trunk@1534 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for Eon EN25QH32.

Its ID was spotted in an descriptor region update by Jetway:
http://paste.flashrom.org/view.php?id=1217

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://coreboot.org/flashrom/trunk@1535 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Convert printf to msg_* where appropriate.
Clean up cli_output.c to be more readable.
Use enum instead of #define for message levels.
Kill a few exit(0) calls.
Print the command line arguments in verbose mode.
Move actions (--list-supported etc.) after argument sanity checks.
Reduce the number of code paths which have their own
programmer_shutdown().

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>


git-svn-id: svn://coreboot.org/flashrom/trunk@1536 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
ft2232_spi.c: add frequency divisor parameter.

This adds an optional argument when using the ft2232_spi programmer to set
the frequency divisor. The valid values for the divisor is any even integer
between 2 and 131072.

Signed-off-by: Samir Ibradžić <sibradzic@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://coreboot.org/flashrom/trunk@1537 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Remove sharplhf00l04.c.

The currently unreferenced function in sharplhf00l04.c does a standard
FWH block protection reset (writes 0 to the protection register) and a
standard FWH block erase.

Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

git-svn-id: svn://coreboot.org/flashrom/trunk@1538 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for PMC Pm39LV512.

This flash is like PMC model Pm39LV010 but capacity is 64kB.
Model ID was already defined. PREW works for me.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>

git-svn-id: svn://coreboot.org/flashrom/trunk@1539 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add logfile support to flashrom

Usage: flashrom --output logfile.txt

Logfile output has at least dbg2 verbosity or screen verbosity,
whichever is greater.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Tested on Linux, Windows and FreeBSD.
Acked-by: Idwer Vollering <vidwer@gmail.com>


git-svn-id: svn://coreboot.org/flashrom/trunk@1540 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Bus Pirate buffer management revamp

The buffer management of the Bus Pirate driver has been revamped to use
grow-only buffers with a reasonable initial default size so realloc()
will not have to be called in normal operation. A side effect is the
ability to switch to a static buffer without major hassle.
Handle OOM gracefully.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Patrick Georgi <patrick@georgi-clan.de>


git-svn-id: svn://coreboot.org/flashrom/trunk@1541 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Fix setting the divisor in ft2232_spi.

The patch that should have improved the clock divisor setting in r1537 made
it much worse: the divisor used was from an uninitialized buffer.

Signed-off-by: Ilya A. Volynets-Evenbakh <ilya@total-knowledge.com>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://coreboot.org/flashrom/trunk@1542 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Let the programmer driver decide how to do AAI transfers

Currently spi_aai_write() is implemented without an abstraction
mechanism for the programmer driver. This adds another function
pointer 'write_aai' to struct spi_programmer, which is set to
default_spi_write_aai (renamed spi_aai_write) for all programmers
for now.

A patch which utilises this abstraction in the dediprog driver will
follow.

Signed-off-by: Nico Huber <nico.huber@secunet.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/flashrom/trunk@1543 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add voltage change delays to dediprog driver

Some investigations have shown that the original dediprog driver waits
about 200ms after setting voltage up and before setting voltage down.
This patch adds those delays. It helps flash chips to come up in time.

Signed-off-by: Nico Huber <nico.huber@secunet.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/flashrom/trunk@1544 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Remove exit() call from show_id

The only caller is able to check the return code and handle it
correctly.

Signed-off-by: Niklas Söderlund <niso@kth.se>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/flashrom/trunk@1545 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add native SPI AAI write support to the Dediprog SF100 driver

To tell the programmer how to handle the data on the spi bus, a flag in
the fourth byte sent with the usb command is used. The second word was
mistaken for the size of the chunks sent over usb earlier. The third
byte (first of the second word) is now set to zero. This also adds some
checks for the size of data chunks sent over usb.

Signed-off-by: Nico Huber <nico.huber@secunet.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/flashrom/trunk@1546 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add board enable for MSI K9N SLI (MS-7250 VER:2.1)

Handle PCI Device ID 0x0360 for MCP55 ISA bridge GPIO as well.

Signed-off-by: Joshua Roys <roysjosh@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Tested-by: Stefan A. Scholtz


git-svn-id: svn://coreboot.org/flashrom/trunk@1547 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Check vendor_id for PCI based external programmers.

Restructure PCI device detection code.
Rename pcidev_validate to pcidev_readbar.

Note: Slight changes in behaviour are possible, especially on dual/quad
chip NICs which appear as more than one PCI device. Found devices are no
longer printed at _pinfo level, but rather at _pdbg level.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>


git-svn-id: svn://coreboot.org/flashrom/trunk@1548 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Hide hwaccess.h from public API.

Move hwaccess.h #include from flash.h to individual drivers.
libflashrom users need flash.h, but they do not care about hwaccess.h
and should not see its definitions because they may conflict with
other hardware access functions and #defines used by the libflashrom
user.

Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/flashrom/trunk@1549 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Document --output in the man page.
Add an examples section to the man page.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>


git-svn-id: svn://coreboot.org/flashrom/trunk@1550 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1