aboutsummaryrefslogtreecommitdiffstats
path: root/board_enable.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2022-11-28 18:00:37 +1100
committerEdward O'Callaghan <quasisec@chromium.org>2023-01-15 01:21:10 +0000
commit2b72cdb4f44fa3828a7cac09f288d94e9ce12ecd (patch)
tree771c00d0a632b84b3f3454808a5d8b1e7a9b00a1 /board_enable.c
parent0bc84bfe4a2b9bb8cbfa719f6221eef2d8f866ca (diff)
downloadflashrom-2b72cdb4f44fa3828a7cac09f288d94e9ce12ecd.tar.gz
flashrom-2b72cdb4f44fa3828a7cac09f288d94e9ce12ecd.tar.bz2
flashrom-2b72cdb4f44fa3828a7cac09f288d94e9ce12ecd.zip
internal,board_enable: Remove force_boardenable from globals
Make `force_boardenable` stack local to the internal_init() entry-point. It's life-time should not exceed that of the internal's init entry function. Change-Id: I3324681f024003694a5531d9d35bb13d2c583eb0 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/70031 Reviewed-by: Sam McNally <sammc@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'board_enable.c')
-rw-r--r--board_enable.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/board_enable.c b/board_enable.c
index bf261733..d35b151b 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -2683,7 +2683,7 @@ static const struct board_match *board_match_pci_ids(enum board_match_phase phas
return NULL;
}
-static int board_enable_safetycheck(const struct board_match *board)
+static int board_enable_safetycheck(const struct board_match *board, bool force_boardenable)
{
if (!board)
return 1;
@@ -2705,7 +2705,7 @@ static int board_enable_safetycheck(const struct board_match *board)
}
/* FIXME: Should this be identical to board_flash_enable? */
-static int board_handle_phase(enum board_match_phase phase)
+static int board_handle_phase(enum board_match_phase phase, bool force_boardenable)
{
const struct board_match *board = NULL;
@@ -2714,7 +2714,7 @@ static int board_handle_phase(enum board_match_phase phase)
if (!board)
return 0;
- if (board_enable_safetycheck(board))
+ if (board_enable_safetycheck(board, force_boardenable))
return 0;
if (!board->enable) {
@@ -2726,17 +2726,18 @@ static int board_handle_phase(enum board_match_phase phase)
return board->enable();
}
-void board_handle_before_superio(void)
+void board_handle_before_superio(bool force_boardenable)
{
- board_handle_phase(P1);
+ board_handle_phase(P1, force_boardenable);
}
-void board_handle_before_laptop(void)
+void board_handle_before_laptop(bool force_boardenable)
{
- board_handle_phase(P2);
+ board_handle_phase(P2, force_boardenable);
}
-int board_flash_enable(const char *vendor, const char *model, const char *cb_vendor, const char *cb_model)
+int board_flash_enable(const char *vendor, const char *model, const char *cb_vendor, const char *cb_model,
+ bool force_boardenable)
{
const struct board_match *board = NULL;
int ret = 0;
@@ -2762,7 +2763,7 @@ int board_flash_enable(const char *vendor, const char *model, const char *cb_ven
return 0;
}
- if (board_enable_safetycheck(board))
+ if (board_enable_safetycheck(board, force_boardenable))
return 1;
/* limit the maximum size of the parallel bus */