diff options
author | Ye Li <ye.li@nxp.com> | 2018-04-09 23:20:37 -0700 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2018-04-27 02:30:47 -0700 |
commit | a92c4806bc9c1b5ad0235958c9c6503f4066ffba (patch) | |
tree | 7cab4190e07db982fc9e2d74dded3553c8d5dedc /common | |
parent | 5fc6fe6b0f85f61bc60712af5b8cd55e7b8b0789 (diff) |
MLK-18157 mfgtool: Add mfgtool support
If boot from usb, reset environment to default value.
Auto apply mfgtools setting and boot mfgtools kernel.
Only add for mx6, the mx7 and mx7ulp have implemented
relevant USB functions in soc level.
Signed-off-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/autoboot.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/common/autoboot.c b/common/autoboot.c index 2eef7a04cc7..1b52e44939b 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 = env_get("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 = env_get("bootcmd"); +#ifdef is_boot_from_usb + if (is_boot_from_usb()) { + s = env_get("bootcmd_mfg"); + printf("Run bootcmd_mfg: %s\n", s); + } +#endif + process_fdt_options(gd->fdt_blob); stored_bootdelay = bootdelay; |