Merge tag 'xilinx-for-v2020.01' of https://gitlab.denx.de/u-boot/custodians/u-boot...
[platform/kernel/u-boot.git] / board / xilinx / versal / board.c
index a2b00aa..abdd580 100644 (file)
@@ -9,9 +9,11 @@
 #include <malloc.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/sys_proto.h>
 #include <dm/device.h>
 #include <dm/uclass.h>
 #include <versalpl.h>
+#include <linux/sizes.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -88,6 +90,7 @@ int board_late_init(void)
        const char *mode;
        char *new_targets;
        char *env_targets;
+       ulong initrd_hi;
 
        if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
                debug("Saved variables - Skipping\n");
@@ -103,9 +106,13 @@ int board_late_init(void)
 
        puts("Bootmode: ");
        switch (bootmode) {
+       case USB_MODE:
+               puts("USB_MODE\n");
+               mode = "dfu_usb";
+               break;
        case JTAG_MODE:
                puts("JTAG_MODE\n");
-               mode = "pxe dhcp";
+               mode = "jtag pxe dhcp";
                break;
        case QSPI_MODE_24BIT:
                puts("QSPI_MODE_24\n");
@@ -183,12 +190,22 @@ int board_late_init(void)
 
        env_set("boot_targets", new_targets);
 
+       initrd_hi = gd->start_addr_sp - CONFIG_STACK_SIZE;
+       initrd_hi = round_down(initrd_hi, SZ_16M);
+       env_set_addr("initrd_high", (void *)initrd_hi);
+
        return 0;
 }
 
 int dram_init_banksize(void)
 {
-       fdtdec_setup_memory_banksize();
+       int ret;
+
+       ret = fdtdec_setup_memory_banksize();
+       if (ret)
+               return ret;
+
+       mem_map_fill();
 
        return 0;
 }