1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 15:12:36 +02:00

2049 Commits

Author SHA1 Message Date
Nico Huber
69f96f6029 Fix verification with sparse layouts
The full verification step was not accounting for sparse layouts.
Instead of the old contents, combine_image_by_layout() implicitly
assumed the new contents for unspecified regions.

Change-Id: I44e0cea621f2a3d4dc70fa7e93c52ed95e54014a
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/30372
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
v1.0.1-rc1
2019-01-04 23:53:01 +00:00
Arthur Heymans
ec8b8a7feb board_enable.c: Fix dmi_match string for ThinkPad X201
TESTED, flashrom now properly works on Thinkpad X201 running vendor
firmware and coreboot.

Change-Id: I40dc7204499323148707b392d94ecd4b212f9ace
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/27504
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: https://review.coreboot.org/c/30381
Reviewed-by: Nico Huber <nico.h@gmx.de>
2018-12-22 17:08:32 +00:00
Nico Huber
993e162d4f dediprog: Fix small, unaligned reads
This never was a use case until now but the `--fmap` code makes it
obvious: Unaligned reads that were smaller than the `chunksize` here,
were extended without considering the length of the buffer read into.

With that fixed we run into the next problem: dediprog_spi_bulk_read()
shouldn't report an error when an empty read is unaligned.

Change-Id: Ie12b62499ebfdb467d5126c00d327c76077ddead
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/30051
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-on: https://review.coreboot.org/c/30380
Reviewed-by: Nico Huber <nico.h@gmx.de>
2018-12-22 17:08:22 +00:00
Nico Huber
5639af6408 linux_spi: Hardcode default spispeed of 2MHz
Leaving the `linux_spi` driver's unknown default is almost never what we
want and resulted in many support requests since Raspbian switched to a
default that is too high for most applications.

Change-Id: I9361b7c1a1ab8900a619b06e1dae14cd87eb56c2
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/30371
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2018-12-22 17:05:53 +00:00
Nico Huber
30c4cecd28 Makefile: Disable -Werror=deprecated-declarations on release branch
Change-Id: I6ed27b05b8b11f0ae1bcd331148cd61381edb8a0
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/30373
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2018-12-22 17:04:27 +00:00
Nico Huber
6b9e934fe5 linux_spi: Reduce maximum read chunksize
It turned out that older kernels use a single buffer for combined
input and output data. So we have to account for the read command +
max 3 address bytes.

Change-Id: Ide50db38af1004fde09a70b15938e77f5e1285ac
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/25150
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2018-03-20 10:01:48 +00:00
Rudolf Marek
e7792e3b83 Fix the documentation and DOS port
Update the DOS cross-compile documentation,
and workaround issue with valloc() with the
latest DJGPP.

Change-Id: I909c5635aec5076440d2fde73d943f8ad10b8051
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Reviewed-on: https://review.coreboot.org/23044
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
v1.0 v1.0-rc3
2017-12-30 12:21:22 +00:00
Nico Huber
7372866ef4 internal: Fix #if guards for big-endian mips
Newer GCC still warns on big-endian mips, cf. 60210de
(internal: Fix warnings about unused constants).

Change-Id: Id0508c5241a7bd61b8d92d631cdf42ef7829a8a9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/23003
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
v1.0-rc2
2017-12-28 10:58:52 +00:00
Nico Huber
1ca6bef287 spi: Define _XOPEN_SOURCE to get ffs() from strings.h
Fixes build with Musl libc.

Change-Id: I92b69300a302c4491e234666ac371027571801c9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/22951
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2017-12-21 10:59:16 +00:00
Nico Huber
a51a1923e5 README: Update packaging section for Git repositories
Change-Id: I8d9c56be8c1381b175ce7695c53f31b1767d9d17
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/22454
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
(cherry picked from commit 6891709a1f04a78bc45ad4174f4416f24169a020)
Reviewed-on: https://review.coreboot.org/22672
2017-12-19 23:42:47 +00:00
Nico Huber
078d24ef2f ichspi: Fix 100 series PCH (Skylake) support
Pretty subtle missing `else` made flashrom treat Skylake like older
chipsets.

