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

120 Commits

Author SHA1 Message Date
Victor Ding
436b4155b1 Add ENE LPC programmer
Initial support of ENE LPC interface keyboard controller.

BUG=b:156140422
BRANCH=none

Signed-off-by: Victor Ding <victording@google.com>
Change-Id: I970afd8c1bd92c159c60e09f22e2f18c0433729d
Reviewed-on: https://review.coreboot.org/c/flashrom/+/44580
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2020-08-20 10:10:22 +00:00
Richard Hughes
f88174f4fd meson: Do not compile with -DSTANDALONE
This enables the -o option which is used to collect logs for debugging.

Change-Id: If6c12c682ba72cd519e30f1f8c96552322ff75e3
Signed-off-by: Richard Hughes <richard@hughsie.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/42230
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2020-08-04 22:20:27 +00:00
Rosen Penev
e410164d11 meson: fix compilation under uClibc-ng
fileno requires _POSIX_C_SOURCE to only be defined.

nanosleep requires _POSIX_C_SOURCE to be defined to 199309L.

strndup requires _POSIX_C_SOURCE to be defined to 200809L.

Change-Id: Idb80937bb78e173eb03f2a0c0cdd8925fcd7bfa1
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/43599
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2020-07-21 04:55:01 +00:00
Richard Hughes
7aea04f709 Install the man file when using meson as a buildsystem
This fixes a regression with the Fedora package.

Change-Id: I881bd5002a842072ce9dadea033c51a2668f9e7c
Signed-off-by: Richard Hughes <richard@hughsie.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38939
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-07-15 12:27:40 +00:00
Edward O'Callaghan
46f2d4e488 tests/: Add CMocka unit-test infrastructure
This adds the CMocka unit-testing infrastructure into
the meson build system which we will latter follow up
with unit-tests for flashrom's core logic.

BUG=b:157280555
BRANCH=none
TEST=builds

Change-Id: I66665f56627b3d99049176bfbebbd771b080370a
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/41622
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2020-06-16 02:22:41 +00:00
Edward O'Callaghan
d97f87b00c Initial Realtek MST i2c_spi support
This spi master allows for programming of a Realtek RTD2142
MST with external SPI flash chip routed via its internal i2c
transport mechanism.

BUG=b:152558985,b:148745673
BRANCH=none
TEST=echo "00000000:0004ffff fw" > layout && \
  flashrom -p realtek_mst_i2c_spi:bus=8 -l layout -i fw:dump.bin -r && \
  flashrom -p realtek_mst_i2c_spi:bus=8 -l layout -i fw:dump.bin -w && \
  flashrom -p realtek_mst_i2c_spi:bus=8 --flash-size && \
  flashrom -p realtek_mst_i2c_spi:bus=8 --flash-name

Change-Id: I892e0be776fe605e69fb39c77abf3016591d7123
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/40667
Reviewed-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Shiyu Sun <sshiyu@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-05-04 00:52:42 +00:00
Shiyu Sun
13a2ef6cbd lspcon_i2c_spi.c: Add SPI-master support for PS17{5,6}
This adds support for the Parade lspcon usb-c to HDMI protocol
translater part that is i2c-controlled. The support allows the
host to reach the SPI ROM that hangs off the part where it
stores its firmware.

Usage is as follows:
	flashrom -p lspcon_i2c_spi:bus=X
	where X is the bus number.

BUG=b:148746232
BRANCH=none
TEST=tested with following commands, read/write/erase works good.
	flashrom -p lspcon_i2c_spi:bus=7 -r /tmp/foo;
	flashrom -p lspcon_i2c_spi:bus=7 -E;
	flashrom -p lspcon_i2c_spi:bus=7 -w /tmp/foo;

Change-Id: I039e683252cfaf1ffef8694a3e8081b1b6b944f7
Signed-off-by: Shiyu Sun <sshiyu@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39687
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2020-04-01 06:34:16 +00:00
Shiyu Sun
dc2c83bbc7 i2c_helper: Add support for the Linux I2C subsystem
See https://www.kernel.org/doc/Documentation/i2c/ for details.

This creates common interface for I2C access functions, and adds
implementation for linux I2C functions.

BUG=b:148746232
BRANCH=none
TEST=build success

Signed-off-by: Shiyu Sun <sshiyu@chromium.org>
Change-Id: Ie0487824dfb71970bede17f617dbbb30ddf78c12
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39686
Tested-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2020-04-01 06:05:01 +00:00
Edward O'Callaghan
ad08aef69c raiden_debug: Upstream ChromiumOS servo debug board prog
Initial check-in of the Raiden debugger programmer.

Squash in,
  raiden_debug: Add missing .write_aai cb fn
  raiden_debug: greatly improve protocol documentation

BUG=b:143389556
BRANCH=none
TEST=builds

Change-Id: Ifad273a708acea4de797a0808be58960635a8864
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38209
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2020-03-03 06:02:23 +00:00
Edward O'Callaghan
d3396408d8 raiden_debug: Upstream ChromiumOS usb_device helpers
These are helpful usb device accessors and helpers that
are later used for the so-called Raiden debugger programmer.

