1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-28 15:33:42 +02:00

3391 Commits

Author SHA1 Message Date
Felix Singer
ca4608db6f sb600spi.c: Use one variable to store raw parameter values
Currently, each programmer parameter has their own temp variable to
store their raw value into it. That's not needed since these variables
are only used for a short time to do some configuration and stay unused
then. Thus, use only one variable for all of them.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I247012523c5e864ddb9e1e635df51e4311e5d5c5
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65908
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-08-14 23:36:25 +00:00
Felix Singer
03bb6f77fb dediprog.c: Use one variable to store raw parameter values
Currently, each programmer parameter has their own temp variable to
store their raw value into it. That's not needed since these variables
are only used for a short time to do some configuration and stay unused
then. Thus, use only one variable for all of them.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I198c0da88bfc01fe15280cbd58d2ef27564c1dbc
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65886
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-08-14 23:32:18 +00:00
Felix Singer
e6fec98ba3 dummyflasher.c: Remove unnecessary empty line
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I28db5ec721e77a34396cd77fbe6ed85b38c7098e
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66569
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-08-14 23:22:26 +00:00
Felix Singer
f44a70ff8c cli_classic.c: Make use of bool type in the main function
Use the bool type instead of integer in the main function where
possible, since this represents the purpose of some variables much
better. Also, then we don't have to use the "!!" operator to turn any
number into one or zero, which is used as an equivalent to true and
false.

Also, since we have booleans and integers now, slightly change the
ordering of the variable declarations, so that the integers come before
the booleans.

Tested some parameters using the following commands:

flashrom -L

flashrom -p dummy

flashrom -p dummy:emulate=SST25VF040.REMS,image=foo2 -c "SST25LF040A" --progress -v foo1

flashrom -p dummy:emulate=SST25VF040.REMS,image=foo2 -c "SST25LF040A" --progress -w foo1

flashrom -p dummy:emulate=SST25VF040.REMS,image=foo2 -c "SST25LF040A" --progress -r foo1

flashrom -p dummy:emulate=SST25VF040.REMS,image=foo2 -c "SST25LF040A" --progress -E

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I06572da040e12ac88f8e5fc39f60a9e212b86bd7
Reviewed-on: https://review.coreboot.org/c/flashrom/+/64564
Reviewed-by: Evan Benn <evanbenn@google.com>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Alexander Goncharov <chat@joursoir.net>
2022-08-14 22:28:26 +00:00
Evan Benn
9944a8a8a7 MAINTAINERS: Add Evan Benn for flashrom_tester
BUG=None
BRANCH=None
TEST=../coreboot/util/scripts/get_maintainer.pl -f util/flashrom_tester/build.rs

Change-Id: Ibc7f77b7f8ba2f078d7edf47843a0d7cb288ab9e
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66624
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-08-14 22:25:44 +00:00
Thomas Heijligen
edb5198d24 Makefile: Fix build for Windows
Mark programmers requiring RAW_MEM_ACCESS, X86_IO_PORT and X86_MSR as
unsupported on Windows

TEST=Buils on Cygwin (Windows 11, amd64, gcc 11.3.0)

Change-Id: If70691a9eae40c394a06d11349bedefa40586f4a
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66546
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-08-12 17:37:09 +00:00
Felix Singer
1392a08c50 tests/realtek_mst_i2c_spi.c: Fix macro closing comment
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I7b130c58305f4a8b2afbfdb7dcead9d6535d98af
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66509
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-08-10 23:53:56 +00:00
Anastasia Klimchuk
e18a528c6b tests: Test allow_brick is required for i2c programmers init
Add tests for i2c programmers that assert that initialisation fails
when allow_brick parameter is not provided.

Example of logs from test run:

[ RUN      ] parade_lspcon_no_allow_brick_test_success
Testing init error path for programmer=parade_lspcon with params: bus=254 ...
... init failed with error code -1 as expected
[       OK ] parade_lspcon_no_allow_brick_test_success

BUG=b:181803212
TEST=ninja test

Change-Id: I382f563016502f3342131d5f9c0de41dc665b03a
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66508
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-08-10 23:53:11 +00:00
Anastasia Klimchuk
4adfd99d78 tests: Add function to test programmer init error paths
New function tests an error path for programmer initialisation,
and expects programmer init to fail with given error code.

