summaryrefslogtreecommitdiff
path: root/board/chromebook-x86/chromeos
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2011-09-27 17:44:24 -0700
committerGabe Black <gabeblack@chromium.org>2011-09-28 00:48:28 -0700
commitf93ccfc5213a418782de2be3362c13ec525744a4 (patch)
tree19339aacb48d3e54dea8f4e950c2ae0dd2f1dc4c /board/chromebook-x86/chromeos
parentd9c2eb39a74fe601494fcea4eabb2028d297de0c (diff)
Track whether u-boot was warm or cold booted, and implement is_processor_reset
Code which determined whether u-boot on x86 was warm or cold booted (really if it started at the beginning of the text segment or at the ELF entry point) was partially implemented, and the result was simply dropped when leaving the assembly part of initialization. This change completes the implementation, plumbs the result through to the global data structure, and implements is_processor_reset to check the value there. BUG=chrome-os-partner:5252 TEST=Built and did a twostop boot on Alex. The firmware was resigned using the command below so that the RW firmware would be used. When is_processor_reset was hardcoded to return true all the time, u-boot would go into recovery mode. Now it boots successfully. /resign_firmwarefd.sh image.bin /tmp/image_new.bin ../../tests/devkeys/firmware_data_key.vbprivk ../../tests/devkeys/firmware.keyblock ../../tests/devkeys/firmware_data_key.vbprivk ../../tests/devkeys/firmware.keyblock ../../tests/devkeys/kernel_subkey.vbpubk 1 0 Change-Id: I22b8ed3c3b472807832f1f7e7724f27a218cf4cf Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/8396 Commit-Ready: Gabe Black <gabeblack@chromium.org> Reviewed-by: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
Diffstat (limited to 'board/chromebook-x86/chromeos')
-rw-r--r--board/chromebook-x86/chromeos/power_management.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/board/chromebook-x86/chromeos/power_management.c b/board/chromebook-x86/chromeos/power_management.c
index 068eb18dea..dc060ade94 100644
--- a/board/chromebook-x86/chromeos/power_management.c
+++ b/board/chromebook-x86/chromeos/power_management.c
@@ -12,6 +12,7 @@
#include <chromeos/power_management.h>
#include <common.h>
+#include <asm/global_data.h>
#include <asm/io.h>
#include <pci.h>
@@ -32,10 +33,19 @@
#define SYS_RST (1 << 1)
#define RST_CPU (1 << 2)
+DECLARE_GLOBAL_DATA_PTR;
+
int is_processor_reset(void)
{
- printf("is_processor_reset used but not implemented.\n");
- return 1;
+ /*
+ * This isn't actually whether or not this boot is the result of a
+ * cold boot, it's really whether u-boot was started from the ELF
+ * entry point or from the start of the image. It also isn't really
+ * being used to check if the processor was reset either, it's
+ * checking if this copy of u-boot is the RW or RO firmware. This is a
+ * good enough approximation, though, and causes the right behavior.
+ */
+ return gd->flags & GD_FLG_COLD_BOOT;
}
/* Do a hard reset through the chipset's reset control register. This