summaryrefslogtreecommitdiffstats
path: root/arch/x86/lib/init_wrappers.c
diff options
context:
space:
mode:
authorMinkyu Kang <mk7.kang@samsung.com>2012-12-10 13:44:41 +0900
committerMinkyu Kang <mk7.kang@samsung.com>2012-12-10 14:13:27 +0900
commit2c601c7208713ba9b2158c57adcf515f4bdbc212 (patch)
tree9f6e70f33565beceb956b98c261bee19731d50d2 /arch/x86/lib/init_wrappers.c
parentb8a7c467960ffb4d5a5e1eef5f7783fb6f594542 (diff)
parentfd4d564b3c80b111f18c93adb14233a6a7ddb0e9 (diff)
downloadtalos-obmc-uboot-2c601c7208713ba9b2158c57adcf515f4bdbc212.tar.gz
talos-obmc-uboot-2c601c7208713ba9b2158c57adcf515f4bdbc212.zip
Merge branch 'master' of git://git.denx.de/u-boot into resolve
Conflicts: README board/samsung/universal_c210/universal.c drivers/misc/Makefile drivers/power/power_fsl.c include/configs/mx35pdk.h include/configs/mx53loco.h include/configs/seaboard.h
Diffstat (limited to 'arch/x86/lib/init_wrappers.c')
-rw-r--r--arch/x86/lib/init_wrappers.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/arch/x86/lib/init_wrappers.c b/arch/x86/lib/init_wrappers.c
index 71449fe6fa..cca018fa9b 100644
--- a/arch/x86/lib/init_wrappers.c
+++ b/arch/x86/lib/init_wrappers.c
@@ -21,6 +21,7 @@
* MA 02111-1307 USA
*/
#include <common.h>
+#include <environment.h>
#include <serial.h>
#include <kgdb.h>
#include <scsi.h>
@@ -36,10 +37,35 @@ int serial_initialize_r(void)
return 0;
}
+/*
+ * Tell if it's OK to load the environment early in boot.
+ *
+ * If CONFIG_OF_CONFIG is defined, we'll check with the FDT to see
+ * if this is OK (defaulting to saying it's not OK).
+ *
+ * NOTE: Loading the environment early can be a bad idea if security is
+ * important, since no verification is done on the environment.
+ *
+ * @return 0 if environment should not be loaded, !=0 if it is ok to load
+ */
+static int should_load_env(void)
+{
+#ifdef CONFIG_OF_CONTROL
+ return fdtdec_get_config_int(gd->fdt_blob, "load-environment", 0);
+#elif defined CONFIG_DELAY_ENVIRONMENT
+ return 0;
+#else
+ return 1;
+#endif
+}
+
int env_relocate_r(void)
{
/* initialize environment */
- env_relocate();
+ if (should_load_env())
+ env_relocate();
+ else
+ set_default_env(NULL);
return 0;
}
OpenPOWER on IntegriCloud