BUG=b:143389556
BRANCH=none
TEST=builds

Change-Id: Ic928220fc919fe4958c8150e61e11470dac88f13
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/38936
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2020-03-02 07:05:09 +00:00
Miklós Márton
324929c3d7 Add support for STLINK V3 debugger/programmer via its SPI bridge
Change-Id: Icffab87ac8f2c570187ed753ec70f054541873a4
Signed-off-by: Miklós Márton <martonmiklosqdev@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/34661
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-12-31 17:25:41 +00:00
Nico Huber
2f6936bd92 util/getversion,meson: Add script to allow version info with Meson
Add `util/getversion.sh` that retrieves version information from a
`versioninfo.inc` (what we use for releases) if present or uses
`util/getrevision.sh` if not.

Let Meson use it for flashrom's version. It seems Meson doesn't
generate the manual page at all, so the `--man-date` command is
currently unused.

Change-Id: I401e5638509c4a573bc0cb17ebc5fa76df9700b5
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/35561
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Mario Limonciello <superm1@gmail.com>
Reviewed-by: Richard Hughes <hughsient@gmail.com>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2019-11-06 08:46:07 +00:00
Mario Limonciello
2a8d4390fa Correct the pkgconfig generated file naming
The typical convention is to not use the `lib` prefix (ie `libfoo`)
but instead to just use foo.

Change-Id: I5ab46418e2a1708d5c11970f1e56250f2adb7d70
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/36069
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Richard Hughes <richard@hughsie.com>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2019-10-16 21:50:27 +00:00
Mario Limonciello
d954d5d700 meson.build: Sanitize the version string
Match strictly the library version, and remove all starting letters.

Change-Id: I25587ed2ad7fbcffdf14eb758c1f0d6ab2aea545
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/35566
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Richard Hughes <richard@hughsie.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-10-16 21:47:13 +00:00
Nico Huber
9e2dc2fc81 Makefile,meson.build: Enable/assume -Wextra
Enable all -Wextra warnings but -Wunused-parameter. Nobody seems to
miss warnings about unused parameters and we have a lot unavoidable
occurrences in flashrom because of common interfaces.

Change-Id: Id2ece264c2d483e34019985dd3a7631c4889abe6
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/30411
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jacob Garber <jgarber1@ualberta.ca>
2019-10-05 23:36:34 +00:00
Nico Huber
b417c0c2d2 meson: Correct license to GPL-2.0
Parts of flashrom are 2.0+ but some are not. As Meson's purpose is to
link these together, it should advertise only GPL-2.0 for the whole.

Change-Id: Iab99c74f5f9d54dac56085ecc7475b14be00a310
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/35584
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2019-10-05 22:45:20 +00:00
David Hendricks
349b5d2434 meson: Add spi95.c to fix the build
Reported in issue #105 on github.

Change-Id: Ibe484b4ef60533135fa1e96eb203bb55985d1f8e
Signed-off-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/35819
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2019-10-05 20:19:36 +00:00
Jacob Garber
4a84ec273a tree: Enable -Wwrite-strings
When compiling, this warning gives string literals the type const char[]
to help catch accidental modification (which is undefined behaviour).
There currently aren't any instances of this in flashrom, so let's
enable this warning to keep it that way. This requires adding const
qualifiers to the declarations of several variables that work with
string literals.

Change-Id: I62d9bc194938a0c9a0e4cdff7ced8ea2e14cc1bc
Signed-off-by: Jacob Garber <jgarber1@ualberta.ca>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/34577
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
2019-10-04 14:35:20 +00:00
Thomas Heijligen
b221cd7048 pickit2_spi: update to libusb1 and drop libusb0 dependency
TESTED: read, write, verify

Change-Id: Icfc5372aa1789d35ed22d68297d5e68a74d40388
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/32213
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2019-07-10 18:59:55 +00:00
Richard Hughes
cb97368328 Add support for the meson build system
The fwupd project has to build in all kinds of crazy targets, e.g. for odd
endians, odd instruction sets, and in odd ways, e.g. installing with a prefix
of /app for projects like flatpak. We also have other "robustness" guarantees
and therefore have a comprehensive set of CI tests which enable a lot of
warning flags and run linting and static analysis code like Coverity.

Rather than hack the Makefile I ported the codebase to use Meson.
Meson is a(nother) next-generation build system used by a lot of open source
projects ranging from low level libraries to desktop software. As part of the
port, I also copied the CONFIG_ logic from the makefile, e.g.

  Option                  Current Value Possible Values Description
  ------                  ------------- --------------- -----------
  config_atahpt           false         [true, false]   Highpoint (HPT) ATA/RAID controllers
  config_atapromise       false         [true, false]   Promise ATA controller
  config_atavia           true          [true, false]   VIA VT6421A LPC memory
...

At the moment I'm using the meson port so I can include flashrom as a subproject
to fwupd as distros are not yet shipping libflashrom as a shared library.

Change-Id: I3d950ece2a0568c09985eab47ddab9df1d0c43a2
Signed-off-by: Richard Hughes <richard@hughsie.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/31248
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
2019-04-02 17:33:27 +00:00