summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Chen <chenjh@rock-chips.com>2021-10-27 05:59:59 +0300
committerJoseph Chen <chenjh@rock-chips.com>2021-10-27 05:59:59 +0300
commit4c3bac6252879a944332131a537cc97a539ee126 (patch)
tree6e4735d49dc380db4c74c8b3409407037d57222f
parent892e9cd5e6cccfd3d203549b7f6644262d5b7183 (diff)
downloadu-boot-4c3bac6252879a944332131a537cc97a539ee126.tar.xz
common: bootm: pass bootm header structure for arch_preboot_os()
Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Change-Id: Id2735cd4224a0aa04fac2d208757e104ba8e82b0
-rw-r--r--common/bootm.c7
-rw-r--r--common/bootm_os.c4
-rw-r--r--include/bootm.h2
3 files changed, 8 insertions, 5 deletions
diff --git a/common/bootm.c b/common/bootm.c
index 83fa281e96..fcb561d7de 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -522,7 +522,7 @@ static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end,
}
flush_cache(load, ALIGN(*load_end - load, ARCH_DMA_MINALIGN));
- debug(" kernel loaded at 0x%08lx, end = 0x%08lx\n", load, *load_end);
+ printf(" kernel loaded at 0x%08lx, end = 0x%08lx\n", load, *load_end);
bootstage_mark(BOOTSTAGE_ID_KERNEL_LOADED);
no_overlap = (os.comp == IH_COMP_NONE && load == image_start);
@@ -546,6 +546,9 @@ static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end,
}
}
+ /* update image len as decompressed kernel size for late use */
+ images->os.image_len = *load_end - load;
+
return 0;
}
@@ -775,7 +778,7 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
if (images->os.os == IH_OS_LINUX)
fixup_silent_linux();
#endif
- arch_preboot_os(BOOTM_STATE_OS_PREP);
+ arch_preboot_os(BOOTM_STATE_OS_PREP, images);
ret = boot_fn(BOOTM_STATE_OS_PREP, argc, argv, images);
}
diff --git a/common/bootm_os.c b/common/bootm_os.c
index 392dd2f59f..3af6fdd198 100644
--- a/common/bootm_os.c
+++ b/common/bootm_os.c
@@ -469,7 +469,7 @@ static boot_os_fn *boot_os[] = {
};
/* Allow for arch specific config before we boot */
-__weak void arch_preboot_os(uint32_t bootm_state)
+__weak void arch_preboot_os(uint32_t bootm_state, bootm_headers_t *images)
{
/* please define platform specific arch_preboot_os() */
}
@@ -477,7 +477,7 @@ __weak void arch_preboot_os(uint32_t bootm_state)
int boot_selected_os(int argc, char * const argv[], int state,
bootm_headers_t *images, boot_os_fn *boot_fn)
{
- arch_preboot_os(state);
+ arch_preboot_os(state, images);
boot_fn(state, argc, argv, images);
/* Stand-alone may return when 'autostart' is 'no' */
diff --git a/include/bootm.h b/include/bootm.h
index 2274ab5350..40f2998a41 100644
--- a/include/bootm.h
+++ b/include/bootm.h
@@ -54,7 +54,7 @@ int bootm_find_images(int flag, int argc, char * const argv[]);
int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
int states, bootm_headers_t *images, int boot_progress);
-void arch_preboot_os(uint32_t bootm_state);
+void arch_preboot_os(uint32_t bootm_state, bootm_headers_t *images);
int board_do_bootm(int argc, char * const argv[]);