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

3361 Commits

Author SHA1 Message Date
Edward O'Callaghan
af76e44752 flashrom.c: Make 'chip_to_probe' a param to probe_flash()
Apart from the very bespoke case of 'probe_w29ee011()'
the override 'chip_to_probe' name is a nature parameter
to 'probe_flash()'. However we can deal with w29ee011
by providing a probe specific validation function to
check if the chip can indeed be overriden.

TEST=`./flashrom -p internal --flash-name`.

Change-Id: Ifcdace07ea2135d83dea92cfa5c6bec8d7ddf05d
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67091
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-11-06 23:30:33 +00:00
Felix Singer
39b1890773 Makefile: Don't install git hooks automatically
These specific git hooks are only needed when someone wants to push a
patch to upstream and so it's not needed to run it in every make call.
Beside that, we also don't know the environment in which this is
executed and it might not be wanted.

Thus, add a new make target `gitconfig` and move the install command to
it. It can be used by running `make gitconfig`.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: Ib83568c7ff149a8ec34ad7e92720c36a89def7bd
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68647
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-11-04 20:49:05 +00:00
Edward O'Callaghan
54f864779b ichspi.c: heap allocate hwseq_data to remove global
Align hwseq path in ichspi with the rest of the flashrom tree
by making hwseq_data a heap allocation within the life-time of
the driver managed by the driver registration API.

Change-Id: Ib362c5ab2d3e8afee2c3c7d3135cc4414d6bd6c3
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68774
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-11-03 23:57:38 +00:00
Edward O'Callaghan
c0fefa8084 ichspi.c: derive hsfc_fcycle from ctx in ich_start_hwseq_xfer()
Allow helpers to derive driver specific data from the driver
specific context instead of being a closure over a static
global variable.

Change-Id: Ib0ccf4b32fd1e2be2ecc3a4a4c6e397c8e901a0a
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68773
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2022-11-03 23:56:30 +00:00
Edward O'Callaghan
bce96c2d61 ichspi.c: plumb flashctx through hwseq xfer helper
Change is a NOP to prepare ichspi to remove hwseq_data being
a global symbol in CB:68774. This allows for the helper
functions to derive their data from the driver data context.

Change-Id: I67b5aa6350930d912e5036473ac3e792debac0bd
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68772
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-11-03 23:56:08 +00:00
Felix Singer
a048df8398 tests/meson.build: Rename list of source files to test_srcs
Rename the list of source files to `test_srcs` so that there is less
confusion with the variable `srcs` from the top-level meson.build file
containing the flashrom source files.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: Ica0fc3923070bff63323204bd58edb5276dc9493
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68228
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-11-01 23:58:37 +00:00
Edward O'Callaghan
594d3357b6 tree/: Convert flashchip read func ptr to enumerate
This forges the way for flashchips.c to be pure declarative
data and lookup functions for dispatch to be pure. This
means that the flashchips data could be extracted out to
be agnostic data of the flashrom code and algorithms.

TEST='R|W|E && --flash-name' on ARM, AMD & Intel DUT's.

Change-Id: I612d46fefedf2b69e7e2064aa857fa0756efb4e7
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66788
Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-11-01 01:16:26 +00:00
Edward O'Callaghan
985ad5623f tree/: Convert flashchip write func ptr to enumerate
This forges the way for flashchips.c to be pure declarative
data and lookup functions for dispatch to be pure. This
means that the flashchips data could be extracted out to
be agnostic data of the flashrom code and algorithms.

TEST='R|W|E && --flash-name' on ARM, AMD & Intel DUT's.

Change-Id: I80149de169464b204fb09f1424a86fc645b740fd
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66782
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-11-01 01:15:55 +00:00
Edward O'Callaghan
10e7a0ebd7 tree/: Convert flashchip probe func ptr to enumerate
This forges the way for flashchips.c to be pure declarative
data and lookup functions for dispatch to be pure. This
means that the flashchips data could be extracted out to
be agnostic data of the flashrom code and algorithms.

TEST='R|W|E && --flash-name' on ARM, AMD & Intel DUT's.

Change-Id: I00aaab9c83f305cd47e78c36d9c2867f2b73c396
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66781
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-11-01 01:15:21 +00:00
Evan Benn
74c3e56ec2 writeprotect: Add some debug logging if wp_verify fails
Change-Id: I5fcaf767570418f90ae44826a1135d9b49653033
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67720
Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-10-31 22:52:51 +00:00
Angel Pons
b9c03286b6 chipset_enable.c: Mark Intel C246 as DEP
Tested reading, writing and erasing the flash chip of a Prodrive
Hermes mainboard with an Intel C246 PCH. However, since ME-enabled
chipsets are marked as DEP instead of OK, this one shall also be.