Change-Id: I14bf578964124d4677cb5dfca01c9d1b0d279c9c
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reported-by: Youness Alaoui <kakaroto@kakaroto.homelinux.net>
Reviewed-on: https://review.coreboot.org/22832
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Youness Alaoui <snifikino@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
(cherry picked from commit 19eb0792b8439198d7ef0077b8f79f275fa39a9d)
Reviewed-on: https://review.coreboot.org/22944
2017-12-19 12:31:00 +00:00
Nico Huber
60210dea9e internal: Fix warnings about unused constants
By adding more #if guards, fix warnings about unused constants that
are enabled by default in newer GCC versions.

Change-Id: Ib3b6d7c0c2fadc4faeab971673bfadb1a6d25919
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/22669
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
(cherry picked from commit 97a90497a7d0df5076b4412c3e995a7e4a2ff8cc)
Reviewed-on: https://review.coreboot.org/22800
2017-12-09 22:45:44 +00:00
Nico Huber
fcbdc0a007 spi25_statusreg: Return defined value on failed RDSR
The interface of spi_read_status_register() is broken and can't return
errors. Let's not return random stack data at least.

Change-Id: I714b20001a5443bba665c2e0061ca14069777581
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/22017
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
(cherry picked from commit 1f081530b60ee805532f106f59cc33973e160481)
Reviewed-on: https://review.coreboot.org/22349
v1.0-rc1
2017-11-05 22:35:35 +00:00
Nico Huber
c2a11296e3 ichspi: Disable software sequencing by default for Skylake
Skylake is a mess, especially with coreboot. We have now a present and
configured software sequencing interface with SCGO supposedly being
readonly (Apollo Lake has that feature and a strap documented, Skylake
behaviour might be the same). As we can't easily check if it's read-
only, just enable hardware sequencing by default (even if the software
sequencing interface seems usable).

Change-Id: I8a13fb9c3ca679b3f7d39ad1dc56d5efdc80045b
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/22348
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-11-05 22:35:21 +00:00
Nico Huber
193013718c ichspi: Fix software sequencing for Skylake
Two occurences of ICH9_REG_OPMENU were overlooked and not replaced,
rendering the software sequencing unusable on Skylake.

Change-Id: I16eebcf37ab8ba39b02f33135535552e380b0b92
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/22273
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
(cherry picked from commit 8b2152d54a67e4139525ce49aefe1a6d0e41b85c)
Reviewed-on: https://review.coreboot.org/22332
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-11-04 16:08:01 +00:00
Stefan Tauner
22ce83ed99 Fix standalone ich_descriptor_tool compilation with MinGW and DJGPP
TARGET_OS as well as EXEC_SUFFIX were only set when called via the
main makefile and even then __USE_MINGW_ANSI_STDIO was not set
for MinGW.

While at it, also replace the hardcoded gnu_printf printf format
attribute with __MINGW_PRINTF_FORMAT which is set according to
__USE_MINGW_ANSI_STDIO respectively.

Change-Id: Id146f5ba06a0e510397c6f32a2bd7c819a405a25
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21838
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/22336
2017-11-04 16:07:47 +00:00
David Hendricks
3a235498b4 Use bzip2 when making a tarball
Tarballs on download.flashrom.org are generally packaged using bzip2, so
we may as well be internally consistent.

Change-Id: Ib9fb1ea6d5994cd0285ce8db9675640fae992773
Signed-off-by: David Hendricks <dhendricks@fb.com>
Reviewed-on: https://review.coreboot.org/22116
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-on: https://review.coreboot.org/22335
2017-11-04 16:07:33 +00:00
Stefan Tauner
f0d1173fb4 Fix ID of ST M25P05
The (old) ST (now Micron) M25P05 does only support RES for identification.
Unfortunately, the vendor datasheet states the same ID as for the M25P10
(0x10) and thus flashrom has treated these two as evil twins in the past.
However, real hardware confirmed that the real ID of this chip is 0x05.

