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

1634 Commits

Author SHA1 Message Date
Kyösti Mälkki
c31243e173 Add support for Winbond W39F010/W39L010/W39L020
W39F010 is a 128kB parallel 5V flash chip, 16k bootblocks.
W39L010 is a 128kB parallel 3.3V flash chip, 8k bootblocks.
W39L020 is a 256kB parallel 3.3V flash chip, 64k/16k bootblocks.

The W39F010 code was tested with a satasii programmer. The first write
attempt after an erase returned with verify failure, but the second
write attempt was succesful:
http://paste.flashrom.org/view.php?id=1418

Corresponding to flashrom svn r1620.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-28 01:50:08 +00:00
Stefan Tauner
78ffbeaa02 Do not read the flash chip twice in verification mode
Kyösti Mälkki noticed that we unnecessarily read the flash chip twice when
called with --verify. The first one is the mandatory read before everything
(to be able to detect the seriousness of errors), but the second one is not
necessary because we can just use the former for the comparison.

This introduces a small output change: previously we printed ERASE or
VERIFY depending on the callee. This special case has been dropped
because it is unnecessary to print it (and wrong for the verification
function to need to know why it is verifying exactly).
If an erase fails we mention that fact explicitly already, similar for verify.

Corresponding to flashrom svn r1619.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-27 15:36:56 +00:00
Stefan Tauner
92fefc921a serprog: add opcode to control the programmer's output drivers
This allowed me to let the clips remain attached on my D946GZIS while
playing with coreboot/serialice.

Corresponding to flashrom svn r1618.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-27 00:34:23 +00:00
Stefan Tauner
0d82e952f2 serprog: move the macro list to its own header file
Corresponding to flashrom svn r1617.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-27 00:34:18 +00:00
Stefan Tauner
94b39b47e4 Add support for Atmel AT26DF041
Wicked chip: No WRSR, no write enable command (but swallows our
default one without a problem), supports an auto-erasing page write
(but even without that page writes are recommended to write the
whole page i.e. operate on a completely erased page), mad
requirements on block refreshments if only partly written.

Found on my Intel D946GZIS and tested with my serprog in situ.
Using the page write by setting JEDEC_BYTE_PROGRAM to 0x11 and using
the spi_chip_write_256 command greatly improves performance and works
flawlessly.

Corresponding to flashrom svn r1616.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-27 00:06:02 +00:00
Stefan Tauner
d956f82249 Add support for Numonyx N25Q016 and N25Q032
The 32Mb version has 1.8V and 3.0V versions, the smaller one 1.8V only
(or Numonyx/Micron forgot to publish it). Another difference is that the
16Mb chip has 32 kB subsectors (erase opcode 0x52). As long as there
are no funky configurations like for the 128Mb chips, we got the smaller
parts covered with this change.

Corresponding to flashrom svn r1615.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-26 16:49:15 +00:00
Niklas Söderlund
ede2fa4d1e Remove exit calls from print_supported_chips
Propagate the error code using return values instead, but let cli_classic.c
still decide the ultimate return value of the process.
Also, remove setting the ret value again after print_supported_wiki() - 
success is the default.

Corresponding to flashrom svn r1614.

Signed-off-by: Niklas Söderlund <niso@kth.se>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-23 13:06:46 +00:00
Stefan Tauner
d7d423bbc1 Add a bunch of new/tested stuff and various small changes 15
Tested Mainboards:
OK:
 - Foxconn P55MX
   http://www.flashrom.org/pipermail/flashrom/2012-October/010002.html

Tested flash chips:
 - Eon EN25F64 to PR (+PR)
   http://paste.flashrom.org/view.php?id=1426
 - Macronix MX25L1005 to PREW (+PREW)
   http://www.flashrom.org/pipermail/flashrom/2012-October/010004.html
 - Set SST39VF512 to PREW (+W)
   http://www.flashrom.org/pipermail/flashrom/2012-September/009958.html

Tested chipsets:
 - Z77 (only reading was really tested)