Change-Id: I07d6c4a60e468c61eba836db91e1335f4a762048
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68594
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-10-31 05:48:48 +00:00
Felix Singer
618bdb37e1 nicintel_eeprom.c: Fix typo
`done_i20_write` is meant to be `done_i210_write`. Fix that.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: Idc0a0c475e891fc8538a7a81093520e01e1b25bf
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68582
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Alexander Goncharov <chat@joursoir.net>
2022-10-31 05:19:29 +00:00
Felix Singer
644b9d96f0 MAINTAINERS: Add Felix Singer for test_build.sh
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I36267e6c080b14e90e820d3e26abaefe642f9c65
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67269
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-10-31 05:17:54 +00:00
Edward O'Callaghan
4f013087a7 flashrom.c: Move count_max_decode_exceeding() to cli
The count_max_decode_exceeding() function is only ever called
within the cli_classic logic so move it there and make it
static. This further cleans up the flashrom.c symbol namespace.

Change-Id: If050eab7db8560676c03d5005a2b391313a0d642
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68438
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-10-31 05:17:45 +00:00
Nikolai Artemiev
2e00f73671 tree/: Convert flashchip decode range func ptr to enum
Replace the `decode_range` function pointer in `struct flashchip` to an
enum value. The enum value can be used to find the corresponding
function pointer by passing it to `lookup_decode_range_func_ptr()`.

Removing function pointers like `decode_range` makes it possible to represent chip data in a declarative format that does not have to be
stored as C source code.

BUG=b:242479049
BRANCH=none
TEST=ninja && ninja test

Signed-off-by: Nikolai Artemiev <nartemiev@google.com>
Change-Id: If6d08d414d3d1ddadc95ca1d407fc87c23ab543d
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67195
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-10-28 00:41:32 +00:00
Sergii Dmytruk
bd8a02de6c flashchips.c: mark WP of 9 entries as tested
This is based on information from:
 * commit a850fd0aa8054a1125a9231fa3317428f15900f4
   - GD25LQ128C/GD25LQ128D/GD25LQ128E
   - GD25LQ64(B)
   - GD25Q127C/GD25Q128C
   - GD25Q256D/GD25Q256E
   - GD25Q64(B)
 * commit a8204dd34d90ac9ab2783e1dd486ec781d4c0dba
   - GD25Q32(B)
 * commit 7b4c4f36113c4b7ed5c985d4cf51733639e69bf8
   - W25Q64BV/W25Q64CV/W25Q64FV
 * https://github.com/Dasharo/dasharo-issues/issues/67
   - W25Q128.V..M
 * https://github.com/Dasharo/flashrom/pull/8
   - W25Q64.W

Change-Id: I090188bad568885f78778e7fc7d8dbe20fb2445f
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Tested-by: Nikolai Artemiev <nartemiev@google.com>
Tested-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Tested-by: Kamil Pokornicki <kamil.pokornicki@3mdeb.com>
Tested-by: Przemyslaw Banasiak <przemyslaw.banasiak@3mdeb.com>
Tested-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68180
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-10-23 22:00:37 +00:00
Sergii Dmytruk
5f3d3fad3c flash.h: extend struct tested with .wp field
Using "B" letter for "block protection" in TEST_* macros.

Ticket: https://ticket.coreboot.org/issues/377
Change-Id: I791400889159bc6f305fb05f3e2dd9a90dbe18a4
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68179
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-10-23 22:00:23 +00:00
Angel Pons
e924dc0616 rayer_spi.c: Get rid of temporary prog_type string
Make the `get_params()` function provide a pointer to `struct
rayer_programmer` directly, instead of having a `prog_type` string
passed around three functions.

Change-Id: I83e34382ee9814f224025e21e5099fdab73cee8c
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68239
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-10-22 00:45:30 +00:00
Edward O'Callaghan
759a056673 rayer_spi.c: Roll up programmer type search logic into func
Roll up the programmer type table search and match logic into
it's own function and lexically scope the 'rayer_spi_types'
table into the function while we are here.

Change-Id: Id226ea61132ecc30fd8696e1d8ea50373e752cac
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68238
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-10-22 00:45:03 +00:00
Edward O'Callaghan
1837f0df27 rayer_spi.c: Drop lpt_outbyte intermediate var
The intermediate variable in this case serves no extra
assistance in readability or additional control flow
branching. Just assign the result directly into the
driver state tracker.

