From a20ceffa352f790f14361211a1c9931475ec7ac7 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Fri, 12 Aug 2022 14:16:14 +1000 Subject: ichspi.c: Allow passing programmer_cfg directly Modify the type signature of the programmer entry-point xxx_init() functions to allow for the consumption of the programmer parameterisation string data. Also plumb programmer_cfg though get_params. Change-Id: I480589bb50b47fdf5af259d068f49fedfce88ea5 Signed-off-by: Edward O'Callaghan Reviewed-on: https://review.coreboot.org/c/flashrom/+/66661 Tested-by: build bot (Jenkins) Reviewed-by: Anastasia Klimchuk Reviewed-by: Felix Singer --- ichspi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ichspi.c') diff --git a/ichspi.c b/ichspi.c index 78c446f5..855b7fb7 100644 --- a/ichspi.c +++ b/ichspi.c @@ -1872,9 +1872,9 @@ enum ich_spi_mode { ich_swseq }; -static int get_ich_spi_mode_param(enum ich_spi_mode *ich_spi_mode) +static int get_ich_spi_mode_param(const struct programmer_cfg *cfg, enum ich_spi_mode *ich_spi_mode) { - char *const arg = extract_programmer_param_str(NULL, "ich_spi_mode"); + char *const arg = extract_programmer_param_str(cfg, "ich_spi_mode"); if (!arg) { return 0; } else if (!strcmp(arg, "hwseq")) { @@ -1964,7 +1964,7 @@ static void init_chipset_properties(struct swseq_data *swseq, struct hwseq_data } } -static int init_ich_default(void *spibar, enum ich_chipset ich_gen) +static int init_ich_default(const struct programmer_cfg *cfg, void *spibar, enum ich_chipset ich_gen) { unsigned int i; uint16_t tmp2; @@ -1977,7 +1977,7 @@ static int init_ich_default(void *spibar, enum ich_chipset ich_gen) init_chipset_properties(&swseq_data, &g_hwseq_data, &num_freg, &num_pr, ®_pr0, ich_gen); - int ret = get_ich_spi_mode_param(&ich_spi_mode); + int ret = get_ich_spi_mode_param(cfg, &ich_spi_mode); if (ret) return ret; @@ -2212,7 +2212,7 @@ static int init_ich_default(void *spibar, enum ich_chipset ich_gen) return 0; } -int ich_init_spi(void *spibar, enum ich_chipset ich_gen) +int ich_init_spi(const struct programmer_cfg *cfg, void *spibar, enum ich_chipset ich_gen) { ich_generation = ich_gen; ich_spibar = spibar; @@ -2224,7 +2224,7 @@ int ich_init_spi(void *spibar, enum ich_chipset ich_gen) return init_ich7_spi(spibar, ich_gen); case CHIPSET_ICH8: default: /* Future version might behave the same */ - return init_ich_default(spibar, ich_gen); + return init_ich_default(cfg, spibar, ich_gen); } } -- cgit v1.2.3