Anastasia Klimchuk submitted this change.

View Change

Approvals: Nikolai Artemiev: Looks good to me, approved build bot (Jenkins): Verified Anastasia Klimchuk: Looks good to me, approved
ichspi: Merge spi_master implementations for Intel ich

There seems no problem to use ich_spi_probe_opcode() for
spi_master::probe_opcode() on ich7, so we may merge former
spi_master_ich7 and spi_master_ich9 into spi_master_ich, for both
init_ich7_spi() and init_ich_default().

Change-Id: I6a65c97e910622a55da7cef8a10de3af6a99c9e8
Signed-off-by: persmule <persmule@hardenedlinux.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/84593
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
---
M ichspi.c
1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/ichspi.c b/ichspi.c
index d53e671..3388657 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -1991,18 +1991,7 @@
msg_gspew("resulted in 0x%08"PRIx32".\n", mmio_readl(addr));
}

-static const struct spi_master spi_master_ich7 = {
- .max_data_read = 64,
- .max_data_write = 64,
- .command = ich_spi_send_command,
- .multicommand = ich_spi_send_multicommand,
- .map_flash_region = physmap,
- .unmap_flash_region = physunmap,
- .read = default_spi_read,
- .write_256 = default_spi_write_256,
-};
-
-static const struct spi_master spi_master_ich9 = {
+static const struct spi_master spi_master_ich = {
.max_data_read = 64,
.max_data_write = 64,
.command = ich_spi_send_command,
@@ -2054,7 +2043,7 @@
}
ich_init_opcodes(ich_gen);
ich_set_bbar(0, ich_gen);
- register_spi_master(&spi_master_ich7, NULL);
+ register_spi_master(&spi_master_ich, NULL);

return 0;
}
@@ -2420,7 +2409,7 @@
memcpy(opaque_hwseq_data, &hwseq_data, sizeof(*opaque_hwseq_data));
register_opaque_master(&opaque_master_ich_hwseq, opaque_hwseq_data);
} else {
- register_spi_master(&spi_master_ich9, NULL);
+ register_spi_master(&spi_master_ich, NULL);
}

return 0;

To view, visit change 84593. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I6a65c97e910622a55da7cef8a10de3af6a99c9e8
Gerrit-Change-Number: 84593
Gerrit-PatchSet: 4
Gerrit-Owner: Bill XIE <persmule@hardenedlinux.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev@google.com>
Gerrit-Reviewer: Peter Marheine <pmarheine@chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>