]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
xilinx: zynqmp: Allow multiboot environment write even in saved environment
authorKory Maincent <kory.maincent@bootlin.com>
Wed, 29 May 2024 10:01:06 +0000 (12:01 +0200)
committerMichal Simek <michal.simek@amd.com>
Mon, 17 Jun 2024 14:02:29 +0000 (16:02 +0200)
Once the environment was saved, the current multiboot image information
became unreachable. When dealing with firmware updates, this information
is necessary alongside the saved environment to know the booted image.

Move the multiboot environment set operation before the saved environment
check to ensure this information is always available.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://lore.kernel.org/r/20240529100107.137159-1-kory.maincent@bootlin.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
board/xilinx/zynqmp/zynqmp.c

index c4050af2a5a5271a85b3ab7de6d1a9aef1989fbd..63cc6b862e9d3dbe56fbd36c1e9b3811629304b7 100644 (file)
@@ -519,6 +519,10 @@ int board_late_init(void)
        usb_ether_init();
 #endif
 
+       multiboot = multi_boot();
+       if (multiboot >= 0)
+               env_set_hex("multiboot", multiboot);
+
        if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
                debug("Saved variables - Skipping\n");
                return 0;
@@ -531,10 +535,6 @@ int board_late_init(void)
        if (ret)
                return ret;
 
-       multiboot = multi_boot();
-       if (multiboot >= 0)
-               env_set_hex("multiboot", multiboot);
-
        if (IS_ENABLED(CONFIG_DISTRO_DEFAULTS)) {
                ret = boot_targets_setup();
                if (ret)