Change-Id: Idedabb7b1c401d666b3b7e621e75704c7e765fd1
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68232
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-10-22 00:44:27 +00:00
Edward O'Callaghan
68e4d5cc4e rayer_spi.c: Move param parse logic into own func
Deconvolve programmer parameter parse logic out of main
'rayer_spi_init()' entry-point function control flow.

Change-Id: I287aa2e5d94e872553d08c0750f8dc6d60b9caff
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68230
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-10-22 00:43:55 +00:00
Liam Flaherty
d514c90f9a raiden_debug_spi: Remove fixme with explanation
The raiden_debug_spi programmer will query the connected USB devices and
match against criteria other than the pid rather than iterate through
the vid:pid table.
The fixme has been updated to explain why the dev_entry table is empty.

TICKET: https://ticket.coreboot.org/issues/394

BUG=b:253320285
TEST=build

Change-Id: I43e364c02f42dd499d3c9ca3e0a03ead673da3e6
Signed-off-by: Liam Flaherty <liamflaherty@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68364
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
2022-10-21 05:44:52 +00:00
Alexander Goncharov
5c69cde561 tree: provide flashrom context into programmer_delay()
Modify the `programmer_delay` function signature to allow passing
the flashrom context. Programmers that depend on internal delay
should provide NULL as a context. The use of this function parameter
will be introduced in CB:67393.

TOPIC=programmer_handle_global
TEST=builds

Change-Id: Ibb0bce26ce2052853ee52158d7ba742967a9e229
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66373
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-10-17 01:00:35 +00:00
Edward O'Callaghan
890d07986b flashrom.c: Use programmer_init() func params over global
The 'programmer' intended to be used in the control flow
of 'programmer_init()' is a parameter to the function. Therefore
use that symbol directly over the global copy of it.

Change-Id: I71e61f0633bac2fc472971249910bf3bf57cd0eb
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68249
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-10-16 11:39:44 +00:00
Jean THOMAS
001c87d901 dirtyjtag: Add DirtyJTAG programmer
Add a new programmer driver for the DirtyJTAG project (a USB-JTAG
firmware for STM32 MCUs).

Successfully tested with DirtyJTAG 1.4 running on an Olimex STM32-H103
development board and a SST25VF020B SPI flash chip.

Change-Id: Ic43e9a014ed7d04e429e73b30c9dcfdde1a78913
Signed-off-by: Jean THOMAS <virgule@jeanthomas.me>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67878
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2022-10-15 18:17:38 +00:00
Edward O'Callaghan
5d3b95bbac flashrom.c: Separate out default layout init
get_default_layout() is undefined without a
init_default_layout() so separate out that logic
from probe_flash().

Change-Id: I8fd0af8fb1c32dc9f2b00cc39b518d2f4d98e3ac
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68296
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-10-15 15:09:11 +00:00
Edward O'Callaghan
71c6502378 layout.c: Use calloc() to ensure a zeroed layout
No need to malloc() and then do a DIY memset to zero of the
heap. Just use calloc(1, ..) to get a zeroed heap.

Change-Id: Id6cf2c4591aec0620f15d8a39495d2bff6597f96
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68279
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-10-15 14:37:00 +00:00
Felix Singer
955c01f5c4 tests/meson.build: Turn file list into list of file objects
When a file object is created, Meson also checks if the file actually
exists and an error points to the specific line of meson.build if not.
If just a list of filenames is used, then the error occurs at the line
where the list is used.

Thus, use file objects in tests/meson.build for more useful error
messages.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I0b9144a6b76c1772833817b4e6873818dcf36b05
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68197
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2022-10-15 14:22:48 +00:00
Peter Marheine
22e9313d90 flashrom.8.tmpl: document mediatek_i2c_spi programmer
This adds a manpage section describing the mediatek_i2c_spi programmer,
including some discussion of devices that are supported as well as which
systems use them.

Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Change-Id: Ia63df470170fbadcabadcdad8e5acc0cde3a274b
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67825
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-10-11 03:28:24 +00:00
Felix Singer
b264e5089a meson.build: Fix indentation of mstarddc_spi definition
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: I064b50f87760fd7ad40b3629b3fa68552c8ddb46
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68163
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-10-11 03:28:06 +00:00
Edward O'Callaghan
053d319141 flashrom.c: create is_internal_programmer() helper
As suggested by Angel Pons, add the function `is_internal_programmer`
to cut down on some pre-processor usage by moving it into the new
function.

