]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
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

index 2a025c5a6e868672e6043ab71627437ce0d5ad10,ae8ae6ccf5928dfcebe76a645776de97b2aaf063..e09f36f2fddd43967be827916fcddf097d9ed4b5
@@@ -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
index 290db4521702a000495c048c2422db6384d4c675,e56de90e75b81dc7fc0ed9d7e01654bf0100a94b..8dbcd9ff7dd3aadd65d3c0735d87fe8dc288a831
@@@ -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
index 4cf66cca0d12e15f85047451f7f219228337e4e5,6a4cebcf7a089702ad4a9e399c9a1a39de9ac6b9..7a050ed41a790479384e53ebe7704c13096ba10e
@@@ -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 dc4046ad082a2223def9e3f7baa48642c90d8e06,47a5fd78fb6a464191c7852d7270f998f590a2e6..ccde72d22c17f29131a1d3a5a171657564a0252e
@@@ -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)