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

1747 Commits

Author SHA1 Message Date
Stefan Tauner
4404f73bd9 Cleanup ST M50 driver
There are two locking strategies used by this umbrella family, one uniform
and one that matches the sector layout of the chip. Refactor the functions
involved and rename the overly complicated file to just stm50.c and the
functions accordingly.

This fixes unlocking of some of the non-uniform chips and gets rid of the
abuse of page_size.

Corresponding to flashrom svn r1736.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-09-12 08:28:56 +00:00
Sean Nelson
4c6d3a4b73 Add an internal DMI decoder
Previously we had to rely on dmidecode to decode the DMI/SMBIOS table.
This patch integrates a DMI decoder into flashrom. The old behavior of calling
dmidecode can be brought back by using CONFIG_INTERNAL_DMI=no.

Significant portions of this patch were taken from dmidecode, hence add its
authors to the copyright notice (dmidecode is also GPL2+). We do a few things
differently though. First of all we do more bounds checking to prevent accessing
unmapped memory. We do not support disovery via EFI (yet), but memory
scanning only. We handle the chassis-type lock bit correctly which dmidecode
did not for a long while.

The API to the rest of flashrom remains stable, but the output changes slightly.
To share as much code as possible (which actually is not much), i have added
dmi_fill methods that get called in dmi_init. They are reponsible to fill the
dmi_strings array and setting the is_laptop variable. After it is called, dmi_init
prints all dmi_strings. Previously the strings were printed in the order they were
discovered, followed by the chassis-type, which is now output earlier (in dmi_fill).

Because DJGPP does not support strnlen a simple implementation was added
for it.

This is still only available on x86; actually it is not even compiled in for other
architectures at all anymore.

Corresponding to flashrom svn r1735.

Signed-off-by: Sean Nelson <audiohacked@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Tested-by: Maciej Pijanka <maciej.pijanka@gmail.com>
Tested-by: Idwer Vollering <vidwer@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-09-11 23:35:03 +00:00
Stefan Tauner
449abe28ab DOS refinements
This allows to use the DOS library trees stored in a user-specified directory.

I have mirrored the needed patches, sources and binaries (the latter
are properly licensed to allow that) in the flashrom wiki, so use those
URLs instead of the original sources.

Corresponding to flashrom svn r1734.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-09-11 23:34:57 +00:00
Corey Osgood
cbd566548d Add board enable for Bcom WinNET P680
This patch replaces Alex Mauer's previous patch for this board (from 2008).
Tested to read, erase, and write on 2 different boards, both with AMIC
A29040BL flash chips, using both stock BIOS and coreboot images.

This patch marks the AMIC chip as tested at the same time.

Corresponding to flashrom svn r1733.

Signed-off-by: Corey Osgood <corey.osgood@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-09-10 10:42:48 +00:00
Stefan Tauner
97b6c113b1 layout: Rename romlayout_t to romentry_t
The type describes one entry of the whole layout actually.
Using layout_entry_t or something similar would be more correct,
but due to it length we will use "rom" instead of "layout" here and
in upcoming code.

Corresponding to flashrom svn r1732.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-30 22:23:02 +00:00
Stefan Tauner
c70bc8a3c6 layout: Rename romimages to num_rom_entries
Since we are planning to support image files for rom entries, rename the
variable used to count the number of known rom entries to avoid confusion.
There is already num_include_args with similar semantics, hence we use
num_rom_entries.

Corresponding to flashrom svn r1731.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-30 22:22:57 +00:00
Nico Huber
7562f7d7d5 libpayload: Remove file I/O.c
Read_buf_from_file() and write_buf_to_file() use file streams which are
not supported in libpayload.

Corresponding to flashrom svn r1730.

Signed-off-by: Nico Huber <nico.huber@secunet.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-30 21:29:45 +00:00
Stefan Tauner
4b02e90743 Add now auto-generated manpage to svn:ignore
I had to touch svn directly, where is my reimbursement?

Corresponding to flashrom svn r1729.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-29 13:15:36 +00:00
Joerg Mayer
a93d9dc54d Automatically add version and date to the manpage
To avoid funny effects of ever changing files tracked by the VCS this patch
moves the manpage data to flashrom.8.tmpl and generates the actual
manpage with a new makefile target if needed.

Corresponding to flashrom svn r1728.

