summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2016-02-24 17:38:54 +0800
committerYe Li <ye.li@nxp.com>2017-04-05 14:04:36 +0800
commitb18995387375111011612aa1e47d203733d16d14 (patch)
treed7fb0cdab2870ae689da9dd074cc2c69e5cb0f6b /common
parent7e43357e93c2aff021f9d41b4bd4f666ec0402a7 (diff)
downloadu-boot-imx-b18995387375111011612aa1e47d203733d16d14.zip
u-boot-imx-b18995387375111011612aa1e47d203733d16d14.tar.gz
u-boot-imx-b18995387375111011612aa1e47d203733d16d14.tar.bz2
MLK-12444-1 mfgtool: Add mfgtool support
If boot from usb, reset environment to default value. Auto apply mfgtools setting and boot mfgtools kernel. Porting this from fsl uboot to uboot 2016. The 7dsabresd has already added the environment and usb boot related functions. No need to add them more. Only need to add NAND parts environment for mfgtools. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit a352ed3c5184b95c4c9f7468f5fbb5f43de5e412)
Diffstat (limited to 'common')
-rw-r--r--common/autoboot.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/common/autoboot.c b/common/autoboot.c
index c52bad8..b9a0fa9 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -15,6 +15,10 @@
#include <post.h>
#include <u-boot/sha256.h>
+#ifdef is_boot_from_usb
+#include <environment.h>
+#endif
+
DECLARE_GLOBAL_DATA_PTR;
#define MAX_DELAY_STOP_STR 32
@@ -307,6 +311,18 @@ 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()) {
+ disconnect_from_pc();
+ 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);
@@ -333,6 +349,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;