Miscellaneous:
 - Fix ft2232_spi's parameter parsing.
 - Fix nicrealtek's init (always segfaulted since r1586 oops).
 - Add another T60 variant to the laptop whitelist.
 - Improve message shown when image file size does not match flash chip
 - Refine messages regarding the flash descriptor override strap according
   to the findings by Vladislav Bykov on his P55MX.
 - Fix the ID of EN25F64.
 - Demote and clarify debug message in serprog_delay().
 - Minor other cleanups.

Corresponding to flashrom svn r1613.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-20 09:13:16 +00:00
David Hendricks
99f947ddc8 Differentiate Numonyx N25Q064 1.8V and 3.0V versions
This patch differentiates between the N25Q064 1.8V version and 3.0V
version which have different JEDEC IDs.

It extends the chip name to include more characters of the part
number. The first two of those characters indicate the process
technology (65nm) and feature set (hold pin etc.), neither of which
matter for flashrom at the moment. The third and fourth characters
specify voltage and block/sector size and uniformity, which are
important and hence included.

To abstract the irrelevant portions of the part number leading up to
the characters we care about, dots are used. This helps prevent
unwanted changes in chip name that can break fragile scripts and
confuse people. More about this schema here:
http://www.flashrom.org/pipermail/flashrom/2012-July/009595.html

Corresponding to flashrom svn r1612.

Signed-off-by: David Hendricks <dhendrix@google.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-04 14:41:20 +00:00
Stefan Tauner
9e349e43c4 Add support for SST's 25WF series of SPI flash chips
This includes SST25WF512, SST25WF010, SST25WF020 and SST25WF040.
They require a VCC of 1.65 - 1.95V, which is why i could not test them.
The SOIC version of the SST25WF512 is used on an AMD X300-based
graphics card i own.

Corresponding to flashrom svn r1611.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-10-01 22:45:08 +00:00
Stefan Tauner
3e515e2883 Cleanup ft2322.c and add more detail to error messages
- Use libftdi's error string to add more detail.
 - Add full stops to messages.
 - Minor white space fixes.

Corresponding to flashrom svn r1610.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-26 00:48:16 +00:00
Ilya A. Volynets-Evenbakh
2c714ab224 Add support for FT232H
For older versions of libftdi we define TYPE_232H ourselves and this
seems to be enough to get at least basic support (and we don't need
more than that AFAICT).

Corresponding to flashrom svn r1609.

Signed-off-by: Ilya A. Volynets-Evenbakh <ilya@total-knowledge.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-26 00:47:09 +00:00
Stefan Tauner
fbc71ac494 Add support for all 4 possible channels to the ft2232_spi programmer
Add a check to validate the selected channel/interface, which not even
libftdi seems to do yet.
This patch changes default behavior: the new default channel/interface is A.
Also, this patch uses the word 'channel' in addition or in place of 'interface'
where possible without too much hassle because it is the term FTDI uses.

Corresponding to flashrom svn r1608.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-26 00:46:02 +00:00
Stefan Tauner
fd0d413537 Introduce a compile time option to select a default programmer
Heavily influenced by a discussion with (and based on code from) Peter Stuge.
Please read the comment in the Makefile before using this option.

Corresponding to flashrom svn r1607.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Peter Stuge <peter@stuge.se>
2012-09-25 21:24:55 +00:00
Stefan Tauner
98feaa5c2c Whitelist known working Thinkpads of the T60 and X60 series
This should get rid of the need to specify the laptop force
parameter on T60 and X60 series Thinkpads (including T60s and X60s)
that are using one of the Intel 94x northbridges and are known to have
no interfering EC. Please note that although the EC is no problem, flashrom
is not able to access the entire flash chip with the vendor BIOS, see the
coreboot wiki for details: http://www.coreboot.org/Lenovo_x60x

