aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2023-03-06 11:25:52 +1100
committerEdward O'Callaghan <quasisec@chromium.org>2023-04-06 04:43:29 +0000
commit67b5526d5c46bfc4d70fb288b9227097fc113e30 (patch)
treeabb7854554929194daf7e22bc4cd9a052f72e78b /include
parent3ed016f08faa011736443f3b39bf68187d974781 (diff)
downloadflashrom-67b5526d5c46bfc4d70fb288b9227097fc113e30.tar.gz
flashrom-67b5526d5c46bfc4d70fb288b9227097fc113e30.tar.bz2
flashrom-67b5526d5c46bfc4d70fb288b9227097fc113e30.zip
internal: Move laptop_ok into board_cfg
Due to how internal is structured around chipset_flash_enable() entry we need to prepare a crafted programmer_cfg that contains a board_enable substructure with data derived from the board_enable subsystem. While this is certainly not perfection, it does make clear the relationships between board_enable into chipset_flash_enable and subsequently the overall internal programmer initialisation in a RAII fashion at the type level over closure upon global state that is impossible to reason about. Also flip predicate in report_nonwl_laptop_detected() and return early with the trivial base-case. TEST=`$ sudo ./flashrom -p internal --flash-name`. Change-Id: I459215253845c2af73262943ce91a36464e9eb06 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/73456 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sam McNally <sammc@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/programmer.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/programmer.h b/include/programmer.h
index 157de2e2..5b304f55 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -30,7 +30,11 @@ enum programmer_type {
USB,
OTHER,
};
-struct programmer_cfg;
+struct board_cfg;
+struct programmer_cfg {
+ char *params;
+ struct board_cfg *bcfg;
+};
struct dev_entry {
uint16_t vendor_id;
@@ -162,6 +166,7 @@ enum board_match_phase {
struct board_cfg {
int is_laptop;
+ bool laptop_ok;
};
struct board_match {
@@ -267,7 +272,6 @@ extern int superio_count;
#endif
#if CONFIG_INTERNAL == 1
-extern bool g_laptop_ok;
extern bool force_boardmismatch;
void probe_superio(void);
int register_superio(struct superio s);