common: add autoboot_command_fail_handle() callback

Maybe user need to do some job when bootcmd failed, they
could override it.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I1c32c1ad37700e66d45fe033fbfa46d3f350205d
This commit is contained in:
Joseph Chen 2020-03-28 14:55:01 +08:00 committed by Jianhong Chen
parent 96158db731
commit 7fc773a76d
2 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,12 @@ DECLARE_GLOBAL_DATA_PTR;
*/ */
__weak void show_boot_progress(int val) {} __weak void show_boot_progress(int val) {}
/*
* Board-specific Platform code can reimplement autoboot_command_fail_handle ()
* if needed
*/
__weak void autoboot_command_fail_handle(void) {}
static void run_preboot_environment_command(void) static void run_preboot_environment_command(void)
{ {
#ifdef CONFIG_PREBOOT #ifdef CONFIG_PREBOOT
@ -64,6 +70,7 @@ void main_loop(void)
cli_secure_boot_cmd(s); cli_secure_boot_cmd(s);
autoboot_command(s); autoboot_command(s);
autoboot_command_fail_handle();
cli_loop(); cli_loop();
panic("No CLI available"); panic("No CLI available");

View File

@ -103,6 +103,7 @@ int cpu_init(void);
/* common/main.c */ /* common/main.c */
void main_loop (void); void main_loop (void);
void autoboot_command_fail_handle(void);
int run_command(const char *cmd, int flag); int run_command(const char *cmd, int flag);
int run_command_repeatable(const char *cmd, int flag); int run_command_repeatable(const char *cmd, int flag);