Corresponding to flashrom svn r1606.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
2012-09-25 21:08:41 +00:00
Stefan Tauner
fa9fa7131a Fix flashrom running on boards with coreboot
In r1577 we removed the discrimination of coreboot IDs and user-specified
mainboards. The problem is that the board enable code required to find
a board enable if either of these model strings were set. Therefore boards
running coreboot that do not need a board enable failed to execute flashrom
since then. This patch fixes this by handling coreboot IDs and user-supplied
IDs differently again.

Corresponding to flashrom svn r1605.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Idwer Vollering <vidwer@gmail.com>
2012-09-24 21:29:29 +00:00
Stefan Tauner
4e6d346c6e Fix memleaks in dmi.c
In dmi_init() we populate static char *dmistrings[] with values that get
later compared in dmi_match(). Those strings are actually strduped in
get_dmi_string() and hence need to be freed later. This patch accomplishes
this by registering another shutdown method. Also, the tangling pointers are
nulled when the memories are freed.

This bug was found thanks to valgrind.

Corresponding to flashrom svn r1604.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-09-23 12:14:28 +00:00
Stefan Tauner
e0ff1652a6 Fix a memleak in the dummyflasher
Emu_persistent_image was not freed correctly.

This bug was found thanks to valgrind.

Corresponding to flashrom svn r1603.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-09-22 22:56:09 +00:00
Stefan Tauner
5609f9d408 Generify a25.c's SRWD printing function and move it to spi25.c
Corresponding to flashrom svn r1602.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-22 01:38:06 +00:00
Stefan Tauner
eb58257b96 Add a bunch of new/tested stuff and various small changes 14
Tested Mainboards:
OK:
 - ASUS M3A78-EH
   http://www.flashrom.org/pipermail/flashrom/2010-October/005297.html
 - ASUS P2B-LS
   http://www.flashrom.org/pipermail/flashrom/2010-November/005506.html
 - Biostar TA790GX A3+
   http://paste.flashrom.org/view.php?id=1350
 - ECS 848P-A7
   http://www.flashrom.org/pipermail/flashrom/2011-January/005781.html
 - GIGABYTE GA-G41MT-S2PT
   Reported on IRC
 - GIGABYTE GA-H77-D3H
   Reported and tested by Alexander Gordeev on IRC.
 - Gigabyte GA-X79-UD5
   http://www.flashrom.org/pipermail/flashrom/2012-August/009811.html
 - Shuttle FN78S
   http://www.flashrom.org/pipermail/flashrom/2012-August/009714.html
 - VIA EITX-3000
   Reported on IRC by Tuju

NOT OK:
 - Dell PowerEdge C6220 (0HYFFG)
   http://www.flashrom.org/pipermail/flashrom/2012-September/009900.html
 - Foxconn Q45M
   http://www.flashrom.org/pipermail/flashrom/2012-September/009923.html
 - MSI MS-7309 (K9N6SGM-V)
   http://www.flashrom.org/pipermail/flashrom/2012-August/009712.html
 - Supermicro X9QRi-F+
   http://www.flashrom.org/pipermail/flashrom/2012-September/009887.html
 - ZOTAC H61-ITX WiFi (H61ITX-A-E)
   http://www.flashrom.org/pipermail/flashrom/2012-August/009649.html

ASUS CUSL2-C has been tested to be working with the board enable once
implemented for the TUSL2-C board. They seem to have the same PCI IDs
as shown in the links below. Since only the CUSL2-C board enable has been
tested yet, we distinguish the two by DMI strings.
http://paste.flashrom.org/view.php?id=1393
http://www.flashrom.org/pipermail/flashrom/attachments/20091206/ddca2c6c/attachment-0002.eml

Tested flash chips:
 - Set EMST F25L008A to PREW (+PREW)
   http://www.flashrom.org/pipermail/flashrom/2012-August/009714.html
 - Set GigaDevice GD25Q64 to PREW (+PREW)
   http://git.chromium.org/gitweb/?p=chromiumos/third_party/flashrom.git;a=commit;h=9e8ef49b1f626c2197e131fba6c5b65c8af4eeea
 - Set Macronix MX25L12805 to P (+P)
   http://www.flashrom.org/pipermail/flashrom/2012-September/009887.html
 - Set SST SST49LF003A/B to PREW (+EW)
   http://paste.flashrom.org/view.php?id=467
 - Set Winbond W49V002FA to PREW (+EW)
   http://www.flashrom.org/pipermail/flashrom/2011-January/005781.html

