Merge patch series "Complete decoupling of bootm logic from commands"
authorTom Rini <trini@konsulko.com>
Thu, 21 Dec 2023 21:10:00 +0000 (16:10 -0500)
committerTom Rini <trini@konsulko.com>
Thu, 21 Dec 2023 21:10:00 +0000 (16:10 -0500)
Simon Glass <sjg@chromium.org> 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

1  2 
arch/m68k/lib/traps.c
arch/sandbox/cpu/cpu.c
arch/sandbox/lib/bootm.c
boot/bootm.c
boot/bootm_os.c

@@@ -7,7 -7,7 +7,8 @@@
   * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
   */
  
 +#include <config.h>
+ #include <cpu_func.h>
  #include <init.h>
  #include <watchdog.h>
  #include <command.h>
Simple merge
@@@ -4,6 -4,8 +4,7 @@@
   * Copyright (c) 2015 Sjoerd Simons <sjoerd.simons@collabora.co.uk>
   */
  
 -#include <common.h>
+ #include <bootm.h>
  #include <bootstage.h>
  #include <image.h>
  #include <asm/io.h>
diff --cc 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
@@@ -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)
  {
 -      efi_status_t efi_ret;
+       struct bootm_headers *images = bmi->images;
 +      int ret;
        void *image_buf;
  
        if (flag != BOOTM_STATE_OS_GO)