From: Simon Glass Date: Fri, 15 Dec 2023 04:19:06 +0000 (-0700) Subject: fastboot: Remove dependencies on CMDLINE X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=b0c27bd81a0b38881016402a21e3ef8ae05e2a50;p=u-boot.git fastboot: Remove dependencies on CMDLINE It is possible to boot a kernel without CMDLINE being enabled. Update the implementation to handle this, and drop the condition from the FASTBOOT config. Signed-off-by: Simon Glass Reviewed-by: Mattijs Korpershoek --- diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig index 11fc0fe1c8..837c6f1180 100644 --- a/drivers/fastboot/Kconfig +++ b/drivers/fastboot/Kconfig @@ -1,5 +1,4 @@ menu "Fastboot support" - depends on CMDLINE config FASTBOOT bool diff --git a/drivers/fastboot/fb_common.c b/drivers/fastboot/fb_common.c index 07f5946d9e..595954542a 100644 --- a/drivers/fastboot/fb_common.c +++ b/drivers/fastboot/fb_common.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -142,22 +143,19 @@ void (*fastboot_get_progress_callback(void))(const char *) */ void fastboot_boot(void) { - char *s; - - s = env_get("fastboot_bootcmd"); - if (s) { - run_command(s, CMD_FLAG_ENV); - } else if (IS_ENABLED(CONFIG_CMD_BOOTM)) { - static char boot_addr_start[20]; - static char *const bootm_args[] = { - "bootm", boot_addr_start, NULL - }; - - snprintf(boot_addr_start, sizeof(boot_addr_start) - 1, - "%lx", fastboot_buf_addr); - printf("Booting kernel at %s...\n\n\n", boot_addr_start); - - do_bootm(NULL, 0, 2, bootm_args); + char *s = NULL; + + if (IS_ENABLED(CONFIG_CMDLINE)) { + s = env_get("fastboot_bootcmd"); + if (s) + run_command(s, CMD_FLAG_ENV); + } + + if (!s && IS_ENABLED(CONFIG_BOOTM)) { + int ret; + + printf("Booting kernel at %lx...\n\n\n", fastboot_buf_addr); + ret = bootm_boot_start(fastboot_buf_addr, NULL); /* * This only happens if image is somehow faulty so we start