]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: zboot: Set environment variables for image locations
authorSimon Glass <sjg@chromium.org>
Sat, 5 Sep 2020 20:50:48 +0000 (14:50 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Fri, 25 Sep 2020 03:27:09 +0000 (11:27 +0800)
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 <sjg@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
README
arch/x86/lib/zimage.c

diff --git a/README b/README
index 6cb0567ba66b46aa2a6050fd71a43a9082827f69..5132b2278cb738b0d6b19b0d64ee0b97d5d263fe 100644 (file)
--- a/README
+++ b/README
@@ -3425,6 +3425,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    - (x86 only) Base address of the bzImage 'setup' block
+
+  zbootaddr    - (x86 only) 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
index 92c9cac143ba9448aa004ab484371f1fa8c81067..03e33a3ee02b6e78fe17d81c0aa07389d86e71e8 100644 (file)
@@ -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;
 }