summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorPeng Fan <Peng.Fan@freescale.com>2015-03-14 17:21:24 +0800
committerPeng Fan <Peng.Fan@freescale.com>2015-04-29 14:52:33 +0800
commit532d5e69a1642bd8d1c1f928d3a35b414bbce81b (patch)
tree2eed368a791e133d0a7d94b9e01b7f2e850e0e52 /common
parent77ca54d246cf90af88afe4eb93e63823b1de1e4a (diff)
downloadu-boot-imx-532d5e69a1642bd8d1c1f928d3a35b414bbce81b.zip
u-boot-imx-532d5e69a1642bd8d1c1f928d3a35b414bbce81b.tar.gz
u-boot-imx-532d5e69a1642bd8d1c1f928d3a35b414bbce81b.tar.bz2
MLK-10774-7 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> Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Diffstat (limited to 'common')
-rw-r--r--common/autoboot.c22
-rw-r--r--common/main.c4
2 files changed, 26 insertions, 0 deletions
diff --git a/common/autoboot.c b/common/autoboot.c
index c27cc2c..f5184a0 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -13,6 +13,10 @@
#include <menu.h>
#include <post.h>
+#ifdef is_boot_from_usb
+#include <environment.h>
+#endif
+
DECLARE_GLOBAL_DATA_PTR;
#define MAX_DELAY_STOP_STR 32
@@ -246,6 +250,17 @@ const char *bootdelay_process(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);
@@ -272,6 +287,13 @@ const char *bootdelay_process(void)
#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
+
process_fdt_options(gd->fdt_blob);
stored_bootdelay = bootdelay;
diff --git a/common/main.c b/common/main.c
index 2979fbe..62ab1ac 100644
--- a/common/main.c
+++ b/common/main.c
@@ -12,6 +12,10 @@
#include <cli.h>
#include <version.h>
+#ifdef is_boot_from_usb
+#include <environment.h>
+#endif
+
DECLARE_GLOBAL_DATA_PTR;
/*