aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--board_enable.c19
-rw-r--r--include/programmer.h7
-rw-r--r--internal.c8
3 files changed, 17 insertions, 17 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 */
diff --git a/include/programmer.h b/include/programmer.h
index ad3c5022..9e706d58 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -224,9 +224,9 @@ int it8705f_write_enable(uint8_t port);
uint8_t sio_read(uint16_t port, uint8_t reg);
void sio_write(uint16_t port, uint8_t reg, uint8_t data);
void sio_mask(uint16_t port, uint8_t reg, uint8_t data, uint8_t mask);
-void board_handle_before_superio(void);
-void board_handle_before_laptop(void);
-int board_flash_enable(const char *vendor, const char *model, const char *cb_vendor, const char *cb_model);
+void board_handle_before_superio(bool force_boardenable);
+void board_handle_before_laptop(bool force_boardenable);
+int board_flash_enable(const char *vendor, const char *model, const char *cb_vendor, const char *cb_model, bool force_boardenable);
/* chipset_enable.c */
int chipset_flash_enable(const struct programmer_cfg *cfg);
@@ -263,7 +263,6 @@ extern int superio_count;
#if CONFIG_INTERNAL == 1
extern int is_laptop;
extern bool laptop_ok;
-extern bool force_boardenable;
extern bool force_boardmismatch;
void probe_superio(void);
int register_superio(struct superio s);
diff --git a/internal.c b/internal.c
index f21c4fcb..808039da 100644
--- a/internal.c
+++ b/internal.c
@@ -30,7 +30,6 @@
int is_laptop = 0;
bool laptop_ok = false;
-bool force_boardenable = false;
bool force_boardmismatch = false;
enum chipbustype internal_buses_supported = BUS_NONE;
@@ -202,6 +201,7 @@ static int internal_init(const struct programmer_cfg *cfg)
const char *cb_vendor = NULL;
const char *cb_model = NULL;
#endif
+ bool force_boardenable = false;
ret = get_params(cfg,
&force_boardenable, &force_boardmismatch,
@@ -261,7 +261,7 @@ static int internal_init(const struct programmer_cfg *cfg)
dmi_init();
/* In case Super I/O probing would cause pretty explosions. */
- board_handle_before_superio();
+ board_handle_before_superio(force_boardenable);
/* Probe for the Super I/O chip and fill global struct superio. */
probe_superio();
@@ -274,7 +274,7 @@ static int internal_init(const struct programmer_cfg *cfg)
#endif
/* Check laptop whitelist. */
- board_handle_before_laptop();
+ board_handle_before_laptop(force_boardenable);
/*
* Disable all internal buses by default if we are not sure
@@ -300,7 +300,7 @@ 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)) {
+ if (board_flash_enable(board_vendor, board_model, cb_vendor, cb_model, force_boardenable)) {
msg_perr("Aborting to be safe.\n");
ret = 1;
goto internal_init_exit;