Change-Id: Idc75f8cb98e7ef0c47c4527cedcc4da3723bd779
Signed-off-by: Serge Vasilugin <vasilugin@yandex.ru>
Tested-by: Serge Vasilugin <vasilugin@yandex.ru>
Reviewed-on: https://review.coreboot.org/21920
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-on: https://review.coreboot.org/22333
2017-11-04 16:07:23 +00:00
Nico Huber
a4b1d5b446 fixup! nicintel_eeprom: Support for I210 emulated EEprom
Fix is_i210(), add a comment and break an overlong line.

Change-Id: I5d3f71e4e0f77cc8793e7f395baf69e1fad930a3
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/21934
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
(cherry picked from commit 4343e7d44006dcda2ea76b0e7625837832141539)
Reviewed-on: https://review.coreboot.org/22331
2017-11-04 16:07:14 +00:00
Stefan Tauner
f4d7772cee fixup! Convert flashrom to git
without the upcache there is no "offline" version (yet).

Change-Id: Iac3bf11fbd55cfa034ef8af04ef90fe57182ee2b
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21836
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
p1.0
2017-10-06 08:36:00 +00:00
Stefan Tauner
63bf222cba fixup! Convert flashrom to git
refine the pre-push hook:
 - get rid of the concept of precious brances - all of them on the
   upstream repos are precious (this is a change in the face of
   using gerrit instead of a native git repository for staging purposes)
 - likewise, only allow new versioned stable branches and no feature
   branches there

Change-Id: I1d4b4a7ef2673cabee980ec4a7d7d5fbebdcaed1
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21834
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-10-06 08:35:46 +00:00
Stefan Tauner
f3f996e33d fixup! Convert flashrom to git
- update the commit-msg to check for duplicate signoffs/acks

Change-Id: Ia36147e673cceb6d175884b40d4bdd00015b96dc
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21833
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-10-05 10:46:33 +00:00
Stefan Tauner
3a937b7732 fixup! Convert flashrom to git
- update the commit-msg hook to the latest one provided by Gerrit.
   However, disable the (new) code that would avoid adding Change-IDs
   to fixup/squash commits as needed on the staging branch

Change-Id: I2f2d7ae58dcd7d3e55959e18fe664df10bc3cc41
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21832
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-10-05 10:45:21 +00:00
Stefan Tauner
68b5f00930 fixup! Convert flashrom to git
- wrap a line in the hook installer. The line still exceeds our
   maximum limit by two chars but it makes no sense to break
   apart the one long argument IMHO

Change-Id: I0e931fbb5902d2714d5399c1d1bfac0de35523bb
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21831
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-10-05 10:45:08 +00:00
Stefan Tauner
fa25bc3cd4 fixup! Convert flashrom to git
- exploit Make's -include statement to simplify execution flow
 - expand and refine respective comment to better describe and
   match the new behavior

Change-Id: I0c66f2508cc754cf9219211a06d6f305a32c422d
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21830
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-10-05 10:43:05 +00:00
Stefan Tauner
5bf6b855d4 fixup! Convert flashrom to git
Rename getrevision's local_revision function to just revision.
All revisions are local in git and we certainly wont go back to
a non-distributed VCS :)

Change-Id: I6689ac24077b3981b471ed69de7cc3ef79d435b1
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21829
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-10-05 10:41:23 +00:00
Stefan Tauner
8eb1df69ab fixup! Convert flashrom to git
Note the non-strict POSIX compatibility in getrevision.sh and a add missing full stop*.* ;)

Change-Id: Ia60186f783067ba084439a8ef701dc8f4c0072f0
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21828
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-10-05 10:40:08 +00:00
Stefan Tauner
9620912607 fixup! Convert flashrom to git
- make version string generation independent of the actual VCS
   used by not generating "unknown" in the makefile but letting
   getrevision do that
 - make hook installation independent of version string generation
   since they have nothing to do with each other and there are no
   synergies anymore

Change-Id: Iedc9df4c033a70447b8b1b65c83764c769b02c3f
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21827
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-10-05 10:39:25 +00:00
Stefan Tauner
2dc5d29400 fixup! Convert flashrom to git
Use a more generic file name for the exported VCS data.

