arm64: 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>
Thu, 14 Dec 2017 19:08:22 +0000 (20:08 +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 f769db7e81b9836832a140e9364290f8c083795a..8c859ed8ff8bdbf2dd17569b177aa16d125b09e5 100644 (file)
@@ -343,13 +343,17 @@ 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");
                return 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;