[U-Boot] [PATCH 0/4] arm64: versal: Extend distro boot

Hi,
these patches are extending current distribution boot for Xilinx Versal. USB DFU and jtag with one change for spi boot mode.
Thanks, Michal
Siva Durga Prasad Paladugu (2): arm64: versal: Define configs related to USB DFU functionality arm64: versal: Add new jtag distro boot command
T Karthik Reddy (2): arm64: versal: Add new dfu usb distro boot command arm64: versal: Change boot script offset address in versal
board/xilinx/versal/board.c | 6 +++- include/configs/xilinx_versal.h | 49 +++++++++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 4 deletions(-)

From: Siva Durga Prasad Paladugu siva.durga.paladugu@xilinx.com
This patch defines macros required for DFU functionality for Xilinx Versal platform.
Signed-off-by: Siva Durga Prasad Paladugu siva.durga.paladugu@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com ---
include/configs/xilinx_versal.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h index 1e0951c1d92d..35153e8cd254 100644 --- a/include/configs/xilinx_versal.h +++ b/include/configs/xilinx_versal.h @@ -52,6 +52,26 @@ #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE #define CONFIG_SYS_MAXARGS 64
+#if defined(CONFIG_CMD_DFU) +#define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x1800000 +#define DFU_DEFAULT_POLL_TIMEOUT 300 +#define CONFIG_THOR_RESET_OFF +#define DFU_ALT_INFO_RAM \ + "dfu_ram_info=" \ + "setenv dfu_alt_info " \ + "Image ram $kernel_addr_r $kernel_size_r\\;" \ + "system.dtb ram $fdt_addr_r $fdt_size_r\0" \ + "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \ + "thor_ram=run dfu_ram_info && thordown 0 ram 0\0" + +#define DFU_ALT_INFO \ + DFU_ALT_INFO_RAM +#endif + +#if !defined(DFU_ALT_INFO) +# define DFU_ALT_INFO +#endif + /* Ethernet driver */ #if defined(CONFIG_ZYNQ_GEM) # define CONFIG_NET_MULTI @@ -66,8 +86,10 @@ #define ENV_MEM_LAYOUT_SETTINGS \ "fdt_high=10000000\0" \ "fdt_addr_r=0x40000000\0" \ + "fdt_size_r=0x400000\0" \ "pxefile_addr_r=0x10000000\0" \ "kernel_addr_r=0x18000000\0" \ + "kernel_size_r=0x10000000\0" \ "scriptaddr=0x02000000\0" \ "ramdisk_addr_r=0x02100000\0" \ "script_offset_f=0x3f80000\0" \ @@ -105,7 +127,8 @@ #ifndef CONFIG_EXTRA_ENV_SETTINGS #define CONFIG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ - BOOTENV + BOOTENV \ + DFU_ALT_INFO #endif
#endif /* __XILINX_VERSAL_H */

From: Siva Durga Prasad Paladugu siva.durga.paladugu@xilinx.com
This patch adds new jtag distro boot command to look for bootscript file in DDR and execute it first incase of jtag bootmode. This patch also updates scriptaddr to 512MB as there is high of script corruption incase of bigger kernel image.
Signed-off-by: Siva Durga Prasad Paladugu siva.durga.paladugu@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com ---
board/xilinx/versal/board.c | 2 +- include/configs/xilinx_versal.h | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c index 12ea7a0d0589..68d6177e2c38 100644 --- a/board/xilinx/versal/board.c +++ b/board/xilinx/versal/board.c @@ -108,7 +108,7 @@ int board_late_init(void) switch (bootmode) { case JTAG_MODE: puts("JTAG_MODE\n"); - mode = "pxe dhcp"; + mode = "jtag pxe dhcp"; break; case QSPI_MODE_24BIT: puts("QSPI_MODE_24\n"); diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h index 35153e8cd254..2f1cddbb6f07 100644 --- a/include/configs/xilinx_versal.h +++ b/include/configs/xilinx_versal.h @@ -90,7 +90,7 @@ "pxefile_addr_r=0x10000000\0" \ "kernel_addr_r=0x18000000\0" \ "kernel_size_r=0x10000000\0" \ - "scriptaddr=0x02000000\0" \ + "scriptaddr=0x20000000\0" \ "ramdisk_addr_r=0x02100000\0" \ "script_offset_f=0x3f80000\0" \ "script_size_f=0x80000\0" @@ -115,7 +115,16 @@ #define BOOTENV_DEV_NAME_XSPI(devtypeu, devtypel, instance) \ "xspi "
+#define BOOT_TARGET_DEVICES_JTAG(func) func(JTAG, jtag, na) + +#define BOOTENV_DEV_JTAG(devtypeu, devtypel, instance) \ + "bootcmd_jtag=source $scriptaddr; echo SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ + "jtag " + #define BOOT_TARGET_DEVICES(func) \ + BOOT_TARGET_DEVICES_JTAG(func) \ BOOT_TARGET_DEVICES_MMC(func) \ BOOT_TARGET_DEVICES_XSPI(func) \ func(PXE, pxe, na) \

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(+)
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)

From: T Karthik Reddy t.karthik.reddy@xilinx.com
With the current boot script offset address in qspi is being overlaped by BOOT.BIN as it is over 90MB with fpga included. So moving the script offset address to end of flash after "bootenv" mtd partition. Here we are considering qspi flash size >= 128Mbytes on versal and left 512Kbytes space to save boot.scr script.
Signed-off-by: T Karthik Reddy t.karthik.reddy@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com ---
include/configs/xilinx_versal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h index 67f5739555f3..f426127edcff 100644 --- a/include/configs/xilinx_versal.h +++ b/include/configs/xilinx_versal.h @@ -92,7 +92,7 @@ "kernel_size_r=0x10000000\0" \ "scriptaddr=0x20000000\0" \ "ramdisk_addr_r=0x02100000\0" \ - "script_offset_f=0x3f80000\0" \ + "script_offset_f=0x7F80000\0" \ "script_size_f=0x80000\0"
#if defined(CONFIG_MMC_SDHCI_ZYNQ)

st 11. 9. 2019 v 9:56 odesÃlatel Michal Simek michal.simek@xilinx.com napsal:
Hi,
these patches are extending current distribution boot for Xilinx Versal. USB DFU and jtag with one change for spi boot mode.
Thanks, Michal
Siva Durga Prasad Paladugu (2): arm64: versal: Define configs related to USB DFU functionality arm64: versal: Add new jtag distro boot command
T Karthik Reddy (2): arm64: versal: Add new dfu usb distro boot command arm64: versal: Change boot script offset address in versal
board/xilinx/versal/board.c | 6 +++- include/configs/xilinx_versal.h | 49 +++++++++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 4 deletions(-)
-- 2.17.1
Applied. M
participants (2)
-
Michal Simek
-
Michal Simek