1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 06:01:16 +02:00

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>
This commit is contained in:
Jonathon Hall
2022-09-16 17:05:20 -04:00
committed by Angel Pons
parent 67d5015617
commit 5afd4aeece
13 changed files with 119 additions and 41 deletions

View File

@ -187,6 +187,8 @@ static const struct spi_master spi_master_wbsio = {
.max_data_write = MAX_DATA_UNSPECIFIED,
.command = wbsio_spi_send_command,
.multicommand = default_spi_send_multicommand,
.map_flash_region = physmap,
.unmap_flash_region = physunmap,
.read = wbsio_spi_read,
.write_256 = spi_chip_write_1,
.write_aai = spi_chip_write_1,