1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-26 22:52:34 +02:00

1726 Commits

Author SHA1 Message Date
Stefan Tauner
3285d7f2c0 Allow physmap_common() to round address ranges to page boundaries
Automatically round address ranges requested from rphysmap() to page
boundaries. Other physmap() variants were not changed so this is
safe regarding unmapping.

I had also to shorten the readbility defines for the physmap_common
parameters to make the calls fit a single line.

Corresponding to flashrom svn r1715.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-14 16:28:19 +00:00
Stefan Tauner
7fb5aa049b Automatically unmap physmap()s
Similarly to the previous PCI self-clean up patch this one allows to get rid
of a huge number of programmer shutdown functions and makes introducing
bugs harder. It adds a new function rphysmap() that takes care of unmapping
at shutdown. Callers are changed where it makes sense.

Corresponding to flashrom svn r1714.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-08-14 15:48:44 +00:00
David Hendricks
36e9f4b359 Add getrevision.sh utility script
This allows to retrieve various data from SCM systems (git and svn) and
use them in the build process to better indicate which source was used.
For now only use it for the upstream (i.e. svn) revision number, which
was previously implemented by an awful line in the Makefile.

Corresponding to flashrom svn r1713.

Signed-off-by: David Hendricks <dhendrix@google.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-14 14:47:26 +00:00
Stefan Tauner
241e9d5e44 Increase flashrom release number to 0.9.7
Corresponding to flashrom svn r1710.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: David Hendricks <dhendrix@google.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
v0.9.7
2013-08-13 22:13:01 +00:00
Stefan Tauner
dbac46c3ef Add a bunch of new/tested stuff and various small changes 19
Tested mainboards:
OK:
 - ASUS P8H77-V LE
   http://www.flashrom.org/pipermail/flashrom/2013-June/011127.html
 - HP Pegatron IPMEL-AE (Evans-GL6)
   Reported by Idwer on IRC
 - MSI MS-7379 (G31M)
   http://paste.flashrom.org/view.php?id=1726
 - MSI MS-7816 (H87-G43)
   http://www.flashrom.org/pipermail/flashrom/2013-July/011349.html
 - MSI MS-9830 (IM-945GSE-A, A9830IMS)
   http://paste.flashrom.org/view.php?id=1730
 - Supermicro X8SAX
   http://paste.flashrom.org/view.php?id=1717
NOT OK:
 - Intel D2700MUD
   http://paste.flashrom.org/view.php?id=1723
 - Intel DQ45CB
   http://www.flashrom.org/pipermail/flashrom/2013-August/011369.html

Chipsets:
 - Add PCI ID for Intel's Coleto Creek.
 - Mark Intel H87 (0x8c4a) as OK.
   http://www.flashrom.org/pipermail/flashrom/2013-July/011349.html

Miscellaneous:
 - ichspi: Fix printing address ranges if space is divided by FPB.
 - Tiny other stuff.

Corresponding to flashrom svn r1709.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-13 22:10:41 +00:00
Carl-Daniel Hailfinger
20a36baf56 Abort on unused programmer parameters
An unused programmer parameter is a sign that the user wanted to either
do something not supported by the programmer or misspelled a parameter
which may be essential for the given programmer.

Aborting is the only safe choice. If the programmer parameter is unused
because of an error during programmer init, aborting would have happened
anyway due to that error.

Corresponding to flashrom svn r1708.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-13 07:09:57 +00:00
Stefan Tauner
c4f44df55f Fix verification operation
I broke this in r1702 where I enabled avoidance of the verification step if
we did not modify anything in the erase/write step. The problem is that
all_skipped is initialized to true and hence it would only ever verify if
there have been changes noted in the erase/write step. This obviously
breaks the verification operation (-v/--verify) because there we never
enter the erase/write loop.

The better alternative would be to enable (the implicit) verification
in the write loop and not in cli_classic.c. This would require a bigger
change due to the existance of dont_verify_it. Eventually this is the
right thing to do but not so shortly before a release.

Corresponding to flashrom svn r1707.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-08-12 22:58:43 +00:00
Stefan Tauner
463dd6953e Detect AMD Yangtze (found in Kabini and Tamesh)
The PCI ID of the LPC bridge doesn't change between Hudson-2/3/4 and
Yangtze (Kabini/Temash) but the SPI interface does. Bail out in case we
detect Yangtze and add infrastructure to distinguish other families too for
further refactorings.