Change-Id: Ie57b20dc014ba44ded5783bdb432eb7d0e0e28ad
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21826
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-10-05 10:37:35 +00:00
Stefan Tauner
e4136854f1 fixup! Convert flashrom to git
Fix broken/one-off loop to restore file dates.
Explain what the sed program actually does because it is non-trivial.

Change-Id: Iff4021be49a9fab208b619c555b9f9e81f671ab8
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21825
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-10-05 10:37:15 +00:00
Stefan Tauner
60f7a221e0 fixup! Convert flashrom to git
Fix broken export

Change-Id: I9d0fe93291de81b4d303589fd01565f429a61e9a
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21824
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-10-05 04:10:11 +00:00
Stefan Tauner
f0cbbb05c9 Add modification date to manpage header instead of the section
"System Manager's Manual" or similar is way less interesting.

Change-Id: I45c5d6a2316c51a57a49fd010682dc3f0f915382
Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at>
Reviewed-on: https://review.coreboot.org/21822
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-10-04 01:21:12 +00:00
David Hendricks
79d838d316 fixup! nicintel_eeprom: Support for I210 emulated EEprom
A couple of C99-style variable declarations within loops are causing
compilation failures on some systems (gcc 4.9.2-10 on Raspbian). This
moves them to make gcc happy.

Change-Id: Ib7ad5a69244e462f84eae93df9e841716e089b31
Signed-off-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-on: https://review.coreboot.org/21702
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-10-03 00:23:34 +00:00
Ricardo Ribalda Delgado
75a2a79aeb nicintel_spi: Define BIT() macro
Replace bit shits with BIT() macro. This improves the readability of the
code.

Change-Id: I30315891f18d4d5bfbc247bb9012560479afab90
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Reviewed-on: https://review.coreboot.org/21432
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2017-09-17 18:14:28 +00:00
Ricardo Ribalda Delgado
26d33d2be2 nicintel_spi: Support for I210/I211 cards
Implements I210 "raw" flash access as detailed in:
http://www.intel.com/content/www/us/en/embedded/products/networking/i210-ethernet-controller-datasheet.html

Unfortunately, most of the time the card is in Secure Mode, which means
that the raw access is not available. But his should be pretty useful
for bringing up boards.

Change-Id: I8598ab21297b85dcae1e650a168043aa4cc15c10
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Reviewed-on: https://review.coreboot.org/21430
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2017-09-17 18:06:05 +00:00
Ricardo Ribalda Delgado
9fe1fb71c7 nicintel_eeprom: Support for I210 emulated EEprom
On the I210 family there is no MAC EEprom, instead there is a big flash
(typically around 16Mb) with contents of the old MAC plus other stuff.
There is an interface to program the whole flash, but once it is
programmed it enters a "Secure Mode" that disables the interface.

Luckily, the section with the MAC can still be updated via the EEprom
interface. This patch adds support for this interface.

root@qt5022-fglrx:~# ./flashrom -p nicintel_eeprom:pci=01:0.0 -w kk.raw -V
flashrom v0.9.9-unknown on Linux 4.10.0-qtec-standard (x86_64)
flashrom is free software, get the source code at https://flashrom.org

flashrom was built with libpci 3.4.1, GCC 5.3.0, little endian
Command line (5 args): ./flashrom -p nicintel_eeprom:pci=01:0.0 -w kk.raw -V
Calibrating delay loop... OS timer resolution is 1 usecs, 1856M loops per second, 10 myus = 10 us,
100 myus = 102 us, 1000 myus = 1017 us, 10000 myus = 10044 us, 4 myus = 4 us, OK.
Initializing nicintel_eeprom programmer
Found "Intel I210 Gigabit Network Connection" (8086:1533, BDF 01:00.0).
Requested BAR is of type MEM, 32bit, not prefetchable
Requested BAR is of type MEM, 32bit, not prefetchable
The following protocols are supported: Programmer-specific.
Probing for Programmer Opaque flash chip, 0 kB: Found Programmer flash chip "Opaque flash chip"
(4 kB, Programmer-specific) on nicintel_eeprom.
Found Programmer flash chip "Opaque flash chip" (4 kB, Programmer-specific).
Reading old flash chip contents... done.
Erasing and writing flash chip... Trying erase function 0... 0x000000-0x000fff:W
Erase/write done.
Verifying flash... VERIFIED.

