From dca1391773f23078eca06892058bda67daa875b2 Mon Sep 17 00:00:00 2001 From: Che-Liang Chiou Date: Tue, 23 Aug 2011 10:59:46 +0800 Subject: 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 Reviewed-by: Stefan Reinauer Reviewed-by: Simon Glass --- lib/chromeos/boot_kernel.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/chromeos/boot_kernel.c b/lib/chromeos/boot_kernel.c index eb0e0afe724..55a847399bb 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 */ -- cgit v1.2.3