[U-Boot,3/4] arm64: versal: Add new dfu usb distro boot command
diff mbox series

Message ID acf0be70ac9ce4aaa4c0df2279e36049a496811c.1568188605.git.michal.simek@xilinx.com
State New
Delegated to: Michal Simek
Headers show
Series
  • arm64: versal: Extend distro boot
Related show

Commit Message

Michal Simek Sept. 11, 2019, 7:56 a.m. UTC
From: T Karthik Reddy <t.karthik.reddy@xilinx.com>

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>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 board/xilinx/versal/board.c     |  4 ++++
 include/configs/xilinx_versal.h | 11 +++++++++++
 2 files changed, 15 insertions(+)

Patch
diff mbox series

diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c
index 68d6177e2c38..9001c8df9576 100644
--- a/board/xilinx/versal/board.c
+++ b/board/xilinx/versal/board.c
@@ -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";
diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h
index 2f1cddbb6f07..67f5739555f3 100644
--- a/include/configs/xilinx_versal.h
+++ b/include/configs/xilinx_versal.h
@@ -123,10 +123,21 @@ 
 #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)