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

1801 Commits

Author SHA1 Message Date
Jurij Munda
a1e5374c89 Add support for Sanyo LE25FU406B
It is very similar to LE25FW418A, except for HD_READ support (that
is not implemented in flashrom anyway yet) and allowed voltage range.

Probing, erasing, reading and writing has been tested.

This chip is found on Seagate Constellation hard drives.

Corresponding to flashrom svn r1791.

Signed-off-by: Jurij Munda <jurij.munda@uni-mb.si>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-14 13:19:50 +00:00
Stefan Tauner
a58f6e9b54 Refine messages related to erase/write recovery
We are more verbose inside erase_and_write_flash() although it does not
matter as much as at the end of the whole process in doit().

New output for the non-fatal (i.e. read-protected + successful recovery read) case:

Reading old flash chip contents... done.
Erasing and writing flash chip... spi_block_erase_d8 failed during command execution at address 0x8000
Reading current flash chip contents... done. spi_chip_erase_c7 failed during command execution
FAILED!
Uh oh. Erase/write failed. Checking if anything has changed.
Reading current flash chip contents... done.
Good, 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!

Corresponding to flashrom svn r1790.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-10 09:25:44 +00:00
Mark Marshall
f20b7beff0 Add 'const' keyword to chip write and other function prototypes
Corresponding to flashrom svn r1789.

Inspired by and mostly based on a patch
Signed-off-by: Mark Marshall <mark.marshall@omicron.at>

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-09 21:16:21 +00:00
Stefan Tauner
20da4aa82c Remove programmer_shutdown() from doit()
Because the programmer initialization that has to be called way
earlier and independently elsewhere, it does not make a lot of sense
to deinit within doit(). Also, free the logfile name at the end of
main() to catch more execution paths and because this moves it to
the other cleanup instructions.

Corresponding to flashrom svn r1788.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-07 22:07:23 +00:00
Idwer Vollering
f3607d191a Add support for SST25LF020A
Tested on hardware by Idwer too.

Corresponding to flashrom svn r1787.

Signed-off-by: Idwer Vollering <vidwer@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-07 15:25:04 +00:00
Nikolay Martynov
598968a687 Support for Spansion S25FL132K and S25FL164K
Tested with actual S25FL164K via Arduino SPI.

Corresponding to flashrom svn r1786.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-04 21:44:13 +00:00
Jason Harper
43ddef0fcd Add support for SST25WF080
Also, refine status register prettyprinting and unlocking of the whole family.

Corresponding to flashrom svn r1785.

Signed-off-by: Jason Harper <jharper@iseis.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-04 00:55:24 +00:00
Michael Coppola
4e7f36ec30 Add support for Macronix MX23L3254 mask ROM
Corresponding to flashrom svn r1784.