BUG=b:181803212
TEST=ninja test

Change-Id: Icc59396e604d74442852b4bbd575440df3347c3f
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66507
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-08-10 23:53:00 +00:00
Alexander Goncharov
02f43e89ba atahpt: restore flash access state explicitly
Instead of using reversible write (rpci_write_long) that relies on
global state, do it manually. Save original PCI config space
register contents to programmer's structure during initialization
and restore it in programmer's shutdown.

TOPIC=reduce_global_pci_state
TEST=builds

Change-Id: I9996bb4d71801034e66ba0c233846e19fa29224d
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Ticket: https://ticket.coreboot.org/issues/389
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65386
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-08-09 23:19:15 +00:00
Felix Singer
db026ea281 test_build.sh: Build all programmers individually using Make
While testing CB:63724, which reworks the Meson build system, it showed
that some programmers have dependency issues, which were invisible since
test_build.sh builds flashrom with all programmers enabled and thus all
sources are included. Building flashrom with each programmer
individually made these issues visible.

However, as commit 877b7741fcf9 and commit b6a439e45ef2 show, the Make
build system also had some similar issues, which were invisible for the
same reason.

Thus, in addition to building all programmers at once using the Make
build system, build each programmer individually.

Also, when clang analyzer is used, it's not needed to run it on each
programmer individually. Just return after flashrom was built with all
programmers enabled in this case.

An equivalent patch for the Meson build system is made separately.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I3bacb3ba9c6708f1e7ef5a111290d0ea3af36f1d
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66094
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2022-08-09 21:28:22 +00:00
Veronika Kremneva
ce971c6ce4 Makefile.d/arch_test.h: Add detection for ARC64 architecture
Change-Id: I8707394871994f600b345d76614c5689fd081db4
Signed-off-by: Veronika Kremneva <kremneva@synopsys.com>
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/63896
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-08-09 14:16:06 +00:00
Anton Samsonov
bd72307a46 Makefile: Add support for Elbrus (e2k) architecture
Signed-off-by: Anton Samsonov <devel@zxlab.ru>
Change-Id: Ifc834e943ae93c59447afc86454b22ca662d3ef6
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66426
Reviewed-by: Thomas Heijligen <src@posteo.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-08-09 11:38:18 +00:00
Thomas Heijligen
ef4eb1714b Makefile: fix rebuild issues
Flashrom does no longer rebuild everything if `make` is executed.
Now the rule  config  will run, if needed, before any ‘.o’ is built,
but no ‘.o’ will be built because there is no config file.

https://www.gnu.org/software/make/manual/make.html#Prerequisite-Types

Change-Id: Ie9225b79c0eb27cb041654d703cde5efc769cbf2
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66130
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Idwer Vollering <vidwer@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2022-08-09 09:34:37 +00:00
Edward O'Callaghan
1a9175f272 ich_descriptors.c: Reduce i/o op paths in read_descriptor_reg()
Simplify I/O operations to one path after all branch logic
is complete. Work towards consolidated enum ich gen branch logic.

Change-Id: I37d22217a7cfc4cffc4f6cfe7b1df6f30df3ca92
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66349
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-08-08 20:56:34 +00:00
Edward O'Callaghan
83a30d01cb include/ich_descriptors.h: Add missing include
Avoid transitively including the bool type for the ich_descriptor
functionality.

Change-Id: I2d9eb833ca9198c0586543d3f0074893aac5c6fb
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66348
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matei Dibu <matdibu@protonmail.com>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-08-08 20:55:26 +00:00
Felix Singer
caed9f0d2e test_build.sh: Move commands into functions
In preparation to follow up commits, move the commands into functions
so that it's clear what belongs to what.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: Ia2dc6f1d4d53b4d6a1255ef31c66799a484302fc
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66093
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-08-08 20:37:53 +00:00
Anastasia Klimchuk
5c5b0a8fab tests: Add basic lifecycle test for mediatek_i2c_spi
This unit test does not require any additional mocks because init
and shutdown of i2c infra was covered in realtek programmer lifecycle.
Default mocking of i2c is sufficient to run a basic lifecycle.

To run the test, config option for the programmer needs to be
enabled explicitly, since by default this programmer is disabled.

