summaryrefslogtreecommitdiff
path: root/internal.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-05-05 07:12:40 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-05-05 07:12:40 +0000
commitcbd79a0d706d9660c1cfb51dfddf525447a55752 (patch)
tree27f06e9e298630e25a624033967e8b31c6d73861 /internal.c
parent4fc378f9603b1989f72d99108cc11b65cdf6f10a (diff)
downloadflashrom-cbd79a0d706d9660c1cfb51dfddf525447a55752.tar.gz
Revamp board-specific quirk handling, allow for laptop support
Handle board-specific quirks in three phases: 1. Before Super I/O probing (e.g. blacklisting of some Super I/O probes, or unhiding the Super I/O) 2. Before the laptop enforcement decision (e.g. whitelisting a laptop for flashing) 3. After chipset enabling (all current board enables) Implementation note: All entries in board_pciid_enables get an additional phase parameter. Alternative variants (3 tables instead of 1) also have their downsides, and I chose table bloat over table multiplication). With this patch, it should be possible to whitelist supported laptops with a matching entry (phase P2) in board_pciid_enables which points to a function setting laptop_ok=1. (In case DMI is broken, matching might be a little bit more difficult, but it is still doable.) Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1294 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'internal.c')
-rw-r--r--internal.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/internal.c b/internal.c
index d3866ba..33a4150 100644
--- a/internal.c
+++ b/internal.c
@@ -125,6 +125,7 @@ int register_superio(struct superio s)
#endif
int is_laptop = 0;
+int laptop_ok = 0;
int internal_init(void)
{
@@ -198,6 +199,9 @@ int internal_init(void)
dmi_init();
+ /* In case Super I/O probing would cause pretty explosions. */
+ board_handle_before_superio();
+
/* Probe for the Super I/O chip and fill global struct superio. */
probe_superio();
#else
@@ -208,10 +212,13 @@ int internal_init(void)
*/
#endif
- /* Warn if a laptop is detected. */
- if (is_laptop) {
+ /* Check laptop whitelist. */
+ board_handle_before_laptop();
+
+ /* Warn if a non-whitelisted laptop is detected. */
+ if (is_laptop && !laptop_ok) {
msg_perr("========================================================================\n"
- "WARNING! You seem to be running flashrom on a laptop.\n"
+ "WARNING! You seem to be running flashrom on an unsupported laptop.\n"
"Laptops, notebooks and netbooks are difficult to support and we recommend\n"
"to use the vendor flashing utility. The embedded controller (EC) in these\n"
"machines often interacts badly with flashing.\n"