Signed-off-by: Michael Coppola <michael.n.coppola@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-03 23:01:18 +00:00
Stefan Tauner
c2eec2c920 Add a bunch of new/tested stuff and various small changes 20
Tested mainboards:
OK:
 - abit BX6 2.0
   Reported by Stefan Tauner
 - Acer EM61SM/EM61PM (used in Acer Aspire T180)
   Reported by Benjamin Bellec
 - ADLINK Express-HR
   Reported by Obermair Thomas
 - ASUS M3N-H/HDMI
   Reported by Franc Serres
 - Attro G5G100-P
   Reported by Christoph Grenz
 - ASRock 960GM-GS3 FX
   Reported by Fuley Istvan
 - Elitegroup P6BAP-A+ (V2.2)
   Reported by Arnaldo Pirrone
 - Elitegroup GeForce7050M-M (V2.0)
   Reported by Leif Middelschulte
 - Fujitsu D3041-A1 (used in ESPRIMO P2560)
   Reported by Daggi Duck
 - GIGABYTE GA-8S648
   Reported by TeslaBIOS
 - GIGABYTE GA-970A-D3P (rev. 1.0)
   Reported by Jean-Francois Pirus
 - GIGABYTE GA-B85M-D3H
   Reported by Mladen Milinković
 - GIGABYTE GA-X79-UD3
   Reported by Jeff O'Neil
 - GIGABYTE GA-X79-UP4 (rev. 1.0)
   Reported by George Spelvin
 - GIGABYTE GA-Z68MA-D2H-B3 (rev. 1.3)
   Reported by Vangelis Skarmoutsos
 - GIGABYTE GA-Z87-HD3
   Reported by virii5
 - Lenovo Tilapia CRB
   Reported by jenkins56 on IRC
 - MSI GT60-2OD (notebook, only with layout patches)
   Reported by Vasiliy Vylegzhanin
 - MSI MS-6704 (845PE Max2 PCB 1.0) (Pure Version w/o raid)
   Reported by professorll
 - MSI MS-7399 1.1 (used in Acer Aspire M5640/M3640)
   Reported by Koen Rousseau
 - MSI MS-7125 (K8N Neo4(-F/FI/FX))
   We had a board enable for that one for years, but it was not (and still is not)
   completely clear which boards are covered.
 - MSI MS-7522 (MSI X58 Pro-E)
   Reported by Gianluigi Tiesi
 - PCWARE APM80-D3
   Reported by César Augusto Jakoby
 - Pegatron IPP7A-CP
   Reported by Илья Шипко
 - Supermicro H8QME-2
   Reported by Greg Tippitt
 - Supermicro X7SPA-H
   Reported by Kyle Bentley
 - Supermicro X7SPE-HF-D525
   Reported by Micah Anderson
 - Supermicro X8DTE
   Reported by Mark Nipper
 - Supermicro X8SIL-F
   Reported by Peter Samuelson
 - ZOTAC IONITX-A (-E) version
   Reported by Maciej Wroniecki
NOT OK:
 - Supermicro X10SLM-F
   Reported by Micah Anderson

Flash chips:
 - Atmel AT29C020 to PREW (+PREW)
   It was marked like that in the past, but I could not find the reason why the
   test bits were reset. Urja Rannikko tested it again and it still works.
 - Eon EN25F10 to PREW (+PREW)
   Reported by Stolmár Tamás
 - Eon EN25QH64 to PR (+PR)
   Reported by Vladimir 'φ-coder' Serbinenko
 - GigaDevice GD25Q32(B) to PREW (+PREW)
   Reported by mrnuke
 - Macronix MX25L512(E)/MX25V512(C) to PREW (+PREW)
   Reported by Jamie Nichol
 - Macronix MX25L2005(C) to PREW (+PREW)
   Reported by Давыдов Дмитрий
 - Micron/Numonyx/ST N25Q064..1E to PREW (+PREW)
   Reported by Paolo Zambotti
 - Pmc Pm25LD010(C) to PREW (+PREW)
   Reported by Vasile Ceteras
 - Micron/Numonyx/ST M25P16 to PREW (+EW)
   Reported by raven
 - Micron/Numonyx/ST M25PX64 to PREW (+W)
   Reported by Zaolin
 - SST SST25VF020B to PREW (+PREW)
   Reported by Michaël Zweers
 - SST SST49LF040 to PREW (+W)
   Reported by Oskar Enoksson
 - Add support for MX25L3273E (evil twin of MX25L3205 et al.)
   Also, add MX25L1673 and MX25L6473E to the names of their twins and
   add a note about MX25L8073E.
 - Winbond W25X32 to PREW (+REW)
   Reported by The Raven
 - Winbond W29C010 etc. to PREW (+W)
   Reported by san

Chipsets tested OK:
 - Intel NM70 (8086:1e5f)
   Reported by mrnuke
 - Intel C204 (8086:1c54)
   Reported by Vasiliy Vylegzhanin
 - Intel QM67 (8086:1c4f)
   Reported by Obermair Thomas
 - Intel HM77 (8086:1e57)
   Reported by Vasiliy Vylegzhanin
 - Intel B85 (8086:8c50)
   Reported by Mladen Milinković
 - Intel HM87 (8086:8c4b)
   Reported by Vasiliy Vylegzhanin
 - Intel Z87 (8086:8c44)
   Reported by virii5
 - NVIDIA MCP51 (10de:0261)
   Reported by Marcin Kościelnicki
 - SiS 648 (1039:0648)
   Reported by TeslaBIOS