BUG=b:238816884
TEST=meson configure -Dconfig_mediatek_i2c_spi=true
ninja test

Change-Id: I98a12067d165c90013d33ffc45d20dab5c364c83
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66261
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Alexander Goncharov <chat@joursoir.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-08-08 03:15:22 +00:00
Anastasia Klimchuk
47541722c1 tests: Add basic lifecycle test for parade_lspcon
This unit test does not require any additional mocks because init
and shutdown of i2c infra was covered in realtek programmer lifecycle.
Default mocking of i2c is sufficient to run a basic lifecycle.

To run the test, config option for the programmer needs to be
enabled explicitly, since by default this programmer is disabled.

BUG=b:238816889
TEST=meson configure -Dconfig_parade_lspcon=true
ninja test

Change-Id: I0dcfae4a58c64b2e8d56ec51b4b050534cbb4cd2
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66003
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-08-08 03:14:58 +00:00
Felix Singer
36299dbab2 pickit2_spi.c: Use a variable to store the total packetsize
Instead of calculating the total packetsize multiple times, use a
variable instead.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I714054669e16dcf531a57174f9522b3af72d2754
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66251
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-08-05 23:00:52 +00:00
Felix Singer
9e04991dc4 pickit2_spi.c: Replace hard-coded value with define in msg_perr()
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: Ia3fa89285d8761e51078afa486df50a7b8247fc5
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66250
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-08-05 23:00:18 +00:00
Alexander Goncharov
ce16a1059f nicnatsemi: Refactor singleton states into reentrant pattern
Move global singleton states into a struct and store within
the par_master data field for the life-time of the driver.

This is one of the steps on the way to move par_master data
memory management behind the initialisation API, for more
context see other patches under the same topic specified below.

TOPIC=register_master_api
TEST=builds

Change-Id: I58ad1f0222338fc107e7ac2b9cdd361ae7033912
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Ticket: https://ticket.coreboot.org/issues/391
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65970
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-08-05 09:24:13 +00:00
Alexander Goncharov
474a8b8259 satasii: drop unused variable from par data struct
Change-Id: I17725195d0523068453325742d7e2aae31a0208d
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66293
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-08-05 09:19:45 +00:00
Alexander Goncharov
1a357586bc satasii: Drop sii_ prefix for par data struct members
The name of the struct type already contains satasii_ prefix, so
prefix doesn't need to be repeated in members name

TEST=builds

Change-Id: I92e59bf89e44cde631dfde2df4c9ff0f86b5f417
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66292
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-08-05 09:16:36 +00:00
Alexander Goncharov
94d8701157 satasii: Refactor singleton states into reentrant pattern
Move global singleton states into a struct and store within
the par_master data field for the life-time of the driver.

This patchset also includes stdlib.h to be able to work with
memory allocation.

This is one of the steps on the way to move par_master data
memory management behind the initialisation API, for more
context see other patches under the same topic specified below.

TOPIC=register_master_api
TEST=builds

Change-Id: I63fea00623c149ad304b44aa6265f32ecc1c53eb
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Ticket: https://ticket.coreboot.org/issues/391
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66075
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-08-05 09:16:01 +00:00
Alexander Goncharov
66dde32e16 satamv: Drop mv_ prefix for par data struct members
The name of the struct type already contains satamv_ prefix, so
prefix doesn't need to be repeated in members name

TEST=builds

Change-Id: I10ddb734e0d091cbafb439b288b393cf209dfc2e
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66294
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-08-05 09:07:32 +00:00
Alexander Goncharov
65372382c3 satamv: Refactor singleton states into reentrant pattern
Move global singleton states into a struct and store within
the par_master data field for the life-time of the driver.

This is one of the steps on the way to move par_master data
memory management behind the initialisation API, for more
context see other patches under the same topic specified below.

TOPIC=register_master_api
TEST=builds

Change-Id: I084cf826a8a594ade80eed43008e286c7bd1b553
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Ticket: https://ticket.coreboot.org/issues/391
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65978
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-08-05 09:00:58 +00:00
Alexander Goncharov
e410532fdd nicintel: Refactor singleton states into reentrant pattern
Move global singleton states into a struct and store within
the par_master data field for the life-time of the driver.

