summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChe-Liang Chiou <clchiou@chromium.org>2011-08-23 10:59:46 +0800
committerSimon Glass <sjg@chromium.org>2011-08-29 12:28:31 -0700
commitdca1391773f23078eca06892058bda67daa875b2 (patch)
tree709b00ba3c1980ff68c8b80b7ab2257a16fe3498 /lib
parente331864fd3b94a70b38c3c111e8a15347cdcc6ac (diff)
CHROMIUM: guard boot_kernel fdt codes with #ifdef
boot_kernel sets up pointer to crossystem data for embedding into kernel device tree unconditionally regarding CONFIG_OF_UPDATE_FDT_BEFORE_BOOT. This patch guards boot_kernel codes that are specific to kernel device tree with the config flag. Note: x86 boards might use a mechanism other than device tree to deliver crossystem data to kernel. BUG=none TEST=emerge-{tegra2_aebl,x86-alex} chromeos-u-boot Change-Id: Ifd04af1681d72c918c838ba3713ddecaca0ff18a Reviewed-on: http://gerrit.chromium.org/gerrit/6466 Tested-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/chromeos/boot_kernel.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/chromeos/boot_kernel.c b/lib/chromeos/boot_kernel.c
index eb0e0afe72..55a847399b 100644
--- a/lib/chromeos/boot_kernel.c
+++ b/lib/chromeos/boot_kernel.c
@@ -21,11 +21,13 @@
#define PREFIX "boot_kernel: "
+#ifdef CONFIG_OF_UPDATE_FDT_BEFORE_BOOT
/*
* We uses a static variable to communicate with fit_update_fdt_before_boot().
* For more information, please see commit log.
*/
static crossystem_data_t *g_crossystem_data = NULL;
+#endif /* CONFIG_OF_UPDATE_FDT_BEFORE_BOOT */
/* defined in common/cmd_bootm.c */
int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
@@ -258,7 +260,10 @@ int boot_kernel(VbSelectAndLoadKernelParams *kparams, crossystem_data_t *cdata)
VBDEBUG_PUTS(getenv("bootargs"));
VBDEBUG_PUTS("\n");
+#ifdef CONFIG_OF_UPDATE_FDT_BEFORE_BOOT
g_crossystem_data = cdata;
+#endif /* CONFIG_OF_UPDATE_FDT_BEFORE_BOOT */
+
#ifdef CONFIG_X86
params = (struct boot_params *)(uintptr_t)
(kparams->bootloader_address - CROS_PARAMS_SIZE);
@@ -272,6 +277,7 @@ int boot_kernel(VbSelectAndLoadKernelParams *kparams, crossystem_data_t *cdata)
return 1;
}
+#ifdef CONFIG_OF_UPDATE_FDT_BEFORE_BOOT
/*
* This function does the last chance FDT update before booting to kernel.
* Currently we modify the FDT by embedding crossystem data. So before
@@ -294,3 +300,4 @@ int fit_update_fdt_before_boot(char *fdt, ulong *new_size)
*new_size = ns;
return 0;
}
+#endif /* CONFIG_OF_UPDATE_FDT_BEFORE_BOOT */