The function then checks if the internal programmer is the
selected one. If the internal programmer is not built in, then it
just returns false.

Change-Id: I43243b990192077583a9a3a95d35844923d9c158
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66684
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-10-10 04:20:13 +00:00
Nico Huber
5779452fcc manibuilder/apt-get: Drop apt-get dist-upgrade commands
Such invasive updates shouldn't be needed. And if, we'd notice.

Change-Id: I8915ad0f8b348c1bb532c261a73ea2ab6d602565
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67187
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-10-08 20:37:13 +00:00
Evan Benn
634da83f40 s25f.c: Fix undefined behaviour on shift
dev_id, a uint8_t, was shifted left by 24 bits. After promotion to int,
this results in shifting into the sign bit, which is undefined
behaviour. Cast to uint32_t to prevent the promotion to signed int.

BUG=None
BRANCH=None
TEST=None

Change-Id: I88188ef2ba2af919eeae9ba08916374d31d8b989
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68127
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-10-08 20:29:47 +00:00
Jonathon Hall
7c40ba24fe flashrom.c: Remove custom mappers from opaque_master
No opaque masters have a custom mapper.  The returned chipaddr is not
fed back into the read/write/erase functions, so this would only be
useful for side effects.

Change-Id: I36f05154edda371b51f8ff416f019837ff1c243d
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68092
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-10-08 18:45:32 +00:00
Jonathon Hall
a021cd0380 dummyflasher.c: Remove custom mapper from opaque_master
Dummy doesn't need a custom mapper on opaque_master; the returned
address is not used and the mapper has no side effects.

This is the only remaining opaque master with a custom mapper, so this
permits removing custom mapper support from opaque masters.

Change-Id: I76ae3e0c2e91ecba4fd320941bd1eff038050731
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68091
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-10-08 18:45:21 +00:00
Jonathon Hall
277b3fa670 ichspi: Do not attempt to map physical memory for hwseq
ICH hwseq does not need to actually mmap flash, and this fails for
flash chips >16 MB, since only the top 16 MB is mapped into the address
space.

Test: Read and write flash on ICH hwseq with 32 MB flash chip.

Change-Id: Ie698071c3181e988f10b750b0e50c9700efaa1a3
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68090
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-10-08 18:45:12 +00:00
Jonathon Hall
5afd4aeece drivers: Move (un)map_flash_region to par/spi/opaque_master
Move (un)map_flash_region function pointers from programmer_entry to
par_master, spi_master, and opaque_master.  This enables programmers to
specify a different mapper per bus, which is needed for the internal
programmer.  Mapping is closely tied to the way the memory is accessed
using the other functions in the bus master structs.

Validate that FWH/LPC programmers provide specialized mapping in
register_par_master(); this is needed for chips with
FEATURE_REGISTERMAP, which only exist on FWH or LPC buses.

programmer.c: Update comment in fallback_map(), NULL return is the
desired behavior.

Test: Read firmware on SB600 Promontory mainboard (requires physmap)
Test: Read firmware externally with ft2232_spi
Test: Read firmware on ICH hwseq, verify physmap still occurs

Change-Id: I9c3df6ae260bcdb246dfb0cd8e043919609b014b
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Co-Authored-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67695
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-10-08 18:45:03 +00:00
Edward O'Callaghan
67d5015617 drivers/: Make 'fallback_{un}map' the default unless defined
Drop the explicit need to specify the default 'fallback_{un}map'
callback function pointer from the 'programmer_entry' struct.
This is a reasonable default for every other driver in the tree
with only a select few exceptions [atavia, serprog, dummyflasher
and internal].

Thus this simplifies driver development and paves way
to remove the 'programmer' global handle.

Change-Id: I5ea7bd68f7ae2cd4af9902ef07255ab6ce0bfdb3
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67404
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: Angel Pons <th3fanbus@gmail.com>
2022-10-08 18:36:21 +00:00
Nikolai Artemiev
7e8d17a8bd cli_classic.c: Add error messages for invalid --wp-region use
Print errors if --wp-region is used without a layout file or the layout
file doesn't contain the region.

BUG=b:247055486
TEST=builds

