summaryrefslogtreecommitdiff
path: root/sb600spi.c
diff options
context:
space:
mode:
authorJonathon Hall <jonathon.hall@puri.sm>2022-09-16 17:05:20 -0400
committerAngel Pons <th3fanbus@gmail.com>2022-10-08 18:45:03 +0000
commit5afd4aeecec3793e62f9b5af363ee300bc879167 (patch)
tree2c4d8fc92e772deba6c861991395841d6de1fe7d /sb600spi.c
parent67d50156170b17e5bca460ab6e5648e2b11f061c (diff)
downloadflashrom-git-5afd4aeecec3793e62f9b5af363ee300bc879167.tar.gz
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>
Diffstat (limited to 'sb600spi.c')
-rw-r--r--sb600spi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sb600spi.c b/sb600spi.c
index 8b02b51d..6020145b 100644
--- a/sb600spi.c
+++ b/sb600spi.c
@@ -600,6 +600,8 @@ static const struct spi_master spi_master_sb600 = {
.max_data_write = FIFO_SIZE_OLD - 3,
.command = sb600_spi_send_command,
.multicommand = default_spi_send_multicommand,
+ .map_flash_region = physmap,
+ .unmap_flash_region = physunmap,
.read = default_spi_read,
.write_256 = default_spi_write_256,
.write_aai = default_spi_write_aai,
@@ -612,6 +614,8 @@ static const struct spi_master spi_master_yangtze = {
.max_data_write = FIFO_SIZE_YANGTZE - 3,
.command = spi100_spi_send_command,
.multicommand = default_spi_send_multicommand,
+ .map_flash_region = physmap,
+ .unmap_flash_region = physunmap,
.read = default_spi_read,
.write_256 = default_spi_write_256,
.write_aai = default_spi_write_aai,
@@ -624,6 +628,8 @@ static const struct spi_master spi_master_promontory = {
.max_data_write = FIFO_SIZE_YANGTZE - 3,
.command = spi100_spi_send_command,
.multicommand = default_spi_send_multicommand,
+ .map_flash_region = physmap,
+ .unmap_flash_region = physunmap,
.read = promontory_read_memmapped,
.write_256 = default_spi_write_256,
.write_aai = default_spi_write_aai,