arm64: versal: Add new dfu usb distro boot command
authorT Karthik Reddy <t.karthik.reddy@xilinx.com>
Thu, 11 Jul 2019 10:37:57 +0000 (16:07 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 8 Oct 2019 07:35:43 +0000 (09:35 +0200)
This patch adds new dfu usb distro boot command to look for bootscript
from dfu-util and runs it.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
board/xilinx/versal/board.c
include/configs/xilinx_versal.h

index dcfb8878c63d7e20480ff6df2e03944edcf705a2..abdd580c012bf51d4df30a4ecebbe38d08404bb4 100644 (file)
@@ -106,6 +106,10 @@ 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 = "jtag pxe dhcp";
index 2f1cddbb6f0747df2871f6cf06409cbfdb85258a..67f5739555f3995b7107acfc8695b10cb9c8b73c 100644 (file)
 #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \
        "jtag "
 
+#define BOOT_TARGET_DEVICES_DFU_USB(func)  func(DFU_USB, dfu_usb, 0)
+
+#define BOOTENV_DEV_DFU_USB(devtypeu, devtypel, instance) \
+       "bootcmd_dfu_usb=setenv dfu_alt_info boot.scr ram $scriptaddr " \
+       "$script_size_f; dfu 0 ram 0 && source $scriptaddr; " \
+       "echo SCRIPT FAILED: continuing...;\0"
+
+#define BOOTENV_DEV_NAME_DFU_USB(devtypeu, devtypel, instance) \
+       "dfu_usb "
+
 #define BOOT_TARGET_DEVICES(func) \
        BOOT_TARGET_DEVICES_JTAG(func) \
        BOOT_TARGET_DEVICES_MMC(func) \
        BOOT_TARGET_DEVICES_XSPI(func) \
+       BOOT_TARGET_DEVICES_DFU_USB(func) \
        func(PXE, pxe, na) \
        func(DHCP, dhcp, na)