mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-28 07:30:26 +09:00
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 decfa984826db8ae39e93f2968b8a04d009eef0d)
This commit is contained in:
parent
81e786caa1
commit
560a81e9cb
@ -23,6 +23,9 @@
|
||||
#include <linux/delay.h>
|
||||
#include <u-boot/sha256.h>
|
||||
#include <bootcount.h>
|
||||
#ifdef is_boot_from_usb
|
||||
#include <env.h>
|
||||
#endif
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
@ -345,6 +348,21 @@ const char *bootdelay_process(void)
|
||||
bootdelay = fdtdec_get_config_int(gd->fdt_blob, "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))
|
||||
@ -361,6 +379,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;
|
||||
|
Loading…
Reference in New Issue
Block a user