Miscellaneous:
 - Mark ARM-USB-TINY-H as tested in ft2232_spi (reported by _nanodev_).
 - getrevision.sh: Ignore failing date calls.
 - getrevision.sh: Fix -u and -l for older git versions which require = for the
   git log grep parameter.
 - Corrected K8T Neo2-F entries due to a report from Stelios Tsampas.
 - Add "-p internal" to output that requests users to send flashrom -V logs.
 - Add Macbook2,1, Thinkpad X230, EasyNote LM85 to laptop whitelist.
 - Tiny other stuff.

Corresponding to flashrom svn r1783.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-03 21:33:01 +00:00
Stefan Tauner
f80419c75a Make delay values unsigned
There is no reason for negative delays in our use cases:
 - We don't need it (to work around any quirks).
 - sleep() (POSIX) uses an unsigned argument.
 - usleep() (POSIX) uses an unsigned argument.
 - Sleep() (Windows) uses an unsigned argument.

Change all callees as well (without any complications).

Corresponding to flashrom svn r1782.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-05-02 15:41:42 +00:00
Stefan Tauner
b66ed84d19 ft2232_spi: Add support for TUMPA Lite
http://www.tiaowiki.com/w/TIAO_USB_Multi_Protocol_Adapter_Lite_User's_Manual

Initial patch from Jadran Puharic <jpuharic@gmail.com>.

Corresponding to flashrom svn r1781.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-04-27 05:07:35 +00:00
Stefan Tauner
59c4d790bd Report if we are not able to disable AAI mode again
Corresponding to flashrom svn r1780.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-04-26 16:13:09 +00:00
Stefan Reinauer
87ace663df CID1130000: Unchecked return value in default_spi_write_aai()
Also, try to always disable WRDI because else the user is stuck
with a chip in AAI mode that won't return by itself w/o a reset.

Corresponding to flashrom svn r1779.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-04-26 16:12:55 +00:00
Stefan Reinauer
1838591b68 CID1130006: Memory leaks in buspirate_spi_init()
The one in the error case of register_shutdown() was discovered while
reviewing the other one found by Coverity and fixed by Stefan Reinauer.

Corresponding to flashrom svn r1778.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-04-26 16:12:45 +00:00
Stefan Reinauer
907c3eb800 CID1129996: Unchecked return value from setsockopt() in serprog
Corresponding to flashrom svn r1777.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-04-26 16:12:31 +00:00
Stefan Reinauer
789ea5e9bb CID1130002: Logically dead code due to copy and paste error
What we really want to do is check whether PCI_BASE_ADDRESS_2 is valid at this
point, and not PCI_BASE_ADDRESS_0.

Corresponding to flashrom svn r1776.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-04-26 16:12:15 +00:00
Stefan Reinauer
b879287c42 CID1130009: Resource leak in sp_opensocket()
Corresponding to flashrom svn r1775.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-04-26 16:12:03 +00:00
Stefan Reinauer
a9c2342791 CID1130007: Resource leak in ogp_spi
Memory leak in ogp_spi_init().

Corresponding to flashrom svn r1774.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-04-26 16:11:50 +00:00
Stefan Reinauer
4c00d09cc0 CID1130008: Resource leak read_romlayout()
Corresponding to flashrom svn r1773.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-04-26 16:11:39 +00:00
Stefan Reinauer
bbdde55d42 CID1130012: Double free in pony_spi_init()
Corresponding to flashrom svn r1772.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-04-26 16:11:30 +00:00
Stefan Reinauer
a54169b3d1 CID1130011: Use after free in ich_descriptor_tool
Corresponding to flashrom svn r1771.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-04-26 16:11:21 +00:00
Stefan Reinauer
f94d9ceaa6 CID1130004: Nesting level does not match indentation
Corresponding to flashrom svn r1770.

Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-04-26 16:11:07 +00:00
Alexandru Gagniuc
69dd09d881 linux_spi: Stop messing up the units of SPI speed
'speed' is stored in Hz, so rename the variable to 'speed_hz' to
clarify any potential confusion. Also, when printing the speed after
setting it with an ioctl, convert it to kHz to match the units given
in the message.

Corresponding to flashrom svn r1769.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-03-19 17:17:06 +00:00
Alexandru Gagniuc
d29806ffde linux_spi: Fix conversion from kHz to Hz
A kilohertz is exactly 1000 hertz, not 1024 hertz.

Corresponding to flashrom svn r1768.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-03-19 17:17:00 +00:00
Bill Paul
bf8ea49c0c Add support for Intel 82574L to nicintel_spi.c
Corresponding to flashrom svn r1767.

Signed-off-by: Bill Paul <wpaul@windriver.com>
Acked-by: Idwer Vollering <vidwer@gmail.com>
2014-03-17 22:07:29 +00:00
François Revol
495fc2c96a Add board enable for ASUS A7V8X-MX
Use the same trick as for the MX-SE variant.
Despite being mentioned as supported on
http://flashrom.org/Supported_hardware flashrom fails to detect the
flash chip without this.

Corresponding to flashrom svn r1766.

Signed-off-by: François Revol <revol@free.fr>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-03-14 08:10:02 +00:00
Carl-Daniel Hailfinger
43eac03945 Clean up physmap, fix unaligned mapping problems
Convert all physmaps in dmi.c to use aligned readonly maps.
Convert all physmaps in cbtable.c to use unaligned readonly maps.
Make physunmap() a generic architecture-independent wrapper.
Add physunmap_unaligned() to complement physmap*_unaligned().

Corresponding to flashrom svn r1765.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2014-03-05 00:16:16 +00:00
Stefan Tauner
309dd2c7c2 Add board enable for ASUS P5LD2-VM DH
Tested on real hardware by TeslaBIOS.
Besides the usual board_enable stuff the GPIO definitions for the ICH7 DH
were also missing. Apparently Intel forgot to add the PCI IDs for the desktop
version in the spec update, but the normal datasheet mentions the DH
desktop version so this should be fine...

Corresponding to flashrom svn r1764.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-11-21 15:59:52 +00:00
Stefan Tauner
d1045d8b24 Ensure DMI strings used in dmi_compare() are not NULL
Previously the external DMI decoder did not allow this to happen because
all possible pointers were initialized at startup by the output of
'dmidecode -s ...' which has default values for all supported types.

The now active internal DMI decoder does work differently: it scans the
complete DMI table once and copies the available strings. Therefore, strings
that are not set by the firmware are left at their default value of NULL.

A segfault would arise if the following conditions are all true:
 - the firmware sets up a DMI/SMBIOS table which has at least a correct
   checksum, and
 - that table does *not* define at least one of the DMI strings we use
   for matching (as defined by dmi_strings[] in dmi.c), and
 - there exists a board enable whose PCI IDs are matched by the board,
   and which has a DMI string set that ends with a $ anchor, and
 - the user calls the internal programmer of flashrom without the
   optional mainboard parameter.

This was first observed by Gelip on an abit BF6 using the coreboot port
for the abit BE6-II V2.0.
The segfault was reproduced by Idwer Vollering on an ASUS F2A85-M with
the default DMI values of CONFIG_MAINBOARD_SMBIOS_MANUFACTURER etc.
overwritten and a forged board enable matching his board.
Idwer also verified that this patch fixes the problem, thanks a lot!

Corresponding to flashrom svn r1763.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-10-29 01:38:45 +00:00
Stefan Tauner
2c5b65eb19 Add board enable for abit BF6
Because the board does not have any PCI subsystem IDs set and the
DMI strings are not very specific at all, autodetection has been disabled.
The GPIO was found by roxfan and the patch tested on hardware by Gelip,
thanks!

Corresponding to flashrom svn r1762.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-10-26 17:02:03 +00:00
Stefan Tauner
92d6a861ce Refactor Intel Chipset Enables
- Combine enable_flash_ich_4e() and enable_flash_ich_dc() to
   enable_flash_ich_fwh().
 - Remove unjustified (chipset) name parameters from various
   enable_flash_ich* functions.
 - Make Poulsbo and Tunnel Creek use generic enables by refining existing
   functions to work with them, including everything in ichspi.c.
 - Refactor enable_flash_ich_fwh_decode() to be called unconditionally for
   all chipsets.
 - Add support for Intel Atom Centerton (S12x0).
 - Recombine ICH2/3/4/5 to CHIPSET_ICH2345 because we treat them equally
   anyway.
 - Move spibar handling out of ich_init_spi() into enable_flash_ich_spi()
 - Various small cleanups.

