sysdrv/source/uboot/u-boot : Add support for the reboot U-Boot command in the BusyBox system

Signed-off-by: eng29 <eng29@luckfox.com>
This commit is contained in:
eng29 2025-03-03 21:30:19 +08:00
parent a23644f655
commit 73afccfde3
4 changed files with 16 additions and 1 deletions

View File

@ -28,6 +28,8 @@
/* enter bootrom download mode */
#define BOOT_BROM_DOWNLOAD 0xEF08A53C
#define BOOT_TO_UBOOT (REBOOT_FLAG + 16)
#ifndef __ASSEMBLY__
int setup_boot_mode(void);
#endif

View File

@ -206,6 +206,11 @@ int rockchip_get_boot_mode(void)
printf("boot mode: quiescent\n");
boot_mode[PL] = BOOT_MODE_QUIESCENT;
break;
case BOOT_TO_UBOOT:
printf("boot mode: uboot\n");
boot_mode[PL] = BOOT_MODE_UBOOT_TERMINAL;
clear_boot_reg = 1;
break;
default:
printf("boot mode: None\n");
boot_mode[PL] = BOOT_MODE_UNDEFINE;
@ -231,6 +236,8 @@ int setup_boot_mode(void)
{
char env_preboot[256] = {0};
env_set("cli", NULL); /* removed by default */
switch (rockchip_get_boot_mode()) {
case BOOT_MODE_BOOTLOADER:
printf("enter fastboot!\n");
@ -263,6 +270,10 @@ int setup_boot_mode(void)
printf("enter charging!\n");
env_set("preboot", "setenv preboot; charge");
break;
case BOOT_MODE_UBOOT_TERMINAL:
printf("enter uboot!\n");
env_set("cli", "yes");
break;
}
return 0;

View File

@ -220,7 +220,8 @@ static int __abortboot(int bootdelay)
#endif
#ifdef CONFIG_ARCH_ROCKCHIP
if (!IS_ENABLED(CONFIG_CONSOLE_DISABLE_CLI) && ctrlc()) { /* we press ctrl+c ? */
// if (!IS_ENABLED(CONFIG_CONSOLE_DISABLE_CLI) && ctrlc()) { /* we press ctrl+c ? */
if ((!IS_ENABLED(CONFIG_CONSOLE_DISABLE_CLI) && ctrlc()) || env_get("cli")) { /* we press ctrl+c ? */
#else
/*
* Check if key already pressed

View File

@ -20,6 +20,7 @@ enum _boot_mode {
BOOT_MODE_WATCHDOG,
BOOT_MODE_DFU,
BOOT_MODE_QUIESCENT,
BOOT_MODE_UBOOT_TERMINAL,
BOOT_MODE_UNDEFINE,
};