Change-Id: I553f33e5dcb4412d682fc93095b29bcfed11713c
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Reviewed-on: https://review.coreboot.org/21431
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2017-09-17 18:05:16 +00:00
Ricardo Ribalda Delgado
7b629bcde4 sb600spi: Add support for Merlin Falcon Chipset
This patch has been tested on a board similar to AMD Bettong.

00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus
Controller [1022:790b] (rev 4a)
00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC
Bridge [1022:790e] (rev 11)
root@qt5022-fglrx:~# ./flashrom -p internal -w kk.rom

flashrom v0.9.9-unknown on Linux 4.10.0-qtec-standard (x86_64)
flashrom is free software, get the source code at
https://flashrom.org

Calibrating delay loop... OK.
coreboot table found at 0x9ffd6000.
Found chipset "AMD FP4".
Enabling flash write... OK.
Found Micron/Numonyx/ST flash chip "N25Q128..1E" (16384 kB, SPI)
mapped at physical address 0x00000000ff000000.
Reading old flash chip contents... done.
Erasing and writing flash chip... Erase/write done.
Verifying flash... VERIFIED.

Change-Id: I66a240ebc8382cc7e5156686045aee1a9d03fe6d
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Reviewed-on: https://review.coreboot.org/21429
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2017-09-17 18:03:42 +00:00
Nico Huber
8681df1287 .gitignore: Add Doxygen dir libflashrom-doc/
Change-Id: Id25d05cdf6107cc7a99b94a8523e23bd8698c2d6
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20811
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2017-09-03 20:29:24 +00:00
David Hendricks
7a8305f1bd ich_descriptors: Use MAX_NUM_FLREGS for entries[]
5 regions made sense in 2013 when this bit of code was originally
written. MAX_NUM_FLREGS is now used to keep track of the max number of
flash regions and is >5 since Sunrise Point.

Change-Id: Idb559e618369fecf930724a7c1c84765247f3e38
Signed-off-by: David Hendricks <dhendricks@fb.com>
Reviewed-on: https://review.coreboot.org/21338
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-09-03 19:33:08 +00:00
David Hendricks
0eb00d4e77 Move ich_layout from layout.h to ich_descriptors.h
This moves the ich_layout declaration from one header to another. This
will avoid a circular dependency when we update the entries[] member in
the follow-up patch to use MAX_NUM_FLREGS which is defined in
ich_descriptors.h.

Change-Id: I08006f1f7c9ccdd17a9a6d74881ed2c8541d4de1
Signed-off-by: David Hendricks <dhendricks@fb.com>
Reviewed-on: https://review.coreboot.org/21337
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-09-03 19:32:52 +00:00
David Hendricks
a5216367d5 chipset_enable: Add support for C620-series Lewisburg PCH
This adds PCI IDs for C620-series PCHs and adds
CHIPSET_C620_SERIES_LEWISBURG as a new entry in the ich_chipset enum.

Lewisburg is very similar to Sunrise Point for Flashrom's purposes,
however one important difference is the way the "number of masters" is
interpreted from the flash descriptor (0-based vs. 1-based). There are
also new flash regions defined.

Change-Id: I96c89bc28bdfcd953229c17679f2c28f8b874d0b
Signed-off-by: David Hendricks <dhendricks@fb.com>
Reviewed-on: https://review.coreboot.org/20922
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-09-01 20:34:44 +00:00
Nico Huber
aa91d5c168 ichspi: "Fix" access permission reporting for regions > 7
Can't find bits that tell us the actual permissions in charge. So report
them as unknown.

