From: Tom Rini Date: Thu, 21 Dec 2023 21:10:00 +0000 (-0500) Subject: Merge patch series "Complete decoupling of bootm logic from commands" X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=7c4647b8fb448ac658a9bc726681ad9e75e6b9e8;p=u-boot.git Merge patch series "Complete decoupling of bootm logic from commands" Simon Glass says: This series continues refactoring the bootm code to allow it to be used with CONFIG_COMMAND disabled. The OS-handling code is refactored and a new bootm_run() function is created to run through the bootm stages. This completes the work. A booti_go() function is created also, in case it proves useful, but at last for now standard boot does not use this. This is cmdd (part d of CMDLINE refactoring) It depends on dm/bootstda-working which depends on dm/cmdc-working --- 7c4647b8fb448ac658a9bc726681ad9e75e6b9e8 diff --cc arch/m68k/lib/traps.c index 2a025c5a6e,ae8ae6ccf5..e09f36f2fd --- a/arch/m68k/lib/traps.c +++ b/arch/m68k/lib/traps.c @@@ -7,7 -7,7 +7,8 @@@ * Wolfgang Denk, DENX Software Engineering, wd@denx.de. */ +#include + #include #include #include #include diff --cc arch/sandbox/lib/bootm.c index 290db45217,e56de90e75..8dbcd9ff7d --- a/arch/sandbox/lib/bootm.c +++ b/arch/sandbox/lib/bootm.c @@@ -4,6 -4,8 +4,7 @@@ * Copyright (c) 2015 Sjoerd Simons */ -#include + #include #include #include #include diff --cc boot/bootm.c index 4cf66cca0d,6a4cebcf7a..7a050ed41a --- a/boot/bootm.c +++ b/boot/bootm.c @@@ -1096,18 -1072,13 +1072,17 @@@ int bootm_run_states(struct bootm_info return 1; } - /* Call various other states that are not generally used */ if (!ret && (states & BOOTM_STATE_OS_CMDLINE)) - ret = boot_fn(BOOTM_STATE_OS_CMDLINE, argc, argv, images); + ret = boot_fn(BOOTM_STATE_OS_CMDLINE, bmi); if (!ret && (states & BOOTM_STATE_OS_BD_T)) - ret = boot_fn(BOOTM_STATE_OS_BD_T, argc, argv, images); + ret = boot_fn(BOOTM_STATE_OS_BD_T, bmi); if (!ret && (states & BOOTM_STATE_OS_PREP)) { - ret = bootm_process_cmdline_env(images->os.os == IH_OS_LINUX); + int flags = 0; + /* For Linux OS do all substitutions at console processing */ + if (images->os.os == IH_OS_LINUX) + flags = BOOTM_CL_ALL; + ret = bootm_process_cmdline_env(flags); if (ret) { printf("Cmdline setup failed (err=%d)\n", ret); ret = CMD_RET_FAILURE; diff --cc boot/bootm_os.c index dc4046ad08,47a5fd78fb..ccde72d22c --- a/boot/bootm_os.c +++ b/boot/bootm_os.c @@@ -473,10 -473,10 +473,10 @@@ static int do_bootm_tee(int flag, struc #endif #ifdef CONFIG_BOOTM_EFI - static int do_bootm_efi(int flag, int argc, char *const argv[], - struct bootm_headers *images) + static int do_bootm_efi(int flag, struct bootm_info *bmi) { + struct bootm_headers *images = bmi->images; - efi_status_t efi_ret; + int ret; void *image_buf; if (flag != BOOTM_STATE_OS_GO)