rockchip: implement autoboot_command_fail_handle()

It's not friendly to handle the fail event in a bootcmd list,
let's handle this in C function.

Entering rockusb/fastboot mode after verified-boot failed.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ib617582e1cc386f5c30abe1a8bbd2b5f353c0e49
This commit is contained in:
Joseph Chen 2020-03-28 14:56:11 +08:00 committed by Jianhong Chen
parent 7fc773a76d
commit 4ab50248f6
2 changed files with 20 additions and 24 deletions

View File

@ -754,3 +754,15 @@ int board_do_bootm(int argc, char * const argv[])
return 0;
}
#endif
void autoboot_command_fail_handle(void)
{
#ifdef CONFIG_AVB_VBMETA_PUBLIC_KEY_VALIDATE
#ifdef CONFIG_ANDROID_AB
run_command("fastboot usb 0;", 0); /* use fastboot to ative slot */
#else
run_command("rockusb 0 ${devtype} ${devnum}", 0);
run_command("fastboot usb 0;", 0);
#endif
#endif
}

View File

@ -133,33 +133,17 @@
"setenv devtype spinor; setenv devnum 1;" \
"fi; \0"
#ifdef CONFIG_AVB_VBMETA_PUBLIC_KEY_VALIDATE
#ifndef CONFIG_ANDROID_AB
#define RKIMG_BOOTCOMMAND \
"boot_android ${devtype} ${devnum};" \
"echo AVB boot failed and enter rockusb or fastboot!;" \
"rockusb 0 ${devtype} ${devnum};" \
"fastboot usb 0;"
#if defined(CONFIG_AVB_VBMETA_PUBLIC_KEY_VALIDATE)
#define RKIMG_BOOTCOMMAND \
"boot_android ${devtype} ${devnum};"
#else
/*
* Update images a/b and active slot with fastboot
* when avb+ab system boot failed.
* Remove rockusb since it unable to active slot.
*/
#define RKIMG_BOOTCOMMAND \
"boot_android ${devtype} ${devnum};" \
"echo AVB boot failed and enter fastboot!;" \
"fastboot usb 0;"
#endif /* CONFIG_ANDROID_AB */
#else /* CONFIG_AVB_VBMETA_PUBLIC_KEY_VALIDATE */
#define RKIMG_BOOTCOMMAND \
"boot_android ${devtype} ${devnum};" \
"bootrkp;" \
"boot_fit;" \
"boot_uimage;" \
#define RKIMG_BOOTCOMMAND \
"boot_android ${devtype} ${devnum};" \
"bootrkp;" \
"run distro_bootcmd;"
#endif
#endif
#endif /* CONFIG_SPL_BUILD */
#define CONFIG_DISPLAY_BOARDINFO_LATE