From: Simon Glass Date: Sat, 1 Aug 2020 10:08:19 -0600 Subject: [PATCH 11/16] x86: zboot: Set environment variables for image locations In-Reply-To: <20200801160824.17486-1-sjg@chromium.org> References: <20200801160824.17486-1-sjg@chromium.org> Message-ID: <20200801160824.17486-12-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de At present it is not possible to tell from a script where the setup block is, or where the image was loaded to. Add environment variables for this. Signed-off-by: Simon Glass --- README | 4 ++++ arch/x86/lib/zimage.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/README b/README index d4bf74ce75d..13ac6dd373d 100644 --- a/README +++ b/README @@ -3462,6 +3462,10 @@ List of environment variables (most likely not complete): mempos - Index position of the last match found by the 'ms' command, in units of the size (.b, .w, .l) of the search + zbootbase - Base address of the bzImage 'setup' block + + zbootaddr - Address of the loaded bzImage, typically BZIMAGE_LOAD_ADDR + which is 0x100000 The following image location variables contain the location of images used in booting. The "Image" column gives the role of the image and is diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 49f43721415..4a0a69c8f7c 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -382,6 +382,9 @@ static int do_zboot_load(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_FAILURE; } state.base_ptr = base_ptr; + if (env_set_hex("zbootbase", (ulong)base_ptr) || + env_set_hex("zbootaddr", state.load_address)) + return CMD_RET_FAILURE; return 0; } -- 2.28.0.163.g6104cc2f0b6-goog