Edward O'Callaghan submitted this change.

View Change


Approvals: build bot (Jenkins): Verified Felix Singer: Looks good to me, approved Subrata Banik: Looks good to me, approved
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>
---
M ichspi.c
1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/ichspi.c b/ichspi.c
index 5d9fe0c..bbd2c91 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -1350,6 +1350,7 @@
uint32_t addr_mask)
{
uint16_t hsfc;
+ struct hwseq_data *hwseq_data = get_hwseq_data_from_context(flash);

/* Sets flash_addr in FADDR */
ich_hwseq_set_addr(flash_addr, addr_mask);
@@ -1359,7 +1360,7 @@

/* Set up transaction parameters. */
hsfc = REGREAD16(ICH9_REG_HSFC);
- hsfc &= ~g_hwseq_data.hsfc_fcycle; /* clear operation */
+ hsfc &= ~hwseq_data->hsfc_fcycle; /* clear operation */
hsfc |= hsfc_cycle;
hsfc |= HSFC_FDBC_VAL(len - 1);
hsfc |= HSFC_FGO; /* start */

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib0ccf4b32fd1e2be2ecc3a4a4c6e397c8e901a0a
Gerrit-Change-Number: 68773
Gerrit-PatchSet: 2
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger@posteo.net>
Gerrit-Reviewer: Subrata Banik <subratabanik@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged