]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
ARM64: zynqmp: Fix secondary bootmode enabling
authorMichal Simek <michal.simek@xilinx.com>
Tue, 25 Oct 2016 09:43:02 +0000 (11:43 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 1 Dec 2016 13:15:43 +0000 (14:15 +0100)
Do not setup use_alt bit which copy alternative boot mode to
boot mode. The reason is that this bit is cleared after POR
but not after any software reset which will cause
that after SW reset bootrom will look for different boot image.

This patch setups alternative boot mode selection (purely SW
handling) and extends code to read this alternative boot mode first and
use it if it is setup.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/cpu/armv8/zynqmp/spl.c
board/xilinx/zynqmp/zynqmp.c

index 04e190537d15c47e9b976fd1a1fb14c73c9da41c..bdbd61380ab7aa8323b118128e48fd8a2b85717b 100644 (file)
@@ -69,12 +69,14 @@ u32 spl_boot_device(void)
 
 #if defined(CONFIG_SPL_ZYNQMP_ALT_BOOTMODE_ENABLED)
        /* Change default boot mode at run-time */
-       writel(BOOT_MODE_USE_ALT |
-              CONFIG_SPL_ZYNQMP_ALT_BOOTMODE << BOOT_MODE_ALT_SHIFT,
+       writel(CONFIG_SPL_ZYNQMP_ALT_BOOTMODE << BOOT_MODE_ALT_SHIFT,
               &crlapb_base->boot_mode);
 #endif
 
        reg = readl(&crlapb_base->boot_mode);
+       if (reg >> BOOT_MODE_ALT_SHIFT)
+               reg >>= BOOT_MODE_ALT_SHIFT;
+
        bootmode = reg & BOOT_MODES_MASK;
 
        switch (bootmode) {
index 0a1210c2c793d3988967ceca4057333c1fcf9a68..7b53b598c51fd7741e883053c1bc66079abc581d 100644 (file)
@@ -349,6 +349,9 @@ int board_late_init(void)
        }
 
        reg = readl(&crlapb_base->boot_mode);
+       if (reg >> BOOT_MODE_ALT_SHIFT)
+               reg >>= BOOT_MODE_ALT_SHIFT;
+
        bootmode = reg & BOOT_MODES_MASK;
 
        puts("Bootmode: ");