Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4216
-gerrit
commit 7e9a6e7fa627f369442d55afcd23a9705cb5b884
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Thu May 30 10:40:54 2013 -0500
haswell: check for clean reset
When an INIT# is delivered to the CPU the CPU starts
executing from the reset vector. However, the internal state
is maintained. Therefore, check for such a condition and
reset the system.
Issues 'apreset warm' on the EC console. INIT# is sent and
CPU notices it's not a clean reset and forces one. No hangs.
Change-Id: I71229e0e5015ba8c60f5989c533268604ecc1ecc
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57111
Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
---
src/cpu/intel/haswell/bootblock.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/cpu/intel/haswell/bootblock.c b/src/cpu/intel/haswell/bootblock.c
index bb065c8..e502cfa 100644
--- a/src/cpu/intel/haswell/bootblock.c
+++ b/src/cpu/intel/haswell/bootblock.c
@@ -112,10 +112,28 @@ static void set_flex_ratio_to_tdp_nominal(void)
}
}
+static void check_for_clean_reset(void)
+{
+ msr_t msr;
+ msr = rdmsr(MTRRdefType_MSR);
+
+ /* Use the MTRR default type MSR as a proxy for detecting INIT#.
+ * Reset the system if any known bits are set in that MSR. That is
+ * an indication of the CPU not being properly reset. */
+ if (msr.lo & (MTRRdefTypeEn | MTRRdefTypeFixEn)) {
+ outb(0x0, 0xcf9);
+ outb(0x6, 0xcf9);
+ while (1) {
+ asm("hlt");
+ }
+ }
+}
+
static void bootblock_cpu_init(void)
{
/* Set flex ratio and reset if needed */
set_flex_ratio_to_tdp_nominal();
+ check_for_clean_reset();
enable_rom_caching();
intel_update_microcode_from_cbfs();
}
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4218
-gerrit
commit 03333bcd3e98f4f9ea5aff692ac29c0dbb5e3aef
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Tue Jun 4 08:57:54 2013 -0500
vboot: use out_flags to indicate dev mode
In order to make the proper decision on loading the
option rom or not the developer mode setting needs to be
known. Under early firmware selection it is possible to know
the state of developer mode by a flag in out flags. Use this
flag when early firmware selection is being employed to determine
if developer mode is enabled or not.
Change-Id: I9c226d368e92ddf8f14ce4dcde00da144de2a5f3
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57380
Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
---
src/vendorcode/google/chromeos/chromeos.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/src/vendorcode/google/chromeos/chromeos.c b/src/vendorcode/google/chromeos/chromeos.c
index 6f1fe72..c2cc0e1 100644
--- a/src/vendorcode/google/chromeos/chromeos.c
+++ b/src/vendorcode/google/chromeos/chromeos.c
@@ -26,9 +26,28 @@
#include <cbmem.h>
#include <console/console.h>
+#if CONFIG_VBOOT_VERIFY_FIRMWARE
+static int vboot_enable_developer(void)
+{
+ struct vboot_handoff *vbho;
+
+ vbho = cbmem_find(CBMEM_ID_VBOOT_HANDOFF);
+
+ if (vbho == NULL) {
+ printk(BIOS_ERR, "%s: Couldn't find vboot_handoff structure!\n",
+ __func__);
+ return 0;
+ }
+
+ return !!(vbho->init_params.out_flags & VB_INIT_OUT_ENABLE_DEVELOPER);
+}
+#else
+static inline int vboot_enable_developer(void) { return 0; }
+#endif
+
int developer_mode_enabled(void)
{
- return get_developer_mode_switch();
+ return get_developer_mode_switch() || vboot_enable_developer();
}
int recovery_mode_enabled(void)
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4220
-gerrit
commit a3b1e83c0b74a76176eaf02a9b15aac88c477385
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Mon Jun 3 10:45:08 2013 -0700
haswell boards: Enable VIRTUAL_DEV_SWITCH
This config option was not enabled which was preventing
the user from enabling developer mode from recovery mode.
With this enabled we can disable the "dev mode by default"
behavior and let people enable it by entering recovery mode.
This will make the firmware behave like a typical chromeos
device.
Peppy is left in "default dev mode" until after bringup.
1) boot slippy in normal mode by default
2) enter recovery mode with servo button
3) Ctrl+D on USB keyboard to enter developer mode
4) boot slippy in developer mode
Change-Id: I414c0d10dd0489e3c89798f75a2872a43297c8d8
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57350
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/mainboard/google/falco/Kconfig | 1 +
src/mainboard/google/falco/chromeos.c | 2 +-
src/mainboard/google/peppy/Kconfig | 1 +
src/mainboard/google/slippy/Kconfig | 1 +
src/mainboard/google/slippy/chromeos.c | 2 +-
5 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/mainboard/google/falco/Kconfig b/src/mainboard/google/falco/Kconfig
index 3a08086..3c0c576 100644
--- a/src/mainboard/google/falco/Kconfig
+++ b/src/mainboard/google/falco/Kconfig
@@ -10,6 +10,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select BOARD_ROMSIZE_KB_8192
select EC_GOOGLE_CHROMEEC
select EC_SOFTWARE_SYNC
+ select VIRTUAL_DEV_SWITCH
select HAVE_ACPI_TABLES
select HAVE_OPTION_TABLE
select HAVE_ACPI_RESUME
diff --git a/src/mainboard/google/falco/chromeos.c b/src/mainboard/google/falco/chromeos.c
index 1b70fde..51d625b 100644
--- a/src/mainboard/google/falco/chromeos.c
+++ b/src/mainboard/google/falco/chromeos.c
@@ -83,7 +83,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
/* The dev-switch is virtual */
int get_developer_mode_switch(void)
{
- return 1;
+ return 0;
}
/* There are actually two recovery switches. One is the magic keyboard chord,
diff --git a/src/mainboard/google/peppy/Kconfig b/src/mainboard/google/peppy/Kconfig
index 5eb8b95..74a04fb 100644
--- a/src/mainboard/google/peppy/Kconfig
+++ b/src/mainboard/google/peppy/Kconfig
@@ -10,6 +10,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select BOARD_ROMSIZE_KB_8192
select EC_GOOGLE_CHROMEEC
select EC_SOFTWARE_SYNC
+ select VIRTUAL_DEV_SWITCH
select HAVE_ACPI_TABLES
select HAVE_OPTION_TABLE
select HAVE_ACPI_RESUME
diff --git a/src/mainboard/google/slippy/Kconfig b/src/mainboard/google/slippy/Kconfig
index a53ac00..aaea947 100644
--- a/src/mainboard/google/slippy/Kconfig
+++ b/src/mainboard/google/slippy/Kconfig
@@ -10,6 +10,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select BOARD_ROMSIZE_KB_8192
select EC_GOOGLE_CHROMEEC
select EC_SOFTWARE_SYNC
+ select VIRTUAL_DEV_SWITCH
select HAVE_ACPI_TABLES
select HAVE_OPTION_TABLE
select HAVE_ACPI_RESUME
diff --git a/src/mainboard/google/slippy/chromeos.c b/src/mainboard/google/slippy/chromeos.c
index 1b70fde..51d625b 100644
--- a/src/mainboard/google/slippy/chromeos.c
+++ b/src/mainboard/google/slippy/chromeos.c
@@ -83,7 +83,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
/* The dev-switch is virtual */
int get_developer_mode_switch(void)
{
- return 1;
+ return 0;
}
/* There are actually two recovery switches. One is the magic keyboard chord,
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4223
-gerrit
commit 5ab1d5f4991082bcfc138a007dd44aa4dc45635e
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Tue Jun 4 10:14:42 2013 -0700
vboot: use out_flags to indicate recovery mode
In order to make the proper decision on loading the
option rom or not the recovery mode setting needs to be
known. Normally this is detected by asking the EC,
but if recovery is requested with crossystem then the EC
does not know about it. Instead we need to check the
output flags from VbInit().
Change-Id: I09358e6fd979b4af6b37a13115ac34db3d98b09d
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57474
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/vendorcode/google/chromeos/chromeos.c | 30 ++++++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/src/vendorcode/google/chromeos/chromeos.c b/src/vendorcode/google/chromeos/chromeos.c
index c2cc0e1..828cfd2 100644
--- a/src/vendorcode/google/chromeos/chromeos.c
+++ b/src/vendorcode/google/chromeos/chromeos.c
@@ -41,8 +41,21 @@ static int vboot_enable_developer(void)
return !!(vbho->init_params.out_flags & VB_INIT_OUT_ENABLE_DEVELOPER);
}
+
+static int vboot_enable_recovery(void)
+{
+ struct vboot_handoff *vbho;
+
+ vbho = cbmem_find(CBMEM_ID_VBOOT_HANDOFF);
+
+ if (vbho == NULL)
+ return 0;
+
+ return !!(vbho->init_params.out_flags & VB_INIT_OUT_ENABLE_RECOVERY);
+}
#else
static inline int vboot_enable_developer(void) { return 0; }
+static inline int vboot_enable_recovery(void) { return 0; }
#endif
int developer_mode_enabled(void)
@@ -52,11 +65,20 @@ int developer_mode_enabled(void)
int recovery_mode_enabled(void)
{
- /* TODO(reinauer): get information from VbInit.
- * the recovery mode switch is not the only reason to go
- * to recovery mode.
+ /*
+ * This is called in multiple places and has to detect
+ * recovery mode triggered from the EC and via shared
+ * recovery reason set with crossystem.
+ *
+ * If shared recovery reason is set:
+ * - before VbInit then get_recovery_mode_from_vbnv() is true
+ * - after VbInit then vboot_enable_recovery() is true
+ *
+ * Otherwise the mainboard handler for get_recovery_mode_switch()
+ * will detect recovery mode initiated by the EC.
*/
- return get_recovery_mode_switch() || get_recovery_mode_from_vbnv();
+ return get_recovery_mode_switch() || get_recovery_mode_from_vbnv() ||
+ vboot_enable_recovery();
}
#if CONFIG_VBOOT_VERIFY_FIRMWARE
Stefan Reinauer (stefan.reinauer(a)coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4222
-gerrit
commit 45d620dda466add28369c81db7dcb6b684468516
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Tue Jun 4 10:08:54 2013 -0700
vboot: Do not pass OPROM_MATTERS flag to VbInit
Since we are using VBNV to determine if developer mode is
active we do not need the messy OPROM hook magic any longer.
Change-Id: I1b9effef3ef2aa84e916060d8e61ee42515a2b7c
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57473
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/vendorcode/google/chromeos/gnvs.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/vendorcode/google/chromeos/gnvs.c b/src/vendorcode/google/chromeos/gnvs.c
index ba1588d..5ee3665 100644
--- a/src/vendorcode/google/chromeos/gnvs.c
+++ b/src/vendorcode/google/chromeos/gnvs.c
@@ -49,15 +49,9 @@ void chromeos_init_vboot(chromeos_acpi_t *chromeos)
vboot_handoff = cbmem_find(CBMEM_ID_VBOOT_HANDOFF);
- if (vboot_handoff != NULL) {
- vboot_handoff->init_params.flags |= VB_INIT_FLAG_OPROM_MATTERS;
- if (oprom_is_loaded)
- vboot_handoff->init_params.flags |=
- VB_INIT_FLAG_OPROM_LOADED;
-
+ if (vboot_handoff != NULL)
memcpy(&chromeos->vdat[0], &vboot_handoff->shared_data[0],
ARRAY_SIZE(chromeos->vdat));
- }
#endif
#if CONFIG_ELOG