]> Git Repo - J-u-boot.git/blobdiff - board/xilinx/zynqmp/zynqmp.c
command: Remove the cmd_tbl_t typedef
[J-u-boot.git] / board / xilinx / zynqmp / zynqmp.c
index 66a43974e68d00abb9d2bf91e49d1c6fd68fb950..7a8c745f9beff99f55c784c923de90dbd51ddce1 100644 (file)
@@ -5,10 +5,12 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <cpu_func.h>
 #include <debug_uart.h>
 #include <env.h>
 #include <init.h>
+#include <net.h>
 #include <sata.h>
 #include <ahci.h>
 #include <scsi.h>
@@ -18,6 +20,7 @@
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/psu_init_gpl.h>
+#include <asm/cache.h>
 #include <asm/io.h>
 #include <dm/device.h>
 #include <dm/uclass.h>
@@ -413,7 +416,7 @@ int board_early_init_r(void)
 }
 
 unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
-                        char * const argv[])
+                        char *const argv[])
 {
        int ret = 0;
 
@@ -552,9 +555,26 @@ static int set_fdtfile(void)
        return 0;
 }
 
-int board_late_init(void)
+static u8 zynqmp_get_bootmode(void)
 {
+       u8 bootmode;
        u32 reg = 0;
+       int ret;
+
+       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;
+
+       bootmode = reg & BOOT_MODES_MASK;
+
+       return bootmode;
+}
+
+int board_late_init(void)
+{
        u8 bootmode;
        struct udevice *dev;
        int bootseq = -1;
@@ -578,14 +598,7 @@ int board_late_init(void)
        if (ret)
                return ret;
 
-       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;
-
-       bootmode = reg & BOOT_MODES_MASK;
+       bootmode = zynqmp_get_bootmode();
 
        puts("Bootmode: ");
        switch (bootmode) {
This page took 0.023222 seconds and 4 git commands to generate.