1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 23:22:37 +02:00

raiden_debug_spi.c: plumb programmer_cfg though get_params

Modify the type signature of the programmer get_param
helper functions to allow for the consumption of the
programmer parameterisation string data.

Change-Id: I20041a9aead513de71c2c384842046f64c1614b6
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66667
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
This commit is contained in:
Edward O'Callaghan 2022-08-12 14:21:58 +10:00 committed by Anastasia Klimchuk
parent 323973b4dd
commit c3df94cb96

View File

@ -1429,7 +1429,7 @@ static int configure_protocol(struct raiden_debug_spi_data *ctx_data)
return 0; return 0;
} }
static int get_ap_request_type(void) static int get_ap_request_type(const struct programmer_cfg *cfg)
{ {
int ap_request = RAIDEN_DEBUG_SPI_REQ_ENABLE_AP; int ap_request = RAIDEN_DEBUG_SPI_REQ_ENABLE_AP;
char *custom_rst_str = extract_programmer_param_str(NULL, "custom_rst"); char *custom_rst_str = extract_programmer_param_str(NULL, "custom_rst");
@ -1448,7 +1448,7 @@ static int get_ap_request_type(void)
return ap_request; return ap_request;
} }
static int get_target(void) static int get_target(const struct programmer_cfg *cfg)
{ {
/** /**
* REQ_ENABLE doesn't specify a target bus, and will be rejected * REQ_ENABLE doesn't specify a target bus, and will be rejected
@ -1459,7 +1459,7 @@ static int get_target(void)
char *target_str = extract_programmer_param_str(NULL, "target"); char *target_str = extract_programmer_param_str(NULL, "target");
if (target_str) { if (target_str) {
if (!strcasecmp(target_str, "ap")) if (!strcasecmp(target_str, "ap"))
request_enable = get_ap_request_type(); request_enable = get_ap_request_type(cfg);
else if (!strcasecmp(target_str, "ec")) else if (!strcasecmp(target_str, "ec"))
request_enable = RAIDEN_DEBUG_SPI_REQ_ENABLE_EC; request_enable = RAIDEN_DEBUG_SPI_REQ_ENABLE_EC;
else { else {
@ -1491,7 +1491,7 @@ static int raiden_debug_spi_init(const struct programmer_cfg *cfg)
int found = 0; int found = 0;
int ret; int ret;
int request_enable = get_target(); int request_enable = get_target(cfg);
if (request_enable < 0) { if (request_enable < 0) {
free(serial); free(serial);
return 1; return 1;