]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
zynqmp: Read boot mode register using zynqmp_mmio_read
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Tue, 21 Feb 2017 12:28:28 +0000 (17:58 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 21 Feb 2017 12:46:50 +0000 (13:46 +0100)
Dont read boot mode register directly read it using
zynqmp_mmio_read().

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
board/xilinx/zynqmp/zynqmp.c

index d22950e0d146a7e19f54deb59d729b5626695a29..09cf326b753866a225a6c8b9356d98b3cd7e7f74 100644 (file)
@@ -220,6 +220,7 @@ int board_late_init(void)
        u8 bootmode;
        const char *mode;
        char *new_targets;
+       int ret;
 
        if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
                debug("Saved variables - Skipping\n");
@@ -240,7 +241,10 @@ int board_late_init(void)
                setenv("setup", "setenv partid 0");
        }
 
-       reg = readl(&crlapb_base->boot_mode);
+       ret = zynqmp_mmio_read((ulong)&crlapb_base->boot_mode, &reg);
+       if (ret)
+               return -EINVAL;
+
        if (reg >> BOOT_MODE_ALT_SHIFT)
                reg >>= BOOT_MODE_ALT_SHIFT;