Tested chipsets:
 - Intel X79 (0x1d41)
   http://www.flashrom.org/pipermail/flashrom/2012-August/009811.html

Board enables:
 - add ASUS P4P800-X
   Created by Idwer Vollering and tested by Mingsen Bao:
   http://paste.flashrom.org/view.php?id=467
 - add DMI string to P4P800-VM

Miscellaneous:
 - Add remaining Intel 7 series chipset (LPC) PCI IDs
 - Add generic SPI detection for chips from Winbond
 - Minor manpage changes
 - Minor other cleanups
 - Escape full stops after abbreviations in the manpage.
 - Add ICH9 and successors to spi_get_valid_read_addr

Corresponding to flashrom svn r1601.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-21 12:52:50 +00:00
Stefan Tauner
3c0fcd0f30 Add spi_block_erase_62
This is used by the AT25F series (only?), but is generic enough to
reside in spi25.c. The only currently supported chip is the AT25F512B.
Other members of that series need some additional infrastructure code,
hence this patch adds the erase function to the AT25F512B only.

Corresponding to flashrom svn r1600.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-21 12:46:56 +00:00
Shik Chen
14fbc4b400 Allow to select FTDI device by serial number
Requires libftdi > 0.5 (2004, commit ID a8f46ddc1595b1b07abfcce613acdafe5b8ddf9d).
Idea stolen from chromiumos commit 5eb5624aeb7e2ee483e2fa0823c4e634c8ea3e68:
http://git.chromium.org/gitweb/?p=chromiumos/third_party/flashrom.git;a=commit;h=5eb5624aeb7e2ee483e2fa0823c4e634c8ea3e68

Corresponding to flashrom svn r1599.

Signed-off-by: Shik Chen <shik@chromium.org>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-17 00:40:54 +00:00
Bryan Freed
5bfef9d321 Add support for GigaDevice GD25LQ32
This is the low power version (vendor,device = 0xc8,0x6016) of
GD25Q32 (0xc8,0x4016) which matches that of W25Q32 (0xef,0x4016) and
W25Q32DW (0xef,0x6016).  All their datasheets look pretty much the
same with respect to commands, erase blocks, etc.

Stolen from chromiumos:
http://git.chromium.org/gitweb/?p=chromiumos/third_party/flashrom.git;a=commitdiff;h=9a0051f0ba0b67af6f08e052c31cba3e9dbbbdbf

Corresponding to flashrom svn r1598.

Signed-off-by: Bryan Freed <bfreed@chromium.org>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-17 00:05:44 +00:00
Stefan Tauner
33366a012c Add board enable for MSI K8N Neo Platinum
It's the same as for the Neo2.
Thanks to roxfan and twice11 who did the RE!

Corresponding to flashrom svn r1597.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Tested-by: Jud Porter
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-15 15:51:09 +00:00
Idwer Vollering
4d0cde1baf Add untested board enable for ASUS P5LD2-VM
Based on http://patchwork.coreboot.org/patch/2881/ but with 
the right pin (i.e. 16) according to Joshua Roys.

Corresponding to flashrom svn r1596.

Signed-off-by: Idwer Vollering <vidwer@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-07 08:27:46 +00:00
Niklas Söderlund
7145a50f53 Remove exit calls from sp_sync_read_timeout and sp_synchronize
Add return values to sp_synchronize so we can signal a failure to the
only upstream caller (serprog_init), which is prepared to propagate a failure.

sp_sync_read_timeout was harder to fix because it already used a return
value, but we needed to distinguish two different failure modes. This
solution distinguishes them by the sign of the return values, which maintains
readability as much as possible.

Thanks to Niklas Söderlund for the original patch and idea.

Corresponding to flashrom svn r1595.