Also, add ASRock IMB-A180 to the laptop whitelist and refine the IMC
warning a bit.

Tested on ASRock IMB-A180 with and w/o USE_YANGTZE_HEURISTICS, and
by Chris Goodrich from Sage on
 - SB600
 - SB700
 - SB800
 - Hudson 3 (A70M)
 - Kabini

Corresponding to flashrom svn r1706.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-08 12:00:19 +00:00
David Woodhouse
d2a7e873f3 dediprog: Fix crash if usb_open() fails
Corresponding to flashrom svn r1705.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-07-30 09:34:44 +00:00
Rudolf Marek
70e145989b sbxxx: Handle active IMCs in AMD chipsets
Detect and temporarily disable the IMC while accessing the flash.
Disable writes on default, but allow the user to enforce it.

Corresponding to flashrom svn r1704.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: David Hendricks <dhendrix@google.com>
2013-07-25 22:58:56 +00:00
Stefan Tauner
1aa80b0648 Rename Numonyx and ST (SGS/Thomson) chips to Micron
Micron acquired Numonyx and asked us to change the vendor names to
"Micron". For the chips clearly emerging from the former
manufacturers we (will) use "Micron/Numonyx/ST" and the original
name for the rest. Resorting the chip entries makes the diff
unreadable, hence the stand-alone commit.

Corresponding to flashrom svn r1703.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-07-25 22:58:51 +00:00
Stefan Tauner
0554ca5cd3 Add a bunch of new/tested stuff and various small changes 18
Tested mainboards:
OK:
 - ASUS C60M1-I
   http://www.flashrom.org/pipermail/flashrom/2013-February/010578.html
 - ASUS P8H77-I
   http://www.flashrom.org/pipermail/flashrom/2013-March/010607.html
 - ASUS P8H77-M
   http://www.flashrom.org/pipermail/flashrom/2013-May/010994.html
 - ASUS P8P67 LE (B2)
   http://www.flashrom.org/pipermail/flashrom/2013-May/010972.html
 - Elitegroup GeForce6100PM-M2 (V3.0)
   http://www.flashrom.org/pipermail/flashrom/2013-July/011177.html
 - GIGABYTE GA-P55A-UD7
   http://www.flashrom.org/pipermail/flashrom/2013-July/011302.html
 - MSI B75MA-E33 (MS-7808)
   http://www.flashrom.org/pipermail/flashrom/2013-March/010659.html
 - MSI H77MA-G43 (MS-7756)
   http://www.flashrom.org/pipermail/flashrom/2013-April/010853.html
 - MSI KA780G (MS-7551)
   http://paste.flashrom.org/view.php?id=1617
 - SAPPHIRE IPC-E350M1
   Reported by xvilka on IRC
 - Supermicro X8DTG-D
   http://www.flashrom.org/pipermail/flashrom/2013-July/011305.html
NOT OK:
 - ASRock Fatal1ty Z77 Performance
   http://www.flashrom.org/pipermail/flashrom/2013-January/010467.html
 - ASRock Z68 Extreme4
   http://www.flashrom.org/pipermail/flashrom/2013-May/010984.html
 - ASUS P8B75-M LE
   http://www.flashrom.org/pipermail/flashrom/2013-April/010867.html
 - ASUS P8P67-M PRO
   http://www.flashrom.org/pipermail/flashrom/2013-February/010541.html
 - ASUS P8Z68-V LE
   http://www.flashrom.org/pipermail/flashrom/2013-February/010582.html
 - Intel DQ77MK
   http://paste.flashrom.org/view.php?id=1603
 - Supermicro X9DRD-7LN4F
   http://paste.flashrom.org/view.php?id=1582
 - Supermicro X9SCE-F
   http://www.flashrom.org/pipermail/flashrom/2013-February/010588.html
 - Supermicro X9SCM-F
   http://www.flashrom.org/pipermail/flashrom/2013-February/010527.html
 - Tyan S7066
   http://www.flashrom.org/pipermail/flashrom/2013-March/010630.html

