diff options
author | Edward O'Callaghan <quasisec@google.com> | 2022-10-25 09:34:32 +1100 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2022-11-03 23:56:30 +0000 |
commit | c0fefa8084b31c523efbeb2cce10c4afab2016d5 (patch) | |
tree | 927b983383f00ee3f9923bf97b4803a1c589240e /ichspi.c | |
parent | bce96c2d61f8c95686437d3af0241cbfadd012fc (diff) | |
download | flashrom-c0fefa8084b31c523efbeb2cce10c4afab2016d5.tar.gz flashrom-c0fefa8084b31c523efbeb2cce10c4afab2016d5.tar.bz2 flashrom-c0fefa8084b31c523efbeb2cce10c4afab2016d5.zip |
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>
Diffstat (limited to 'ichspi.c')
-rw-r--r-- | ichspi.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1350,6 +1350,7 @@ static void ich_start_hwseq_xfer(const struct flashctx *flash, 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 @@ static void ich_start_hwseq_xfer(const struct flashctx *flash, /* 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 */ |