Signed-off-by: Niklas Söderlund <niso@kth.se>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-07 07:07:07 +00:00
Stefan Tauner
d932fd0d8c Add support for Eon EN25F64
Its ID was spotted in an ICH descriptor region update by Jetway:
http://paste.flashrom.org/view.php?id=1217 and is used on ASUS P8B75-V
boards according to some forum posts (2 chips per board actually).

No datasheet was found, so most values are just guessed from the EN25F32.

Corresponding to flashrom svn r1594.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-06 17:37:16 +00:00
Jonathan Kollasch
c81900005f Try to remove all read and write locks on CK804 (and MCP51)
We made a first step into this direction in r1405, but failed to
notice that there was already an extended patch by Jonathan which
was refined to become this one.

Allows the removal of board_shuttle_fn25 (which was also intended to be
used on the ASUS A8N-SLI Deluxe, but this was never tested).

Corresponding to flashrom svn r1593.

A previous iteration was tested on CK804 and
Signed-off-by: Jonathan Kollasch <jakllsch@kollasch.net>
which was then
Acked-by: Stefan Reinauer <stepan@coreboot.org>

Rebasing, refining and making errors non-fatal is
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-04 03:55:04 +00:00
Stefan Tauner
b66ba1e2c2 Nvidia chipset enables: refactor setting bit 0 in 0x6d
This patch also changes semantics: previously failing to set this was interpreted as
a fatal error by enable_flash_ck804 and enable_flash_mcp55 although the output
indicated otherwise. Also, in enable_flash_nvidia_nforce2 there was no check
if settings the bit succeeds.

Now all methods check for success and return ERROR_NONFATAL on failure.

Corresponding to flashrom svn r1592.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-04 01:49:49 +00:00
Stefan Tauner
bb4fed74b6 Fix compilation with MinGW
This was broken since r1557 when we got rid of some exit calls, but returned
-1 instead which is not a valid HANDLE value.

Corresponding to flashrom svn r1591.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Idwer Vollering <vidwer@gmail.com>
2012-09-01 21:47:19 +00:00
Virgil-Adrian Teaca
dabca20a1d Add support for AJAWe to pony_spi
http://www.ajawe.pl/ajawe0208.htm
http://www.ajawe.pl/files/0208_R_DOK.pdf

Corresponding to flashrom svn r1590.

First version was
Signed-off-by: Virgil-Adrian Teaca <darkstarlinux@gmail.com>
Refinements and general cleanup is
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-09-01 21:32:04 +00:00
Carl-Daniel Hailfinger
af2cac0e13 Add RES/REMS support to all dummyflasher emulated chips as a test case
Fix a few odd corner cases in RES/REMS support in dummyflasher
emulation which became noticeable once RES/REMS was used heavily.

Corresponding to flashrom svn r1589.

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>
2012-08-30 21:41:00 +00:00
Carl-Daniel Hailfinger
250c321a9d Remove potential endless loops from satasii.c
Corresponding to flashrom svn r1588.

This is based on the idea from the "Make satasii driver more robust" patch
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

It factors out the wait loop and replaces all potential endless
loops instead of just a few.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-08-29 03:41:57 +00:00
Stefan Tauner
e3adea0864 ichspi: ignore bogus FREGs
Some vendors forget to disable regions properly and set their FRAP bits
and FREG to 0. While not documented publicly this is being ignored by the
chipset(s)[1] and hence flashrom should do so too. Without this patch
flashrom prints a warning and disables writes.
The check for i (region index) excludes the descriptor region which should not
be becessary because specs suggest that the descriptor region should not
be locked, but if vendors would follow the specs this patch would not have
been necessary in the first place.

[1]: http://www.flashrom.org/pipermail/flashrom/2012-May/009303.html

Corresponding to flashrom svn r1587.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-27 15:12:36 +00:00
Sergey Lichack
98f4710b57 Add support for Realtek RTL8169
And some cleanups including the removal of any left traces of the
nicsmc1211 programmer. The RTL8169 still needs someone to test it,
but it's good enough to be in the tree now.