Corresponding to flashrom svn r1761.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-10-25 00:33:37 +00:00
Urja Rannikko
8d7ec2a209 programmer_delay: filter 0 usec delays
We use 0 as delay value for some chips. Just skipping these here is the
most elegant, maintainable solution.

Corresponding to flashrom svn r1760.

Signed-off-by: Urja Rannikko <urjaman@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-10-21 21:49:08 +00:00
Urja Rannikko
f0111d2ca4 serial: use internal_delay() for timeouts
Using programmer_delay() for timeouts in serial writes could cause a
(theoretically) endless recursion if serial communication is used to
send the programmer the delay command to be executed on the programmer
instead of the host which fails again, following a timeout which
sends...

Corresponding to flashrom svn r1759.

Signed-off-by: Urja Rannikko <urjaman@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-10-19 23:35:28 +00:00
Cory Henderson
370f5829e1 Refine support for SST25VF family
- Reorder some models and refine comments.
 - Add SST25VF512A:
   AAI is available but with an uncommon opcode (0xAF). Fully tested
   with Bus Pirate 3.5 running 6.2 beta firmware by Cory.
 - Add SST25VF020 and SST25VF020B.

Corresponding to flashrom svn r1758.

Signed-off-by: Cory Henderson <dcoryh192@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-10-19 23:09:16 +00:00
Kyösti Mälkki
1d473796bc rayer_spi: Fix Xilinx DLC-5 cable
Pin 6 on LPT controls a pulldown on MISO/TDO signal. Whether there exists
an unbuffered clone is unknown. The author of the original patch confirmed
in private correspondence that the patch was incomplete. There has been
no sign of an unbuffered version on the interwebs, hence just change the
existing driver to disable the pulldown.

Corresponding to flashrom svn r1757.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-10-02 01:22:17 +00:00
Maksim Kuleshov
acba2ac238 rayer_spi: Add pinout for Wiggler LPT
Corresponding to flashrom svn r1756.

Signed-off-by: Maksim Kuleshov <mmcx@mail.ru>
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: Maksim Kuleshov <mmcx@mail.ru>
Acked-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2013-10-02 01:22:11 +00:00
Maksim Kuleshov
4dab5c1e07 rayer_spi: Add pinout for Atmel STK200/300
Corresponding to flashrom svn r1755.

Signed-off-by: Maksim Kuleshov <mmcx@mail.ru>
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Acked-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2013-10-02 01:22:02 +00:00
Maksim Kuleshov
3647b2d5ed rayer_spi: Add pinout for Altera ByteBlasterMV
There is a ByteBlasterII product that is only almost compatible.

Corresponding to flashrom svn r1754.

Signed-off-by: Maksim Kuleshov <mmcx@mail.ru>
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: Maksim Kuleshov <mmcx@mail.ru>
Acked-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-10-02 01:21:57 +00:00
Kyösti Mälkki
8b1bdf19b0 rayer_spi: Improve support for different pinouts
Create a list of programmer types with names, test state and linked layouts.
This list could be listed with flashrom -L in follow-up patches.

Handle a bit in status register that is inverted, this will be used
in different future programmer types.

Corresponding to flashrom svn r1753.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: Maksim Kuleshov <mmcx@mail.ru>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-10-02 01:21:45 +00:00
Stefan Tauner
8268fdb902 layout: Verify layout entries before building a new image using them
This fixes a SEGFAULT if a layout entry is included that addresses memory
outside the current chip's address range. flashrom will only abort if the
offending region(s) is/are included else it will just warn.

It will print warnings for regions with negative or zero-length address ranges
and bail out after checking all of them.

Also, abort for non-write operations if a layout file is given because there is
no layout support for other operations yet.

