summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorNitin Garg <nitin.garg@freescale.com>2014-05-27 13:38:22 -0500
committerNitin Garg <nitin.garg@freescale.com>2014-05-27 22:18:37 -0500
commit1309b1ed78b3156310cc1564d669e8e2b1c0ce5f (patch)
tree7840b98fd5b31a0cee5aaab87982921b722c07ed /common
parentb8ab9b3eabb94bbbc1eea63e7c0e2a87d2d645f4 (diff)
downloadu-boot-imx-1309b1ed78b3156310cc1564d669e8e2b1c0ce5f.zip
u-boot-imx-1309b1ed78b3156310cc1564d669e8e2b1c0ce5f.tar.gz
u-boot-imx-1309b1ed78b3156310cc1564d669e8e2b1c0ce5f.tar.bz2
ENGR00315499-8 Auto check if boot from usb
If boot from usb, reset environment to default value. Auto apply mfgtools setting and boot mfgtools kernel. Signed-off-by: Frank Li <Frank.li@freescale.com> Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
Diffstat (limited to 'common')
-rw-r--r--common/main.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/common/main.c b/common/main.c
index 8b6f274..c709587 100644
--- a/common/main.c
+++ b/common/main.c
@@ -17,6 +17,11 @@
#include <hush.h>
#include <malloc.h>
#include <menu.h>
+
+#ifdef is_boot_from_usb
+#include <environment.h>
+#endif
+
#include <post.h>
#include <version.h>
#include <watchdog.h>
@@ -342,6 +347,16 @@ static void process_boot_delay(void)
s = getenv ("bootdelay");
bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
+#ifdef is_boot_from_usb
+ if (is_boot_from_usb()) {
+ printf("Boot from USB for mfgtools\n");
+ bootdelay = 0;
+ set_default_env("Use default environment for mfgtools\n");
+ } else {
+ printf("Normal Boot\n");
+ }
+#endif
+
#ifdef CONFIG_OF_CONTROL
bootdelay = fdtdec_get_config_int(gd->fdt_blob, "bootdelay",
bootdelay);
@@ -371,6 +386,13 @@ static void process_boot_delay(void)
else
#endif /* CONFIG_BOOTCOUNT_LIMIT */
s = getenv ("bootcmd");
+#ifdef is_boot_from_usb
+ if (is_boot_from_usb()) {
+ s = getenv("bootcmd_mfg");
+ printf("Run bootcmd_mfg: %s\n", s);
+ }
+#endif
+
#ifdef CONFIG_OF_CONTROL
/* Allow the fdt to override the boot command */
env = fdtdec_get_config_string(gd->fdt_blob, "bootcmd");