From bd700d6b801bf513b5176ca53a85590d04c44ab2 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Thu, 1 Aug 2019 11:04:35 +0800 Subject: [PATCH] common: bootm: add bootm state param for arch_preboot_os() - This makes arch_preboot_os() more flexsible; - call arch_preboot_os() when BOOTM_STATE_OS_PREP; Change-Id: Ia4ae3666b8180c993c761ef222acbcff5358ae97 Signed-off-by: Joseph Chen --- common/bootm.c | 2 ++ common/bootm_os.c | 4 ++-- include/bootm.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/bootm.c b/common/bootm.c index 08bb5b7b91..564f8fe8c5 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -725,6 +725,8 @@ 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); + ret = boot_fn(BOOTM_STATE_OS_PREP, argc, argv, images); } diff --git a/common/bootm_os.c b/common/bootm_os.c index 5e6b1777e4..392dd2f59f 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(void) +__weak void arch_preboot_os(uint32_t bootm_state) { /* please define platform specific arch_preboot_os() */ } @@ -477,7 +477,7 @@ __weak void arch_preboot_os(void) int boot_selected_os(int argc, char * const argv[], int state, bootm_headers_t *images, boot_os_fn *boot_fn) { - arch_preboot_os(); + arch_preboot_os(state); 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 49813772ce..72ed30da07 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(void); +void arch_preboot_os(uint32_t bootm_state); /** * bootm_decomp_image() - decompress the operating system