summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2019-05-17 01:52:27 -0700
committerYe Li <ye.li@nxp.com>2022-04-06 15:58:51 +0800
commit4f943c429decb3666ea89a75eb24da6593d52d8b (patch)
tree8693f84a51f4be187fa05d246030b386b26b5fdb /common
parentf7773855b8b51a83f9627901856c5c8ff897f019 (diff)
MLK-21854-2 imx: uuu: Update autoboot to run uuu or fastboot
When booting from USB device, change u-boot autoboot to default run UUU bootcmd or enter fastboot directly for android. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit eba8710106348a283940b851080b049bc7fbe466) (cherry picked from commit 0539983695e4cef88080ec3fd083c68c8c662a35) (cherry picked from commit 31fca4fbc23ea22a27bdf520c8928a5df595a183) (cherry picked from commit b4e6e2957d8b1828bc9ec513f96a722f6337636b)
Diffstat (limited to 'common')
-rw-r--r--common/autoboot.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/common/autoboot.c b/common/autoboot.c
index b8861d5621..bb7511d4d5 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -25,6 +25,9 @@
#include <bootcount.h>
#include <crypt.h>
#include <dm/ofnode.h>
+#ifdef is_boot_from_usb
+#include <env.h>
+#endif
DECLARE_GLOBAL_DATA_PTR;
@@ -449,6 +452,21 @@ const char *bootdelay_process(void)
if (IS_ENABLED(CONFIG_OF_CONTROL))
bootdelay = ofnode_conf_read_int("bootdelay", bootdelay);
+#if defined(is_boot_from_usb)
+ if (is_boot_from_usb() && env_get("bootcmd_mfg")) {
+ disconnect_from_pc();
+ printf("Boot from USB for mfgtools\n");
+ bootdelay = 0;
+ env_set_default("Use default environment for \
+ mfgtools\n", 0);
+ } else if (is_boot_from_usb()) {
+ printf("Boot from USB for uuu\n");
+ env_set("bootcmd", "fastboot 0");
+ } else {
+ printf("Normal Boot\n");
+ }
+#endif
+
debug("### main_loop entered: bootdelay=%d\n\n", bootdelay);
if (IS_ENABLED(CONFIG_AUTOBOOT_MENU_SHOW))
@@ -465,6 +483,13 @@ const char *bootdelay_process(void)
else
s = env_get("bootcmd");
+#if defined(is_boot_from_usb)
+ if (is_boot_from_usb() && env_get("bootcmd_mfg")) {
+ s = env_get("bootcmd_mfg");
+ printf("Run bootcmd_mfg: %s\n", s);
+ }
+#endif
+
if (IS_ENABLED(CONFIG_OF_CONTROL))
process_fdt_options(gd->fdt_blob);
stored_bootdelay = bootdelay;