aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSimon Glass2020-11-04 09:57:36 -0700
committerBin Meng2020-11-06 09:51:31 +0800
commit9910fc183a165db9d836877cd6d9c07e8ce71338 (patch)
treee1b977ac9b0244aeaf6eb52f991da9b9dc850a16 /arch
parent96d0aa91430b885eed2a01f0b9edc0107687ab06 (diff)
x86: Set up Chrome OS to boot into developer mode
Set up a few fields necessarily to make Chrome OS boot without showing a firmware error. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/cpu/apollolake/acpi.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/arch/x86/cpu/apollolake/acpi.c b/arch/x86/cpu/apollolake/acpi.c
index 5af8a181b1e..fd21c0b4968 100644
--- a/arch/x86/cpu/apollolake/acpi.c
+++ b/arch/x86/cpu/apollolake/acpi.c
@@ -65,6 +65,21 @@ int arch_write_sci_irq_select(uint scis)
return 0;
}
+/**
+ * chromeos_init_acpi() - Initialise basic data to boot Chrome OS
+ *
+ * This tells Chrome OS to boot in developer mode
+ *
+ * @cros: Structure to initialise
+ */
+static void chromeos_init_acpi(struct chromeos_acpi_gnvs *cros)
+{
+ cros->active_main_fw = 1;
+ cros->active_main_fw = 1; /* A */
+ cros->switches = CHSW_DEVELOPER_SWITCH;
+ cros->main_fw_type = 2; /* Developer */
+}
+
int acpi_create_gnvs(struct acpi_global_nvs *gnvs)
{
struct udevice *cpu;
@@ -75,12 +90,9 @@ int acpi_create_gnvs(struct acpi_global_nvs *gnvs)
/* TODO(sjg@chromium.org): Add the console log to gnvs->cbmc */
-/* Disable this code until a later patch */
-#if 0
- /* Initialise Verified Boot data */
- chromeos_init_acpi(&gnvs->chromeos);
- gnvs->chromeos.vbt2 = ACTIVE_ECFW_RO;
-#endif
+ if (IS_ENABLED(CONFIG_CHROMEOS))
+ chromeos_init_acpi(&gnvs->chromeos);
+
/* Set unknown wake source */
gnvs->pm1i = ~0ULL;
@@ -93,6 +105,8 @@ int acpi_create_gnvs(struct acpi_global_nvs *gnvs)
gnvs->pcnt = ret;
}
+ gnvs->dpte = 1;
+
return 0;
}