dediprog: fix SPI clock setting.

Avoid setting SPI speed on firmware versions < 5.0.0 and note this
limitation in the man page.
Use the correct offset of the "12M" element in the spispeeds array to
match our manpage and the default of Dediprog's dpcmd.

Signed-off-by: Patrick Georgi <patrick.georgi@secunet.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@1674 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Change warning regarding protected ICH regions.

There is no good reason to collect further log files of locked Intel-
based boards. Forward affected users directly to an explanation in
the wiki instead.

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@1675 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add W25Q...W series.

 - Use ".V" (and "_V" in macros) for 3.3V Winbond 25Q chips.
   Rename the existing chips and add a .voltage entry where it was missing.
 - Use ".W" (and "_W" in macros) for 1.8V Winbond 25Q chips.
 - Add W25Q20.W, W25Q40.W, W25Q80.W, W25Q16.W, W25Q32.W, W25Q64.W.
 Based on chromiumos' 469707f0d9b7d81b6c6bb2cace13f09db70f4382
 http://git.chromium.org/gitweb/?p=chromiumos/third_party/flashrom.git;a=commitdiff;h=469707f0d9b7d81b6c6bb2cace13f09db70f4382

Signed-off-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.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@1677 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
sbxxx: spibar[0] debug print refinements.

Newer models support a 66 MHz clock and fast reads.
We should probably distinguish the models better (as we do in ichspi)
and add support for frequency selection etc. For now this has to
suffice.

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@1678 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Fix unlocking function for most Atmel AT2[56]D* chips.

I broke unlocking them correctly in r1635 while refactoring (NB: the
commit log including the overly selfconfident statement about the
"bug in spi_disable_blockprotect_at25df()").

Affected chips have per sector protection bits and the write protection bits
in the status register do indicate if none, some or all sectors are protected.
It is possible to globally (un)lock all sectors at once but in a way that was
not anticipated when refactoring the spi25 unlocking functions into
spi_disable_blockprotect_generic(). To globally unprotect not only the
protection bits (2 and 3) have 0 to be written to them but also bits 4 and 5
which normally would not be touched by spi_disable_blockprotect_generic().
Some of the chips also support a permanent lockdown with fuses which we
do not handle yet.

To fix this without copying the whole method I introduce another mask
parameter to spi_disable_blockprotect_generic() namely unprotect_mask.
See verbose comments inline for details.

Also, prettyprint the status register after trying to disable the block
protection fails.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Tested-by: Chi Zhang <zhangchi866@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>

git-svn-id: svn://coreboot.org/flashrom/trunk@1679 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Warn if we skipped all blocks while writing.

Quick hack to print a warning if we skip all blocks in a write
process because they are already equal to the requested image. We
want something like this to make users aware... and some developers
who regularly fall for this too *coughcough*. There might be more
elegant solutions for this... patches welcome.

This does not work for erasing because we do that unconditionally.

Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Idwer Vollering <vidwer@gmail.com>

git-svn-id: svn://coreboot.org/flashrom/trunk@1680 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Introduce additional SPI status register helpers.

 - spi_prettyprint_status_register_default_welwip():
   It just prettyprints the plain hex value and the welwip bits.
 - spi_prettyprint_status_register_default_bp4():
   Prints the hex value, welwip, bp0-5 and srwd bits.
 - spi_disable_blockprotect_bp2_srwd(),
 - spi_disable_blockprotect_bp3_srwd() and
   spi_disable_blockprotect_bp4_srwd():
   Three new common block unprotection functions for the frequent
   cases where there is a status register lock bit at bit #7 and some
   block protection bits at bits #2-#4, #2-#5 and #2-#6 respectively.

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@1681 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Introduce spi_block_erase_db().

Used for page erase on some chips (e.g. Numonyx M45PE and
Sanyo LF25FW series).

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@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@1682 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for Nantronics N25 series.

Add...
 - N25S10
 - N25S20
 - N25S40
 - N25S80
 - N25S16

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@1683 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for all Sanyo LE25FW chips.

Add...
 - Sanyo LE25FW403A
 - Sanyo LE25FW418A
 - Sanyo LE25FW806
 - Sanyo LE25FW808

Also, fix wrong description of Sanyo LE25FW203A.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@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@1684 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for some GigaDevice GD25* chips.

Add...
 - GigaDevice GD25T80
 - GigaDevice GD25Q10
 - GigaDevice GD25Q512

Also, improve some others.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@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@1685 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for Numonyx M45PE series.

Add...
 - M45PE10
 - M45PE20
 - M45PE40
 - M45PE80
 - M45PE16

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@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@1686 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for Eon EN25S series.

Add...
 - EN25S10
 - EN25S20
 - EN25S40
 - EN25S80
 - EN25S16
 - EN25S32
 - EN25S64

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@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@1687 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for more Eon EN25QH chips.

Add...
 - EN25QH64
 - EN25QH128
 - EN25QH256 (defunct due to addressing)

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@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@1688 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for AMIC A25LQ16 and A25LQ64.

Also, refine unlocking of A25L032, A25LQ32A and A25LQ032.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@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@1689 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for Micron/Numonyx/ST M25PX80.

Also, refine status register prettyprinting and unlocking of all family
members and add OTP details.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@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@1690 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for Spansion S25FL2 chips.

Add...
 - S25FL204K
 - S25FL208K
 - S25FL216K (same ID as S25FL116K)

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@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@1691 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for Spansion S25FL...S chips.

Add...
 - S25FL128S
 - S25FL256S uniform version (defunct due to addressing)
 - S25FL512S uniform version (defunct due to addressing)

Merge Intel S33 status register functions with this one's.

Signed-off-by: Nikolay Nikolaev <evrinoma@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@1692 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Add support for remaining Numonyx (Micron) N25Q chips.

Add...
 - N25Q128..3E
 - N25Q128..1E
 - N25Q256..1E (defunct due to addressing)
 - N25Q256..3E (defunct due to addressing)
 - N25Q512..1E (defunct due to addressing)
 - N25Q512..3E (defunct due to addressing)
 - N25Q00A..3G (defunct due to addressing)

Also, refine existing family members.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@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@1693 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
print_wiki: Fixes, explanation re. flash chips, links to footnotes.

 - Escape mainboard notes in the wiki output with <nowiki> (this became
   necessary because MediaWiki started to convert <mark@zl2tod.net> to <mark>).
 - Add explanations at the top of the flash chip table in the wiki.
 - Add links to the footnotes of mainboards and laptops similarly to
   what MediaWiki does: link from the reference to the footnote and
   vice versa too. Also, check for truncations of the footnotes due
   to the limited buffer.
 - Fix a typo introduced in r1555.

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@1694 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1