Signed-off-by: Joerg Mayer <jmayer@loplof.de>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-29 00:38:19 +00:00
Stefan Tauner
ec7a35f7ec Improve getrevision.sh
- remove bashism.
 - simplify some git-related code.
 - improved parameter and error handling.
 - additional -d/--date action which is similar to the timestamp action.
 - support for an optional path parameter.
 - there is only one sane time format.
 - and only one sane date format too.
 - use UTC dates and times only.
 - vastly improve git_url() to print the correct remote url and
   "nearest" branch.
 - remove username from repository URLs.
 - add "-dirty" to local revisions if there are uncommitted changes.
 - indicate in local revisions how many git-only commits were done
   since branching from upstream svn.
 - fix svn_revision() fallback to svn info and remove git-svn.
 - print leading r in script instead of hardcode it in the makefile;
   no more "0.9.7-runknown".
 - make retrieving the upstream revision work even in cloned git-svn
   repositories.
 - more abstractions and helper functions.
 - less fragmentation of actual functionality.

Corresponding to flashrom svn r1727.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-29 00:38:14 +00:00
Stefan Tauner
8e19b0414c libpayload: By default build libflashrom.a instead of flashrom
Flashrom won't build nor run as native payload very soon (or ever).
This patch changes a special GNU make variable that allows to select
the default goal which is taken if no goal is given explicitly on
the command line. Normally this would be the first rule in Makefile,
i.e. all. This won't compile if the target OS is libpayload, hence
change it to "libflashrom.a" in that case.

This requires two not completely ancient GNU make features:
 - MAKECMDGOALS
 - .DEFAULT_GOAL

Checking for these with ancient-only GNU make features is non-trivial
and hereby postponed.

Corresponding to flashrom svn r1726.

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-28 09:55:04 +00:00
Stefan Tauner
1dd5d3aa66 Add support for AT45CS1282
This one is even more strange than the AT45DB chips. Like the AT45DB321C
it does not support any power-of-2 page sizes. There is only one asymmetrical
eraser and that uses two opcodes.

Corresponding to flashrom svn r1725.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-27 18:02:19 +00:00
Stefan Tauner
fdc4f7ebb9 Add support for AT45DB321C
It seems like this model is one-of-a-kind... it shares some properties
with the older versions of the AT45DB series as well as with new ones.

Corresponding to flashrom svn r1724.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-27 18:02:12 +00:00
Aidan Thornton
db4e87dccf Add support for Atmel AT45DB* chips
Corresponding to flashrom svn r1723.

Signed-off-by: Aidan Thornton <makosoft@gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-27 18:01:53 +00:00
Stefan Tauner
6db8bad530 Add support for Fujitsu MBM29LV160BE/TE
Corresponding to flashrom svn r1722.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-25 13:31:43 +00:00
Stefan Tauner
037cd84889 Makefile: Explain process of handling CONFIG_* variables
Corresponding to flashrom svn r1721.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-25 00:10:56 +00:00
Vadim Girlin
4dd0f906c6 IT87: Add ability to select between chips on GIGABYTE DualBIOS boards
Thanks to Vadim Girlin for finding out how to do that.
This is known to work on GA-MA770-UD3, GA-B75M-D3V, GA-B75N and
GA-H61M-S1 (only M_BIOS is populated).

Corresponding to flashrom svn r1720.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Tested-by: Damien Zammit <damien@zamaudio.com>
Tested-by: Anton Kochkov <anton.kochkov@gmail.com>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-24 12:18:17 +00:00
Stefan Tauner
bdead0d27d Get rid of sp_die()
- Add return values to sp_flush_stream(), sp_pass_writen(),
  sp_execute_opbuf(), sp_execute_opbuf_noflush(),
  sp_check_opbuf_usage(), sp_do_read_n().
- Use those return values to propagate errors instead of exiting.
  In some places this has to wait for core API changes (error handling for
  chip_readb, chip_readn, chip_write) hence comments are added instead.

Corresponding to flashrom svn r1719.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-24 02:10:18 +00:00
Niklas Söderlund
89edf36c17 Add additional error handling to pcidev_readbar() callers
This is mostly a leftover of Niklas' "remove exit call from pcidev_init" patch.
While not explicitly necessary detecting errors early is usually a good idea.

Corresponding to flashrom svn r1718.

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-08-23 23:29:23 +00:00
Stefan Tauner
184c52c941 Introduce serialport_config()
This allows to easily reconfigure a serial port as needed in
the Bus Pirate speedup patch.

Corresponding to flashrom svn r1717.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-23 21:51:32 +00:00
Joerg Mayer
d31d3c3b17 getrevision.sh: Make sure we don't get translated output
(And explicitly require bash.)

Corresponding to flashrom svn r1716.

Signed-off-by: Joerg Mayer <jmayer@loplof.de>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
2013-08-17 23:58:01 +00:00
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