Change-Id: Ib73f95e0348f5c6d89988e3ea3529af0ec3b23a6
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/21106
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2017-08-21 21:21:47 +00:00
David Hendricks
a1bccd88c3 chipset_enable: Mark Braswell as tested
Reported by Uwe Vieweg:
https://mail.coreboot.org/pipermail/flashrom/2017-August/015059.html

Change-Id: Iaf7558af8737af36401f577ca7aba9fd7114a3df
Signed-off-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-on: https://review.coreboot.org/20923
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-08-19 20:34:34 +00:00
Nico Huber
4d440a7c41 Include <sys/types.h> wherever ssize_t is used
`ssize_t` is a POSIX type (cf. IEEE Std 1003.1).

Change-Id: I5f6f114523f541b3a8d845c6faee2c0b9f753bae
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reported-by: Urja Rannikko <urjaman@gmail.com>
Reviewed-on: https://review.coreboot.org/21015
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-by: Urja Rannikko <urjaman@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-08-16 17:01:59 +00:00
David Hendricks
8e76230dfb ich_descriptors: Modify limits for C620/Lewisburg PCH
Change-Id: Ic8adc4b87993e65096166fa6d665432697070b4c
Signed-off-by: David Hendricks <dhendricks@fb.com>
Reviewed-on: https://review.coreboot.org/20936
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-08-13 00:38:12 +00:00
Youness Alaoui
a54ceb1dbe rpci: Use pci_dev struct pointer to avoid API breaks
The pci_dev structure is never meant to be used as is, but always as a
pointer. By using the struct itself in undo_pci_write_data, we are risking
data corruption, or buffer overflows if the structure size changes.

This is especially apparent on my system where flashrom segfaults
because I compile it with pciutils 3.3.0 and I run it on a system
with pciutils 3.5.2. The struture size is different and causes a
struct with the wrong size to be sent to the library, with invalid
internal field values.

This has been discovered and discussed in Change ID 18925 [1]

[1] https://review.coreboot.org/#/c/18925/

Change-Id: Icde2e587992ba964d4ff92c33aa659850ba06298
Signed-off-by: Youness Alaoui <kakaroto@kakaroto.homelinux.net>
Reviewed-on: https://review.coreboot.org/20784
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2017-08-10 15:18:11 +00:00
Nico Huber
67d7179292 ich_descriptors: Pretty print an assumed chipset
Change-Id: Id28cb3abc45c6e7f4c4accfc019579c7448c45d7
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/20247
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-07-28 12:31:58 +00:00
Nico Huber
500263434b chipset_enable: Set 100 series chipsets to NT
Change-Id: I9376a0c180b7e73751fbd3c8c37b693d358cbfb8
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/19047
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-07-28 12:30:48 +00:00
Nico Huber
fa62294536 ich_descriptors: Update for Intel Skylake
Interpretation of component clocks changed. Also more regions and more
masters are supported now. The number of regions (NR) is now static per
chipset (10 in the 100 Series case) and not coded into the descriptor
any more.

v2: o Use guess_ich_chipset() for read_ich_descriptors_from_dump().
    o Update region extraction in `ich_descriptors_tool`.

TEST=Run `ich_descriptors_tool` over a 100 Series dump and checked
     that output looks sane. Run `ich_descriptors_tool` over dumps
     of five different older systems (1 x Sandy Bridge, 3 x Ivy Bridge,
     1 x Haswell). Beside whitespace changes, regions not accounted
     by `NR` are not printed any more.

Change-Id: Idd60a857d1ecffcb2e437af21134d9de44dcceb8
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18973
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-07-28 12:30:21 +00:00
Nico Huber
1dc3d42083 ich_descriptors: Add function to guess chipset version
Add guess_ich_chipset() that takes fields from a descriptor dump and
returns the lowest possible chipset version.

Intel did several incompatible changes to the descriptor through the
years. However, they forgot to add a version number. So we have to
apply some heuristics to detect the chipset version in case of exter-
nal flashing.

Change-Id: Ie1736663dc33801b19d3e695c072c61a6c6345a2
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/20246
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2017-07-28 12:26:01 +00:00