This is one of the steps on the way to move par_master data
memory management behind the initialisation API, for more
context see other patches under the same topic specified below.

TOPIC=register_master_api
TEST=builds

Change-Id: I839baad1e6085958a29652f23c9027b6a10edd15
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Ticket: https://ticket.coreboot.org/issues/391
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65974
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-08-03 23:18:17 +00:00
Felix Singer
5b7ae255c3 maintainers: Add Felix Singer for Nix shell
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I1d246ad8e1270a53275ab12adb8c3d858009d176
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66006
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-08-03 23:13:16 +00:00
Felix Singer
2386dd3341 maintainers: Add Anastasia Klimchuk for MAINTAINERS
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: Ibd024b07c3cf2b537bb055694ff2654fed305400
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66005
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-08-03 23:12:51 +00:00
Felix Singer
f5b8fe29dd maintainers: Add Felix Singer for MAINTAINERS
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I9ad71346111a0c42a4424557b3bda6ee1cc3484f
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66004
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-08-03 23:12:07 +00:00
Evan Benn
5bb1698e6a flashrom_tester: Move all subprocess stderr logging to dispatch
Instead of printing stderr in each function separately, print all stderr
in the dispatch function.

BUG=None
BRANCH=None
TEST=/usr/bin/flashrom_tester --debug host Lock_top_quad

Change-Id: Id76f83c8c089537aa44aa13533c75900eb6ed175
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65279
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-08-03 00:03:43 +00:00
Evan Benn
81069f0c65 flashrom_tester: Parse fmap header as little endian
The fmap header was incorrectly parsed as big endian.

BUG=b:240097529
BRANCH=None
TEST=/usr/bin/flashrom_tester --debug :lib: host Coreboot_ELOG_sanity

Change-Id: Ia683ce7a6ce3bc009218c300abb9c3a16ea06a6d
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66119
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-08-02 23:57:37 +00:00
Evan Benn
dfbcf63302 tests/test.c: Allow filtering of tests using cmocka API
Tests can be filtered by providing patterns on the command line. The
pattern is the first argument provided to the test binary, if present.
Only tests matching the string provided are run, wildcards * and ?
match any characters, or one character respectively.

`meson test` or `ninja test` will continue to run all tests, as they do
not provide an argument to the test binary.

https://api.cmocka.org/group__cmocka.html

TEST=tests/flashrom_unit_tests 'layout_*'

Change-Id: I45f4ac5ef0cfb74156408022a19769d6598ad2ea
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65998
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-08-02 02:38:23 +00:00
George Burgess IV
6308fc3b9f flashrom_tester: update to built-0.5
built-0.3 depends on git2-0.9, which is our only user of url-1, which is
our only user of idna-0.1, which depends on rustc-serialize, which
suffers from RUSTSEC-2022-0004. That's a mouthful :)

BUG=b:239449434
TEST=CQ
BRANCH=none

Change-Id: I0d39b417fd2291838e85f91a2af1c8a4fe28a6c2
Signed-off-by: George Burgess IV <gbiv@google.com>
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66140
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-08-02 02:37:52 +00:00
Edward O'Callaghan
dd1d07646f parade_lspcon.c: Clarify coincidentally JEDEC command usage
Clarify that SWSPI_WDATA_* coincidentally uses the same
commands as specified by JEDEC.

A similar data sheet does not really shed light if these
literally are raw JEDEC command values or 'virtual' ones.
As to avoid confusion, comment but perhaps not use the JEDEC
literals from spi.h until it is certain.

Change-Id: I851319ad4c36baad1e280309a6df8c86d6c4ad3d
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65557
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-08-02 02:18:00 +00:00
Edward O'Callaghan
f1ca19598c parade_lspcon.c: Leverage the BIT() macro
Change-Id: Iad51fb4b3440e281e842bcaecf0c060084681635
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65558
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-07-30 07:23:44 +00:00
Edward O'Callaghan
c59cf52e2a parade_lspcon.c: Add allow_brick=yes programmer param
Currently i2c programmers do not have a safe allow listing
mechanism via board_enable to facilitate fully qualified
chip detection.

Since i2c addresses alone can overlap a user may make the mistake
of using the wrong programmer. Although unlikely, it is within the
realm of possibility that a user could accidently somehow program
another chip on their board.