Chipsets:
 - Marked Intel B75 as tested
   http://www.flashrom.org/pipermail/flashrom/2013-March/010659.html
 - Marked Intel H77 as tested
   http://www.flashrom.org/pipermail/flashrom/2013-March/010607.html
 - Removed 10de:03e2 because it is apparently the MCP61 host bridge.
   It was reclassified to Host Bridge in the PCI device ID database and there
   is at least one report suggesting this configuration too:
   http://www.flashrom.org/pipermail/flashrom/2012-August/009716.html
 - Added MCP89 which hopefully works with the code for previous versions.
   Thanks to James Laird for submitting this change.

Tested flash chips:
 - Atmel AT25DF641(A) to PREW (+PREW)
   http://www.flashrom.org/pipermail/flashrom/2013-June/011113.html
 - Atmel AT25F512 to PREW (+PREW)
   http://www.flashrom.org/pipermail/flashrom/2013-April/010904.html
   Also, change its ID according to Modification of PCN SC040401A:
   "There has been a change in the returned value of the Product Identification
   (RDID) command, the AT25F512A RDID code is 65h compared to 60h from
   the AT25F512 product."
   It seems to be quite likely that all AT25F512 are fully functional relabeled
   AT25F1024 chips. There are even some hints in the datasheet:
   in table 6 they stress that address pin 16 needs to be low under all circum-
   stances; while continuous reads can wrap around on the AT25F1024 the DS
   notes "For the AT25F512, the read command must be terminated when the
   highest address (00FFFF) is reached." OTOH the lock bit semantics are
   different, but this has not been tested thoroughly
 - Atmel AT25F512A to PREW (+PREW)
   http://paste.flashrom.org/view.php?id=1569
 - Eon EN25F05 to PREW (+PREW)
   http://paste.flashrom.org/view.php?id=1571
 - Macronix MX25L12805(D) to PREW (+REW)
   http://www.flashrom.org/pipermail/flashrom/2013-April/010913.html
 - Spansion S25FL256S......0 and S25FL512S to P/!R!E!W (+P)
   Tested by Stefan Tauner
 - Micron/Numonyx/ST M25PX80 to PREW (+PREW)
   Tested by Stefan Tauner
 - Micron/Numonyx/ST N25Q032..3E and N25Q128..3E to PREW (+PREW)
   Tested by Stefan Tauner
 - Micron/Numonyx/ST N25Q256..3E and N25Q512..3G to P/!R!E!W (+P)
   Tested by Stefan Tauner
 - SST SST25VF040B to PREW (+PREW)
   http://paste.flashrom.org/view.php?id=1574
 - SST SST25VF040B.REMS to PREW (+EW)
   http://paste.flashrom.org/view.php?id=1575
 - ST M25P05-A to PREW (+PREW)
   http://paste.flashrom.org/view.php?id=1576
 - ST M29W512B to PREW (+W)
   http://www.flashrom.org/pipermail/flashrom/2013-March/010635.html
 - Winbond W25Q64.W to PREW (+PREW)
   Tested by the chromiumos guys.
 - Winbond W25Q128.V to PREW (+REW)
   http://www.flashrom.org/pipermail/flashrom/2013-June/011108.html
 - Winbond W25X20 to PREW (+PREW)
   http://www.flashrom.org/pipermail/flashrom/2013-May/010990.html

Miscellaneous:
 - Add Lenovo X201 to the laptop whitelist.
 - Add chip IDs for the ESMT F25L..QA family.
 - Add chip IDs for a few Macronix MX25 models.
 - The list of flashchips is not sorted strictly alphabetically and should not be
   either. Refine the comment explaining the scheme on top of the list.
 - Support -L output of chip sizes with up to 6 decimal places (up to 4 Gb).
 - Use z length modifier in (more) prints for size_t types.
 - Remove chips >16MB again because our current implementation of memory mapping
   the flash chip violates common rules by mapping a window as large as the chip.
   This leads to failing mmaps as can be seen here:
   http://paste.flashrom.org/view.php?id=1695
 - Document spispeed parameter of linux_spi (and fix some leaks).
 - Rephrase the "multiple chips detected" message because it was confusing.
 - Skip verification step if the image is equal to the flash contents.
 - Tiny other stuff.