Change-Id: Ie606ba7f8a423405099679ca62169c395d994b5d
Signed-off-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67725
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-09-30 00:29:09 +00:00
Nico Huber
ad0ee5c606 manibuilder: Maintain list of broken images
Disable images that can't be built anymore by default. We keep them
listed, so existing images can still be used. Also add commands to
show and run all supposed-to-be working tags.

Change-Id: I0f0ffb6c5e28348656aac2ce265f8b1dc0e93362
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66996
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-09-27 13:52:13 +00:00
Nico Huber
e9c63e2164 manibuilder/alpine: Disable https for Alpine 3.7 and 3.8
Alpine Linux 3.7 and 3.8 fell behind with their pre-installed cer-
tificates. Plus, there seems to be no way to override certificate
checks when downloading packages. Hence, disable https completely.

Change-Id: I49dc3a2a2d44f948182e7571f6289b74e6fa6eb4
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67186
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-09-27 13:52:07 +00:00
Nico Huber
c582ed5bcd mainbuilder/djgpp: Disable TLS verification for curl and Git
This image is based on an old unsupported SUSE version. The
ca-certificates don't get updates anymore.

Change-Id: Ie46e3772f030765d6abb092727e2fbed61d3d989
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67178
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-09-27 13:51:59 +00:00
Nico Huber
79efb45da9 manibuilder: Switch Dockerfile.anita to Bullseye and Python 3
Basing the image on debian:stable turned out to be a bad idea once
stable switched to Bullseye. Instead of falling back to Buster, we
move forward to Bullseye and pin that version. Hopefully that works
for some years again.

With Bullseye it turned out to be easier to do things with Python 3,
so we use that now. To ease future changes, we use tinier RUN and ARG
steps which creates more intermediate images. Such intermediate images
can be reused if some later step is changed in the Dockerfile.

Change-Id: Ic064ddad807329a9bd81085775190615ad89273f
Signed-off-by: Nico Huber <nico.h@gmx.de>
Ticket: https://ticket.coreboot.org/issues/383
Reviewed-on: https://review.coreboot.org/c/flashrom/+/65633
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-09-27 13:51:53 +00:00
Nico Huber
4b62d8d94c manibuilder/ubuntu: Add newer image tags
Add tags for the latest LTS releases Focal Fossa and Jammy Jellyfish.
Only i386 is left behind because it lacks some packages.

Change-Id: I81ab0401c8d69b594fa0db305b4f675f4f08a895
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67011
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-09-27 13:50:28 +00:00
Nico Huber
2b56399b77 manibuilder/debian: Add Bullseye image tags
Add new image tags for all architectures but aarch64 and mips. Alas,
the aarch64 image makes QEMU segfault atm. The mips image lacks most
packages.

Change-Id: If2e58adc25412d3618a5c19a61feab44a3bf916f
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67010
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-09-27 13:50:22 +00:00
Nico Huber
a567559f68 mainbuilder/debian,ubuntu: Disable TLS verification for Git commands
Disable certificate verification for Git commands, including those that
run during tests. At some point, the `ca-certificates` won't get updates
anymore and, ideally, existing docker images will keep working.

Change-Id: I8d7dedeb97777d2f1e6e7e69aefb8cc7ca604940
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66999
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-09-27 13:50:13 +00:00
Nico Huber
e31ca8c7f5 manibuilder/debian: Drop all sid image tags
Sid is the codename of Debian unstable, it's a moving target. Thus,
we can never hope to be able to reproduce what an older image did.

Change-Id: I637daffae8a5f33493de02dc240df63eefcc9aa1
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66998
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-09-27 13:50:09 +00:00
Nico Huber
bbaa5e5056 manibuilder/fedora: Add newer image tags
Also order tags by their architecture for readability.

Change-Id: I68ad93ed26ae11c05b93b4d097478e471f65abc4
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66997
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-09-27 13:50:03 +00:00
Nico Huber
d3b112032e manibuilder/alpine: Add newer image tags
Most of the images built out of the box. Only `alpine:armhf-v3.11`
needs a little workaround for wrong filesystem permissions.

Change-Id: Iac5fea993e6345c7507bd381550f3fbfe55341f9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66995
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-09-27 13:49:57 +00:00
Nico Huber
f9ea15c487 manibuilder/fedora: Disable TLS verification for Git commands
Pull the `ca-certificates` package but also disable certificate
verification for Git commands, including those that run during
tests. At some point, the `ca-certificates` won't get updates
anymore and, ideally, existing docker images will keep working.

Change-Id: Iaac1defd2dc640a9cf9c317d3b13ded5743390df
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66988
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-09-27 13:49:51 +00:00