mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 23:22:37 +02:00
internal: Move is_laptop into board_cfg
Change-Id: I24e38e4457299934acdcd70325d0bf0f4b139e5f Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/73455 Reviewed-by: Sam McNally <sammc@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
40cc15f55d
commit
3ed016f08f
@ -2282,7 +2282,7 @@ static int it8718f_gpio63_raise(struct board_cfg *cfg)
|
|||||||
static int p2_not_a_laptop(struct board_cfg *cfg)
|
static int p2_not_a_laptop(struct board_cfg *cfg)
|
||||||
{
|
{
|
||||||
/* label this board as not a laptop */
|
/* label this board as not a laptop */
|
||||||
g_is_laptop = 0;
|
cfg->is_laptop = 0;
|
||||||
msg_pdbg("Laptop detection overridden by P2 board enable.\n");
|
msg_pdbg("Laptop detection overridden by P2 board enable.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2292,7 +2292,7 @@ static int p2_not_a_laptop(struct board_cfg *cfg)
|
|||||||
*/
|
*/
|
||||||
static int p2_whitelist_laptop(struct board_cfg *cfg)
|
static int p2_whitelist_laptop(struct board_cfg *cfg)
|
||||||
{
|
{
|
||||||
g_is_laptop = 1;
|
cfg->is_laptop = 1;
|
||||||
g_laptop_ok = true;
|
g_laptop_ok = true;
|
||||||
msg_pdbg("Whitelisted laptop detected.\n");
|
msg_pdbg("Whitelisted laptop detected.\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -161,6 +161,7 @@ enum board_match_phase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct board_cfg {
|
struct board_cfg {
|
||||||
|
int is_laptop;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct board_match {
|
struct board_match {
|
||||||
@ -266,7 +267,6 @@ extern int superio_count;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_INTERNAL == 1
|
#if CONFIG_INTERNAL == 1
|
||||||
extern int g_is_laptop;
|
|
||||||
extern bool g_laptop_ok;
|
extern bool g_laptop_ok;
|
||||||
extern bool force_boardmismatch;
|
extern bool force_boardmismatch;
|
||||||
void probe_superio(void);
|
void probe_superio(void);
|
||||||
|
11
internal.c
11
internal.c
@ -27,7 +27,6 @@
|
|||||||
#include "hwaccess_x86_io.h"
|
#include "hwaccess_x86_io.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int g_is_laptop = 0;
|
|
||||||
bool g_laptop_ok = false;
|
bool g_laptop_ok = false;
|
||||||
|
|
||||||
bool force_boardmismatch = false;
|
bool force_boardmismatch = false;
|
||||||
@ -149,7 +148,7 @@ static int internal_init(const struct programmer_cfg *cfg)
|
|||||||
const char *cb_model = NULL;
|
const char *cb_model = NULL;
|
||||||
#endif
|
#endif
|
||||||
bool force_boardenable = false;
|
bool force_boardenable = false;
|
||||||
struct board_cfg bcfg;
|
struct board_cfg bcfg = {0};
|
||||||
|
|
||||||
ret = get_params(cfg,
|
ret = get_params(cfg,
|
||||||
&force_boardenable, &force_boardmismatch,
|
&force_boardenable, &force_boardmismatch,
|
||||||
@ -204,9 +203,9 @@ static int internal_init(const struct programmer_cfg *cfg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_is_laptop = 2; /* Assume that we don't know by default. */
|
bcfg.is_laptop = 2; /* Assume that we don't know by default. */
|
||||||
|
|
||||||
dmi_init(&g_is_laptop);
|
dmi_init(&bcfg.is_laptop);
|
||||||
|
|
||||||
/* In case Super I/O probing would cause pretty explosions. */
|
/* In case Super I/O probing would cause pretty explosions. */
|
||||||
board_handle_before_superio(&bcfg, force_boardenable);
|
board_handle_before_superio(&bcfg, force_boardenable);
|
||||||
@ -229,7 +228,7 @@ static int internal_init(const struct programmer_cfg *cfg)
|
|||||||
* this isn't a laptop. Board-enables may override this,
|
* this isn't a laptop. Board-enables may override this,
|
||||||
* non-legacy buses (SPI and opaque atm) are probed anyway.
|
* non-legacy buses (SPI and opaque atm) are probed anyway.
|
||||||
*/
|
*/
|
||||||
if (g_is_laptop && !(g_laptop_ok || force_laptop || (not_a_laptop && g_is_laptop == 2)))
|
if (bcfg.is_laptop && !(g_laptop_ok || force_laptop || (not_a_laptop && bcfg.is_laptop == 2)))
|
||||||
internal_buses_supported = BUS_NONE;
|
internal_buses_supported = BUS_NONE;
|
||||||
|
|
||||||
/* try to enable it. Failure IS an option, since not all motherboards
|
/* try to enable it. Failure IS an option, since not all motherboards
|
||||||
@ -259,7 +258,7 @@ static int internal_init(const struct programmer_cfg *cfg)
|
|||||||
internal_par_init(internal_buses_supported);
|
internal_par_init(internal_buses_supported);
|
||||||
|
|
||||||
/* Report if a non-whitelisted laptop is detected that likely uses a legacy bus. */
|
/* Report if a non-whitelisted laptop is detected that likely uses a legacy bus. */
|
||||||
report_nonwl_laptop_detected(g_is_laptop, g_laptop_ok);
|
report_nonwl_laptop_detected(bcfg.is_laptop, g_laptop_ok);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user