Corresponding to flashrom svn r1586.

Signed-off-by: Sergey Lichack <shadowpilot34@gmail.com>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Mathias Krause <mathias.krause@secunet.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-27 01:24:15 +00:00
Carl-Daniel Hailfinger
1c6d2ff03d Some ISO C fixes
This patch just fixes a limited number of bits not conforming to c99 by using
 - __asm__ instead of just asm
 - {0} instead of {} for struct initialization
 - h_addr_list[0] instead of h_addr to access the host address in
   struct hostent
 - #include <strings.h> where needed (for ffs and strcasecmp)

Based on a previous patch by Carl-Daniel.

Corresponding to flashrom svn r1585.

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>
2012-08-27 00:44:42 +00:00
Stefan Tauner
6745d6f39d Use getpagesize() to determine the physmap's length in nicintel_spi.c
Corresponding to flashrom svn r1584.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-26 21:50:36 +00:00
Stefan Tauner
7bf4ed9277 Rename AT25F512B-specific code
The AT25F512B is quite different from the other (older and yet
unsupported) chips in the AT25F* familiy, hence rename 512B-specific
stuff to make room for the generic AT25F* code.

Corresponding to flashrom svn r1583.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-26 21:04:27 +00:00
Stefan Reinauer
62218c39de Clean up enable_flash_ich and attempt to disable SMM write protection
This is based on chromiumos commit a5f4e82c59d6bcaf06b94623e5516d1db8cb843a.
http://git.chromium.org/gitweb/?p=chromiumos/third_party/flashrom.git;a=commit;h=a5f4e82c59d6bcaf06b94623e5516d1db8cb843a
See also http://www.flashrom.org/pipermail/flashrom/2011-November/008191.html

Besides disabling the SMM protection this also fixes something that bothered
me for a long time: the content of BIOS_CNTL was shown before we try to modify
it. This is usually not what interests us and contradicts other outputs.
With this patch we try to set the write enable and disable the SMM protection
first and show the state of BIOS_CNTL afterwards.

We now return an error only if the write enable is not set (which should be
equivalent to the previous behavior on sane hardware, but it seems to be
'more correct' and makes the code clearer to do this explicitly).

Corresponding to flashrom svn r1582.

Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-26 02:35:13 +00:00
Tadas Slotkus
3dcdc03a72 Add untested board enable for DFI AD77
Corresponding to flashrom svn r1581.

Based on http://patchwork.coreboot.org/patch/2983/
Signed-off-by: Tadas Slotkus <devtadas@gmail.com>

PCI IDs are generic therefore requiring manual activation.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-25 03:53:12 +00:00
Stefan Tauner
61b4cfa29f Clean up satasii.c
Corresponding to flashrom svn r1580.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-25 02:07:20 +00:00
Carl-Daniel Hailfinger
5a7cb847f0 Make struct flashchip a field in struct flashctx instead of a complete copy
All the driver conversion work and cleanup has been done by Stefan.
flashrom.c and cli_classic.c are a joint work of Stefan and Carl-Daniel.

Corresponding to flashrom svn r1579.

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: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-08-25 01:17:58 +00:00
Helge Wagner
dd73d830f7 Fix VIA VX*** support
Helge Wagner's patch that added VIA VX900 chipset support made me look
closer at the datasheets which led to some concise documentation about
newer VIA chipsets: http://flashrom.org/VIA

Based on that this patch adds full support for VX800/VX820, VX855/VX875
and VX900, including SPI and LPC. VT8237S was not changed (SPI support
only) because there is no public datasheet and it is not clear how to
distinguish between LPC and SPI strapping and investigations in (NDAed)
documents have not brought up anything conclusively.

enable_flash_vt823x could probably be enhanced too due to various
ignored LPC options of the chipset.

Corresponding to flashrom svn r1578.