Corresponding to flashrom svn r1702.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-07-25 22:54:25 +00:00
Stefan Tauner
305e0b999a Uintptr_t-ify map_flash_region functions
Unsigned long is not the right type for manipulating pointer values.
Since C99 there are suitable unsigned and signed types available, namely
uintptr_t and intptr_t respectively.

Use them in functions assigned to programmers' map_flash_region fields and
their callers where applicable.

This patch also changes the display width of all associated address values in
physmap.c to 16/8 hex characters depending on the actual size by
introducing a macro PRIxPTR_WIDTH and exploiting printf's * field width
specifier.

Corresponding to flashrom svn r1701.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-07-17 23:46:44 +00:00
Stefan Tauner
4a03865cd9 print.c: Fix multiline support
- Use the reentrant tokenizer version strtok_r to break up vendor and model
   names in print.c.
 - Add implementation of strtok_r for mingw (strtok_r is POSIX only).
 - Free allocated temporary memory again.

Corresponding to flashrom svn r1700.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-07-17 09:28:00 +00:00
Stefan Tauner
136388ffa9 Differentiate ultimate error messages depending on programmer used
With every newly supported programmer the information regarding reboots
on failures becomes more ridiculous. With this patch it is only shown when
the internal programmer module was selected.

Example outputs for external programmers:
1) non-fatal:
[…]
Reading current flash chip contents... done. FAILED at 0x00000000! Expected=0xff, Found=0x28, failed byte count from 0x00000000-0x0001ffff: 0x1fde7
ERASE FAILED!
FAILED!
Uh oh. Erase/write failed. Checking if anything changed.
Good. It seems nothing was changed.
Writing to the flash chip apparently didn't do anything.
Please check the connections (especially those to write protection pins) between
the programmer and the flash chip. If you think the error is caused by flashrom
please report this on IRC at chat.freenode.net (channel #flashrom) or
mail flashrom@flashrom.org, thanks!

2) fatal:
[…]
Verifying flash... FAILED at 0x00000000! Expected=0x0f, Found=0xff, failed byte count from 0x00000000-0x0001ffff: 0x1fde6
Your flash chip is in an unknown state.
Please report this on IRC at chat.freenode.net (channel #flashrom) or
mail flashrom@flashrom.org, thanks!

Corresponding to flashrom svn r1699.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: David Hendricks <dhendrix@google.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-07-15 10:47:53 +00:00
Stefan Tauner
c2333751c4 Use uintptr_t for chipaddr instead of unsigned long
Corresponding to flashrom svn r1698.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-07-13 23:31:37 +00:00
Carl-Daniel Hailfinger
11990da1d3 Various cross-platform fixes
Improve compilation with libpayload (compiling flashrom.c and
linking is still broken):
 - disable Ponyprog (which enforced serial.c compilation)
 - make errno available where it is needed

Fix internal.c for non-x86 and enable cb parsing on ARM.

Fix mingw builds by using its __USE_MINGW_ANSI_STDIO macro
and gnu_printf definition for printf format style checking.
See http://sourceforge.net/apps/trac/mingw-w64/wiki/gnu%20printf
This requires inclusion of stdio.h in flash.h.

Fix order of libraries in the Makefile:
FEATURE_LIBS needs to come *after* PCILIBS in case ZLIB is needed by it.

Corresponding to flashrom svn r1697.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-07-13 23:21:05 +00:00
Stefan Tauner
6bf5fe78f1 Add support for AMD Geode's MSR on OpenBSD
Previously the default implementation was used, which always failed.
On other systems than the Geode the code is not equal to that anymore,
but should not explode because setup_cpu_msr() returns an error and
therefore no other MSR functions should be called.

Corresponding to flashrom svn r1696.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Tested-by Leonardo Guardati <leonardo@guardati.it>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-07-13 21:18:32 +00:00
Stefan Tauner
95b4b6d9f6 Fix hwaccess (again)
I completely forgot about NetBSD in r1638 which was broken since then.
Also, on OpenBSD use iopl again and refine the warning in case we have
insufficient privileges.
Thanks to Jonathan A. Kollasch for his help in getting the details right.

Corresponding to flashrom svn r1695.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-07-13 20:55:33 +00:00
Stefan Tauner
1c356bb6c1 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.

Corresponding to flashrom svn r1694.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-07-11 13:48:52 +00:00
Nikolay Nikolaev
6f59b0bc51 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.

Corresponding to flashrom svn r1693.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-28 21:29:51 +00:00
Nikolay Nikolaev
c80c4a35a0 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.

Corresponding to flashrom svn r1692.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-28 21:29:44 +00:00
Nikolay Nikolaev
0ec2f7e7e0 Add support for Spansion S25FL2 chips
Add...
 - S25FL204K
 - S25FL208K
 - S25FL216K (same ID as S25FL116K)

Corresponding to flashrom svn r1691.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-28 21:29:36 +00:00
Nikolay Nikolaev
b8e212c395 Add support for Micron/Numonyx/ST M25PX80
Also, refine status register prettyprinting and unlocking of all family
members and add OTP details.

Corresponding to flashrom svn r1690.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-28 21:29:27 +00:00
Nikolay Nikolaev
d07fde6884 Add support for AMIC A25LQ16 and A25LQ64
Also, refine unlocking of A25L032, A25LQ32A and A25LQ032.

Corresponding to flashrom svn r1689.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-28 21:29:21 +00:00
Nikolay Nikolaev
c08542b977 Add support for more Eon EN25QH chips
Add...
 - EN25QH64
 - EN25QH128
 - EN25QH256 (defunct due to addressing)

Corresponding to flashrom svn r1688.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-28 21:29:14 +00:00
Nikolay Nikolaev
d0e3ea1470 Add support for Eon EN25S series
Add...
 - EN25S10
 - EN25S20
 - EN25S40
 - EN25S80
 - EN25S16
 - EN25S32
 - EN25S64

Corresponding to flashrom svn r1687.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-28 21:29:08 +00:00
Nikolay Nikolaev
01dac17ec5 Add support for Numonyx M45PE series
Add...
 - M45PE10
 - M45PE20
 - M45PE40
 - M45PE80
 - M45PE16

Corresponding to flashrom svn r1686.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-28 21:29:03 +00:00
Nikolay Nikolaev
3f3390b22c Add support for some GigaDevice GD25* chips
Add...
 - GigaDevice GD25T80
 - GigaDevice GD25Q10
 - GigaDevice GD25Q512

Also, improve some others.

Corresponding to flashrom svn r1685.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-28 21:28:56 +00:00
Nikolay Nikolaev
384de8e745 Add support for all Sanyo LE25FW chips
Add...
 - Sanyo LE25FW403A
 - Sanyo LE25FW418A
 - Sanyo LE25FW806
 - Sanyo LE25FW808

Also, fix wrong description of Sanyo LE25FW203A.

Corresponding to flashrom svn r1684.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-28 21:28:49 +00:00
Stefan Tauner
b6b00e99aa Add support for Nantronics N25 series
Add...
 - N25S10
 - N25S20
 - N25S40
 - N25S80
 - N25S16

Corresponding to flashrom svn r1683.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-06-28 21:28:43 +00:00
Nikolay Nikolaev
579f1e0b67 Introduce spi_block_erase_db()
Used for page erase on some chips (e.g. Numonyx M45PE and
Sanyo LF25FW series).

Corresponding to flashrom svn r1682.

Signed-off-by: Nikolay Nikolaev <evrinoma@gmail.com>
Reviewed-by: Steven Zakulec <spzakulec@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-28 21:28:37 +00:00
Stefan Tauner
278ba6e967 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.

Corresponding to flashrom svn r1681.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-28 21:28:27 +00:00
Stefan Tauner
682122bce7 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.

Corresponding to flashrom svn r1680.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Idwer Vollering <vidwer@gmail.com>
2013-06-23 22:15:39 +00:00
Stefan Tauner
cecb2c56d0 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.

Corresponding to flashrom svn r1679.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Tested-by: Chi Zhang <zhangchi866@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-20 22:55:41 +00:00
Stefan Tauner
0466c819e2 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.

Corresponding to flashrom svn r1678.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-16 10:30:08 +00:00
Yung-Chieh Lo
b13d4e6992 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

Corresponding to flashrom svn r1677.

Signed-off-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-09 14:00:46 +00:00
Stefan Tauner
27cb34b8a9 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.

Corresponding to flashrom svn r1675.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-06-01 00:06:12 +00:00
Patrick Georgi
efe2d43056 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.

Corresponding to flashrom svn r1674.

Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-05-23 21:47:46 +00:00
Stefan Tauner
e659d2dfe3 dediprog: add support for chip select
Thanks to the traces captured and tests done by Martin Roth, and confirmed
by tests and analysis by Joshua Zarr too, we can now use both target chips
on the Dediprog SF100.

Corresponding to flashrom svn r1673.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-05-03 21:58:28 +00:00
Stefan Tauner
730e7e74eb Update spi_get_erasefn_from_opcode()
We forgot to add a few SPI erase functions to the helper function that is
used for SFDP. Also, sort the declarations in the header.

Corresponding to flashrom svn r1672.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-05-01 14:04:19 +00:00
Stefan Tauner
f44516121a Add support for PMC Pm25LD series
This patch adds support for
 - Pm25LD256C
 - Pm25LD512(C)
 - Pm25LD010(C)
 - Pm25LD020(C)
 - Pm25LD040(C)

These seem to be the successors of the Pm25LV series.
The main difference seems to be the dual I/O and additional erase opcodes.
Some support an additional, complex locking register (maybe all of the
above, but available datahsheets do not indicate it for all).

The Pm25LD512C was tested by Chi Zhang:
http://paste.flashrom.org/view.php?id=1579

Corresponding to flashrom svn r1671.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-04-19 01:59:15 +00:00
Stefan Tauner
3f5e35db4b Refine PMC Pm25LV series
- Add missing bits and resort chips
 - Refine Pm25LV512(A) and Pm25LV010
   Due to manufacturer ID continuation this one needs a new probing
   function: probe_spi_res3() which should be refactored in the future.
   The datasheet describes a very weird order of ID bytes:
   Vendor byte, model byte, vendor continuation byte. Let's pretend we did
   not read that or the datasheet is bogus (although the datasheet of the
   successor series describes the same but luckily additionally to RDID).
 - Add Pm25LV010A
   This was tested by Chi Zhang:
   http://paste.flashrom.org/view.php?id=1573

Corresponding to flashrom svn r1670.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-04-19 01:58:33 +00:00
Stefan Tauner
e33c40eb7d Initialize sp_fd and fix baud rate setting on windows
Corresponding to flashrom svn r1669.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-04-13 00:29:30 +00:00
Stefan Tauner
363fd7e827 Get rid of perror()
It prints to stderr and that's not what we want necesserily;
using msg_*err gives us more control.

Corresponding to flashrom svn r1668.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-04-07 13:08:30 +00:00
Maksim Kuleshov
73dc0db725 Usleep() is not found in all versions of MinGW, use Sleep() on Windows
Handle long sleeps on non-Windows correctly.

Corresponding to flashrom svn r1667.

Signed-off-by: Maksim Kuleshov <mmcx@mail.ru>
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-04-05 08:06:10 +00:00
Stefan Tauner
02437458a6 Refine granularity handling in preparation of AT45DB series support
This adds a number of new granularitie and refines the handling of
n-byte granularities by extracting the respective code into a helper
function which reduces the pain of the above significantly.

Corresponding to flashrom svn r1666.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-04-01 19:34:53 +00:00
Stefan Tauner
52b6e9dc54 Enable serprog on Windows
Sockets are not ported (yet).

Tested on Windows 7 with my Atmega32U2 serprog implementation.
http://paste.flashrom.org/view.php?id=1566

Corresponding to flashrom svn r1665.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Signed-off-by: Idwer Vollering <vidwer@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-04-01 00:46:05 +00:00
Stefan Tauner
f966cc4810 serial.c: be more pedantic
Check more return codes and close the file handle in case of errors in
sp_openserport().

Corresponding to flashrom svn r1664.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-04-01 00:45:57 +00:00
Stefan Tauner
79587f565f Replace native calls in serprog with wrapper calls
Read(), write(), usleep() are replaced.

Corresponding to flashrom svn r1663.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Signed-off-by: Idwer Vollering <vidwer@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-04-01 00:45:51 +00:00