Corresponding to flashrom svn r1751.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-09-23 14:21:06 +00:00
Stefan Tauner
a6a0d2000a sbxxx: Set SPI clock to 16.5 MHz and disable fast reads
Do not rely on broken firmware to set up the SPI configuration correctly.
Some boards fail with flashrom because the firmware chose too high speeds
for the alternate SPI mode which flashrom uses. Temporarily change the
clock to the lowest common value of 16.5 MHz.

Also, disable fast reads just to be safe.

Corresponding to flashrom svn r1750.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-09-15 14:17:39 +00:00
Stefan Tauner
949ccc8a7e layout: Add a method to cleanup layout data structures
Add layout_cleanup() to layout.c and hook it up in cli_classic.c.

Corresponding to flashrom svn r1749.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-09-15 14:01:06 +00:00
Kyösti Mälkki
88ee040ab9 Enable fwh_idsel parameter for C-ICH and ICH2/3/4/5 chipsets
Register locations are different from ICH6, but otherwise appear
to have identical bit specifications and defaults.

Corresponding to flashrom svn r1748.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-09-14 23:37:01 +00:00
Kyösti Mälkki
78cd0875a2 Use ich_generation parameter in enable functions prior to ICH7
Follow the style used from ICH7 onwards to pass ich_generation
parameter to lower-level functions on older ICH chipsets too.

Corresponding to flashrom svn r1747.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-09-14 23:36:57 +00:00
Kyösti Mälkki
743babc875 Introduce enable_flash_ich_fwh_decode()
ICH2 (and C-ICH)/3/4/5 also have FWH_SEL1/2 registers but at
different addresses. In preparation for implementing fwh_idsel
parsing for older ICH chipsets extract the parameter handling
and add variables for the offsets.

While FWH_DEC_EN1 is a 16bit register for ICH6, it is two separate
8bit registers on ICH5 and earlier. Implement all accesses with two
byte instructions instead, to prepare for extended support.

Corresponding to flashrom svn r1746.

Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-09-14 23:36:53 +00:00
Niklas Söderlund
5d3072030a Remove exit call and mayfail parameter from physmap_common()
The only call path where exit was reached was from physmap functions.

Callers of physmap() et al. which were not prepared to handle
ERROR_PTR return values have been adjusted.
physmap_try_ro() has been renamed to physmap_ro() and physmap_common()
slightly refactored due to the now removed *FAIL parameters.

Corresponding to flashrom svn r1745.

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>
2013-09-14 09:02:27 +00:00
Niklas Söderlund
2d8b7ef4a8 Remove exit call from sys_physmap_*
All callers are prepared to handle error if ERROR_PTR is returned.
The Manpage mentioning the respective return code is readapted.

Corresponding to flashrom svn r1744.

Signed-off-by: Niklas Söderlund <niso@kth.se>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-09-13 19:19:25 +00:00
Stefan Tauner
26e7a154a8 Add debug output to programmer_map_flash_region()
While we don't expect addresses with more than 32 bits here, let's
print the whole possible range for debugging anyway.

Corresponding to flashrom svn r1743.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-09-13 17:21:05 +00:00
Stefan Tauner
c65b8555d5 BSD refinements
Make it easier to compile flashrom under NetBSD and DragonFlyBSD:
 - Use /usr/pkg/ as prefix for includes and linking
 - Use pciutils as include path for the right(tm) libpci

Also, fix date handling in getrevision.sh to work with the various formats for
invoking 'date'. This also uses svn's info --xml output instead of the regular one.

Corresponding to flashrom svn r1742.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Tested-by: Idwer Vollering <vidwer@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-09-12 15:48:39 +00:00
Stefan Tauner
4442b81fd8 sbxxx: Add detection for the remaining AMD chipset families
Also, correct prettyprinting of the registers of the various families,
and abort if SpiAccessMacRomEn or SpiHostAccessRomEn prohibit full access.

Tested reading/writing on ASRock IMB-A180, and chipset detection on
one of each affected generation by Chris Goodrich from Sage.

Corresponding to flashrom svn r1741.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
2013-09-12 15:48:35 +00:00