diff options
author | Aaron Durbin <adurbin@chromium.org> | 2016-01-25 16:39:56 -0600 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2016-02-04 17:40:29 +0100 |
commit | 5e29106ee448f9a96cae7e96323cd0cd6b7e7f30 (patch) | |
tree | e8028008a1f159e280b3c2c6cda1146a8a23a5b2 | |
parent | 7bc39a09831e176184d852fa767ffdee6bd96ced (diff) |
google/chromeos: guard cbmem_find() in verstage and bootblock
When vboot_handoff_flag() is called in the bootblock or a separate
verstage there's no memory nor the possibility of dram coming online.
Therefore, don't bother to attempt call cbmem_find().
BUG=chrome-os-partner:44827
BRANCH=glados
TEST=Built chell with separate verstage which pulls in vboot_common.c
dependency. No more linking errors w/ cbmem_find() not being
around.
Change-Id: I494c93adc1c00459fdfaa8ce535c6b4c884ed0fb
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 414ce6aeaff657dc90289b25e5c883562189b154
Original-Change-Id: I8a5f2d154026ce794a70e7ec38883fa3c28fb6e7
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/324070
Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/13580
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r-- | src/vendorcode/google/chromeos/vboot_common.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vendorcode/google/chromeos/vboot_common.c b/src/vendorcode/google/chromeos/vboot_common.c index eef54174f6..28135a0d65 100644 --- a/src/vendorcode/google/chromeos/vboot_common.c +++ b/src/vendorcode/google/chromeos/vboot_common.c @@ -20,6 +20,7 @@ #include <console/console.h> #include <fmap.h> #include <reset.h> +#include <rules.h> #include <stddef.h> #include <string.h> @@ -41,6 +42,12 @@ int vboot_get_handoff_info(void **addr, uint32_t *size) { struct vboot_handoff *vboot_handoff; + /* No flags are available in a separate verstage or bootblock because + * cbmem only comes online when dram does. */ + if ((ENV_VERSTAGE && IS_ENABLED(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK)) || + ENV_BOOTBLOCK) + return -1; + vboot_handoff = cbmem_find(CBMEM_ID_VBOOT_HANDOFF); if (vboot_handoff == NULL) |