Signed-off-by: Helge Wagner <Helge.Wagner@ge.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Tested-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2012-08-24 23:03:46 +00:00
Stefan Tauner
b4e06bde9b Refactor the -p internal:mainboard handling
This patch gets rid of some global variables and makes lots of bits along
the code path that control the board enable execution more generic and
clearer. From now on flashrom aborts on a few more occasions that should be
safer for the user. For example it aborts if the enable function for the
specified mainboard (enable) can not be found.

Parts of the board_match_cbname refactoring were done by Carl-Daniel.

Corresponding to flashrom svn r1577.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
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>
2012-08-20 00:24:22 +00:00
Carl-Daniel Hailfinger
a16a892ca4 Bus Pirate init cleanup and fixes
The Bus Pirate firmware (at least v6.1 and earlier) can't handle UART
input buffer overflow in BBIO mode, and sending a sequence of 0x00 too
fast apparently triggers such an UART input buffer overflow. Wait 10 ms
after sending each 0x00 byte during init to give the Bus Pirate enough
time to handle the input. This fixes a Bus Pirate hang if the previous
flashrom run was aborted by the user.

The Bus Pirate firmware v6.1 and earlier use the wrong (too slow) SPI
speed if more than 2 MHz are requested. Automatically downgrade SPI
speed to 2 MHz for affected firmware versions.

Detect Bus Pirate hardware and firmware versions to allow quirk
handling.

The Bus Pirate init sequence has lots of open-coded sequences which wait
for a given string on the serial line. Refactor them into
buspirate_wait_for_string().

Corresponding to flashrom svn r1576.

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>
2012-08-17 17:30:43 +00:00
Carl-Daniel Hailfinger
a8da224c63 Allow specifying CPPFLAGS
The user may know better which CFLAGS/CPPFLAGS are appropriate.
Use flashrom_CFLAGS for flags which flashrom definitely needs to build.

Thanks to Stefan Tauner for pointing out the flaw in r1574.

Corresponding to flashrom svn r1575.

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>
2012-08-15 23:06:32 +00:00
Carl-Daniel Hailfinger
b7bce8a6cf Allow the user to specify CFLAGS without breaking the build
GNU make has a very interesting quirk: If you set a variable on the
command line, any changes to that variable in the Makefile are ignored
unless marked with the "override" keyword.

Use CFLAGS only for optimization and warning options, and use CPPFLAGS
for the dependency and other preprocessor related options.
That way packagers can specify their own CFLAGS without breaking the
build.

As a side benefit, the ich_descriptors_tool Makefile now behaves exactly
the same whether called standalone or as part of the main Makefile.

Corresponding to flashrom svn r1574.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-14 21:36:11 +00:00
Ilya A. Volynets-Evenbakh
7c36d52652 Call ftdi_set_interface right after ftdi_init and before ftdi_usb_open
Else libftdi complains that it is impossible to set interface on an already
open device since 1c5fa36b67bc30742eee94ed3e3648fcd4640f24
(which will probably end up in libftdi 0.21).

Corresponding to flashrom svn r1573.

Signed-off-by: Ilya A. Volynets-Evenbakh <ilya@total-knowledge.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-14 01:32:46 +00:00
Andrew Morgan
8dd97f9c9e Add support for Atmel AT49(H)F010, AT49F080 and AT49F080T
Also, alter the page size of the other family members to indicate that it is
unused. Maybe this accelerates the deletion of this field... haha.

Corresponding to flashrom svn r1572.

Signed-off-by: Andrew Morgan <ziltro@ziltro.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-13 23:43:46 +00:00
Stefan Tauner
b98f6eb3ac serprog: Add support for setting the SPI frequency
Introduce a new opcode (0x14) that sends the requested frequency as a 32b
long value in Hertz to the programmer and receives the frequency eventually
chosen by the programmer. The user can specify this with the programmer
parameter "spispeed" (named after the similar parameter for the buspirate)
including an optional suffix of 'M' or 'k' for specifying megahertz or kilohertz
respectively (lowercase suffixes are also accepted).

Thanks to Idwer and Uwe (and maybe others) for their feedback especially
regarding the unit of frequency to use.

Corresponding to flashrom svn r1571.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2012-08-13 16:33:04 +00:00