summaryrefslogtreecommitdiffstats
path: root/internal.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2022-12-27 10:33:38 +1100
committerEdward O'Callaghan <quasisec@chromium.org>2023-04-02 01:00:13 +0000
commit40cc15f55db5bf68c38be5a5cb695c38e75ffb37 (patch)
tree7772e0789e1de3eec836a966e00a99f0cc09596a /internal.c
parent73e47091103891f2e3c12c5c51840faf9b57e436 (diff)
downloadflashrom-40cc15f55db5bf68c38be5a5cb695c38e75ffb37.tar.gz
flashrom-40cc15f55db5bf68c38be5a5cb695c38e75ffb37.tar.bz2
flashrom-40cc15f55db5bf68c38be5a5cb695c38e75ffb37.zip
board_enables: Allow for prog cfg coupling with board cfg
Some boards need to configure the programmer in specific ways. For example, a programmer such as internal may need to be configured either as laptop or not type and as such the board enable needs the ability to feed state back into the programmer configuration. Plumb this though by creating a board_cfg structure that can be packed. Change-Id: I7058a693e714a6966a842ae97cc8da7296e63e5e Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/71623 Reviewed-by: Sam McNally <sammc@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'internal.c')
-rw-r--r--internal.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/internal.c b/internal.c
index 5d836e509..c8d0a93fc 100644
--- a/internal.c
+++ b/internal.c
@@ -149,6 +149,7 @@ static int internal_init(const struct programmer_cfg *cfg)
const char *cb_model = NULL;
#endif
bool force_boardenable = false;
+ struct board_cfg bcfg;
ret = get_params(cfg,
&force_boardenable, &force_boardmismatch,
@@ -208,7 +209,7 @@ static int internal_init(const struct programmer_cfg *cfg)
dmi_init(&g_is_laptop);
/* In case Super I/O probing would cause pretty explosions. */
- board_handle_before_superio(force_boardenable);
+ board_handle_before_superio(&bcfg, force_boardenable);
/* Probe for the Super I/O chip and fill global struct superio. */
probe_superio();
@@ -221,7 +222,7 @@ static int internal_init(const struct programmer_cfg *cfg)
#endif
/* Check laptop whitelist. */
- board_handle_before_laptop(force_boardenable);
+ board_handle_before_laptop(&bcfg, force_boardenable);
/*
* Disable all internal buses by default if we are not sure
@@ -247,7 +248,8 @@ static int internal_init(const struct programmer_cfg *cfg)
* parallel writes on IT8705F. Also, this handles the manual chip select for Gigabyte's DualBIOS. */
init_superio_ite(cfg);
- if (board_flash_enable(board_vendor, board_model, cb_vendor, cb_model, force_boardenable)) {
+ if (board_flash_enable(&bcfg,
+ board_vendor, board_model, cb_vendor, cb_model, force_boardenable)) {
msg_perr("Aborting to be safe.\n");
ret = 1;
goto internal_init_exit;