Change-Id: I819f9a5e0f3102bec8d01dd52a0025a0fbe46970
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65555
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-07-30 07:22:55 +00:00
Edward O'Callaghan
b8c16e0429 parade_lspcon.c: Drop unused define
Change-Id: I35e800dec8295059d7cd0fa4503379e059993757
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65556
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-07-30 07:20:36 +00:00
Edward O'Callaghan
a97bbba09a mediatek_i2c_spi.c: Add allow_brick=yes programmer param
Currently i2c programmers do not have a safe allow listing
mechanism via board_enable to facilitate fully qualified
chip detection.

Since i2c addresses alone can overlap a user may make the mistake
of using the wrong programmer. Although unlikely, it is within the
realm of possibility that a user could accidently somehow program
another chip on their board.

Change-Id: I2b8f7a9bfae68354105f3196cc40b9d5e795afdf
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65554
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-07-30 07:19:20 +00:00
Alexander Goncharov
84ba82c0e8 it8212: Drop it8212_ prefix for par data struct members
The name of the struct type already contains it8212_ prefix, so
prefix doesn't need to be repeated in members name

TEST=builds

Change-Id: I02810d3a7ee1f8caac09d92342c5ebca6d41cbaa
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66086
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-07-28 00:47:57 +00:00
Alexander Goncharov
e182b174f7 atapromise: Drop atapromise_ prefix for par data struct members
The name of the struct type already contains atapromise_ prefix, so
prefix doesn't need to be repeated in members name

TEST=builds

Change-Id: Iac647bfe74d4b6f508f06e78b80a020cdf75f562
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66087
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-07-28 00:42:39 +00:00
Nikolai Artemiev
336fd0e2cb meson: fix various meson build warnings and formatting
- Make run_command() calls check for failures to fix warnings about
  ignoring errors, see https://github.com/mesonbuild/meson/issues/9300.

- Remove `include_directories('../subprojects')` from tests/meson.build.
  It isn't necessary and caused build warnings due to referencing files
  outside the tests/ directory.

- Fix indent level and formatting in a few places.

BUG=none
BRANCH=none
TEST=meson; ninja; ninja test

Change-Id: I17ae0c51d68ed004772a237641f08345f4893200
Signed-off-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66060
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-07-28 00:29:26 +00:00
Angel Pons
a71b22fba3 pickit2_spi.c: Add pickit2_interrupt_transfer() helper
Introduce the `pickit2_interrupt_transfer()` helper function to simplify
calls to the `libusb_interrupt_transfer()` function, as the last three
arguments are always the same: two constants and an unused output value.

Change-Id: I7ff704243b63a7ea2872fbc6e596190573dc13f6
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65915
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-07-26 20:26:20 +00:00
Anastasia Klimchuk
398e2d8420 maintainers: Add Nikolai Artemiev for write-protect
Change-Id: Ic0c1cacc8519ba2691dcbf959c3e667ef38f0198
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65942
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-07-26 00:35:46 +00:00
Anastasia Klimchuk
6ed465317c maintainers: Add Anastasia Klimchuk for unit tests
Change-Id: I945746751be713c07b30d67dbe270edf129d54c2
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65941
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-07-26 00:35:31 +00:00
Anastasia Klimchuk
2a845af785 maintainers: Add Nikolai Artemiev for linux_mtd
Change-Id: I67c9d5fd6aa0a45770ab35bf684237cc932f9309
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65940
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-07-26 00:35:01 +00:00
Anastasia Klimchuk
cb77e3cc25 maintainers: Add Peter Marheine for i2c programmers
Change-Id: I93df452846d8cbbfdac443e6f0f67dc8a69581f6
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65939
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-07-26 00:34:42 +00:00
Anastasia Klimchuk
62cb16c709 maintainers: Add Peter Marheine for i2c core
Change-Id: I1e2884451aa0dbc40f09ef0e6a61c157d6a734a5
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65938
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-07-26 00:34:20 +00:00
Anastasia Klimchuk
509f675fe2 maintainers: Add Thomas Heijligen for build system
Change-Id: I48f88caf1b9f2477674100ef39c3bb800c2909d5
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65937
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-07-26 00:34:03 +00:00