From ef1be3e3647e2c48610bfea5049d5e2b5c9bb813 Mon Sep 17 00:00:00 2001 From: T Karthik Reddy Date: Wed, 24 Mar 2021 23:37:57 -0600 Subject: xilinx: zynqmp: Add usb dfu/thor distro boot support In usb boot mode distro boot should select usb device as primary boot device instead of usb host. So make usb dfu as primary boot device. But do not list it in boot_targets as fallback option because it is not classic mode for booting. Using 60s timeout by default should be enough time for dfu-utils to start transaction. In case none needs this please change timeout value in the command or disable CONFIG_DFU_TIMEOUT. Signed-off-by: T Karthik Reddy Signed-off-by: Michal Simek --- include/configs/xilinx_zynqmp.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'include') diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 15ad4198a6..87704ff630 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -179,11 +179,41 @@ #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ "jtag " +#define BOOT_TARGET_DEVICES_USB_DFU(func) \ + func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1) + +#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ + "$scriptaddr $script_size_f && " \ + "dfu " #instance " ram " #instance " 60 && " \ + "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \ + "source ${scriptaddr}; " \ + "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \ + "" + +#define BOOT_TARGET_DEVICES_USB_THOR(func) \ + func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1) + +#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ + "$scriptaddr $script_size_f && " \ + "thordown " #instance " ram " #instance " && " \ + "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \ + "source ${scriptaddr}; " \ + "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \ + "" + #define BOOT_TARGET_DEVICES(func) \ BOOT_TARGET_DEVICES_JTAG(func) \ BOOT_TARGET_DEVICES_MMC(func) \ BOOT_TARGET_DEVICES_QSPI(func) \ BOOT_TARGET_DEVICES_NAND(func) \ + BOOT_TARGET_DEVICES_USB_DFU(func) \ + BOOT_TARGET_DEVICES_USB_THOR(func) \ BOOT_TARGET_DEVICES_USB(func) \ BOOT_TARGET_DEVICES_SCSI(func) \ BOOT_TARGET_DEVICES_PXE(func) \ -- cgit From 1e967b53a7fa7ba9a98cfc27af01eb373a1c202c Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 25 Mar 2021 09:55:30 +0100 Subject: xilinx: zynqmp: Remove dfu_ram_info setup The dfu ram info is wired in connection to Linux kernel and certain setup. We should change this to be more generic as others command. That's why using boot via script is the way to go. Signed-off-by: Michal Simek --- include/configs/xilinx_zynqmp.h | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'include') diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 87704ff630..36f3d962e4 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -55,18 +55,6 @@ #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 80000 $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" \ - "dfu_ram_tftp=run dfu_ram_info && setenv updatefile boot && " \ - "setenv loadaddr 10000000 && dfu tftp ram 0\0" - -#define DFU_ALT_INFO \ - DFU_ALT_INFO_RAM #ifndef CONFIG_SPL_BUILD # define PARTS_DEFAULT \ @@ -76,10 +64,6 @@ #endif #endif -#if !defined(DFU_ALT_INFO) -# define DFU_ALT_INFO -#endif - #if !defined(PARTS_DEFAULT) # define PARTS_DEFAULT #endif @@ -225,8 +209,7 @@ #ifndef CONFIG_EXTRA_ENV_SETTINGS #define CONFIG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ - BOOTENV \ - DFU_ALT_INFO + BOOTENV #endif /* SPL can't handle all huge variables - define just DFU */ -- cgit From 82cb49dc001f0e2141ef739087d51c3c7eb893c8 Mon Sep 17 00:00:00 2001 From: T Karthik Reddy Date: Tue, 30 Mar 2021 23:24:57 -0600 Subject: xilinx: versal: Add usb dfu/thor distro boot support Change "dfu_usb" to "usb_dfu" for better representation and change required macros. Add 60s timeout of dfu-utils to start transaction. Add support for usb thor to distro boot. Remove DFU_ALT_INFO_RAM as we use bootcmd_usb_dfu instead of dfu_ram. Signed-off-by: T Karthik Reddy Signed-off-by: Michal Simek --- include/configs/xilinx_versal.h | 52 +++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 25 deletions(-) (limited to 'include') diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h index f1d2594f3b..380f93a2f6 100644 --- a/include/configs/xilinx_versal.h +++ b/include/configs/xilinx_versal.h @@ -50,20 +50,6 @@ #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 80000 $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 */ @@ -129,23 +115,40 @@ #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ "jtag " -#define BOOT_TARGET_DEVICES_DFU_USB(func) func(DFU_USB, dfu_usb, 0) +#define BOOT_TARGET_DEVICES_USB_DFU(func) \ + func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1) + +#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ + "$scriptaddr $script_size_f && " \ + "dfu " #instance " ram " #instance " 60 && " \ + "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \ + "source ${scriptaddr}; " \ + "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \ + "" + +#define BOOT_TARGET_DEVICES_USB_THOR(func) \ + func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1) -#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 && " \ - "echo DFU: Trying to boot script at ${scriptaddr} && " \ +#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ + "$scriptaddr $script_size_f && " \ + "thordown " #instance " ram " #instance " && " \ + "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \ "source ${scriptaddr}; " \ - "echo DFU: SCRIPT FAILED: continuing...;\0" + "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0" -#define BOOTENV_DEV_NAME_DFU_USB(devtypeu, devtypel, instance) \ - "dfu_usb " +#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \ + "" #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) \ + BOOT_TARGET_DEVICES_USB_DFU(func) \ + BOOT_TARGET_DEVICES_USB_THOR(func) \ BOOT_TARGET_DEVICES_PXE(func) \ BOOT_TARGET_DEVICES_DHCP(func) @@ -155,8 +158,7 @@ #ifndef CONFIG_EXTRA_ENV_SETTINGS #define CONFIG_EXTRA_ENV_SETTINGS \ ENV_MEM_LAYOUT_SETTINGS \ - BOOTENV \ - DFU_ALT_INFO + BOOTENV #endif #endif /* __XILINX_VERSAL_H */ -- cgit From b8126ab2bc6fe3beb2bedcfac9770022cb4f246a Mon Sep 17 00:00:00 2001 From: T Karthik Reddy Date: Tue, 30 Mar 2021 23:24:58 -0600 Subject: xilinx: zynq: Add usb dfu/thor distro boot support Add support for usb dfu & thor to distro boot on zynq platform. Add 60s timeout of dfu-utils to start transaction. Remove DFU_ALT_INFO_RAM as we use bootcmd_usb_dfu instead of dfu_ram. Remove DFU_ALT_INFO_MMC as part of distro boot cleanup. Signed-off-by: T Karthik Reddy Signed-off-by: Michal Simek --- include/configs/syzygy_hub.h | 1 - include/configs/topic_miami.h | 1 - include/configs/zynq-common.h | 61 +++++++++++++++++++++---------------------- 3 files changed, 30 insertions(+), 33 deletions(-) (limited to 'include') diff --git a/include/configs/syzygy_hub.h b/include/configs/syzygy_hub.h index e31b77c0c0..7af7b08eb4 100644 --- a/include/configs/syzygy_hub.h +++ b/include/configs/syzygy_hub.h @@ -58,7 +58,6 @@ "jtagboot=echo TFTPing FIT to RAM... && " \ "tftpboot ${load_addr} ${fit_image} && " \ "bootm ${load_addr}\0" \ - DFU_ALT_INFO \ BOOTENV #include diff --git a/include/configs/topic_miami.h b/include/configs/topic_miami.h index 010d28ac86..c12cd7ccad 100644 --- a/include/configs/topic_miami.h +++ b/include/configs/topic_miami.h @@ -49,7 +49,6 @@ "${devicetree_addr}; " \ "fi\0" /* Note that addresses here should match the addresses in the env */ -# undef DFU_ALT_INFO # define DFU_ALT_INFO \ "dfu_alt_info=" \ "uImage ram 0x2080000 0x500000;" \ diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h index 1607a8d065..39035f8beb 100644 --- a/include/configs/zynq-common.h +++ b/include/configs/zynq-common.h @@ -61,36 +61,6 @@ # define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x600000 # define DFU_DEFAULT_POLL_TIMEOUT 300 # define CONFIG_THOR_RESET_OFF -# define DFU_ALT_INFO_RAM \ - "dfu_ram_info=" \ - "setenv dfu_alt_info " \ - "${kernel_image} ram 0x3000000 0x500000\\\\;" \ - "${devicetree_image} ram 0x2A00000 0x20000\\\\;" \ - "${ramdisk_image} ram 0x2000000 0x600000\0" \ - "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \ - "thor_ram=run dfu_ram_info && thordown 0 ram 0\0" - -# if defined(CONFIG_MMC_SDHCI_ZYNQ) -# define DFU_ALT_INFO_MMC \ - "dfu_mmc_info=" \ - "setenv dfu_alt_info " \ - "${kernel_image} fat 0 1\\\\;" \ - "${devicetree_image} fat 0 1\\\\;" \ - "${ramdisk_image} fat 0 1\0" \ - "dfu_mmc=run dfu_mmc_info && dfu 0 mmc 0\0" \ - "thor_mmc=run dfu_mmc_info && thordown 0 mmc 0\0" - -# define DFU_ALT_INFO \ - DFU_ALT_INFO_RAM \ - DFU_ALT_INFO_MMC -# else -# define DFU_ALT_INFO \ - DFU_ALT_INFO_RAM -# endif -#endif - -#if !defined(DFU_ALT_INFO) -# define DFU_ALT_INFO #endif /* enable preboot to be loaded before CONFIG_BOOTDELAY */ @@ -180,12 +150,42 @@ #define BOOTENV_DEV_NAME_JTAG(devtypeu, devtypel, instance) \ "jtag " +#define BOOT_TARGET_DEVICES_USB_DFU(func) \ + func(USB_DFU, usb_dfu, 0) func(USB_DFU, usb_dfu, 1) + +#define BOOTENV_DEV_USB_DFU(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ + "$scriptaddr $script_size_f && " \ + "dfu " #instance " ram " #instance " 60 && " \ + "echo DFU" #instance ": Trying to boot script at ${scriptaddr} && " \ + "source ${scriptaddr}; " \ + "echo DFU" #instance ": SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance) \ + "" + +#define BOOT_TARGET_DEVICES_USB_THOR(func) \ + func(USB_THOR, usb_thor, 0) func(USB_THOR, usb_thor, 1) + +#define BOOTENV_DEV_USB_THOR(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=setenv dfu_alt_info boot.scr ram " \ + "$scriptaddr $script_size_f && " \ + "thordown " #instance " ram " #instance " && " \ + "echo THOR" #instance ": Trying to boot script at ${scriptaddr} && " \ + "source ${scriptaddr}; " \ + "echo THOR" #instance ": SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_USB_THOR(devtypeu, devtypel, instance) \ + "" + #define BOOT_TARGET_DEVICES(func) \ BOOT_TARGET_DEVICES_JTAG(func) \ BOOT_TARGET_DEVICES_MMC(func) \ BOOT_TARGET_DEVICES_QSPI(func) \ BOOT_TARGET_DEVICES_NAND(func) \ BOOT_TARGET_DEVICES_NOR(func) \ + BOOT_TARGET_DEVICES_USB_DFU(func) \ + BOOT_TARGET_DEVICES_USB_THOR(func) \ BOOT_TARGET_DEVICES_USB(func) \ BOOT_TARGET_DEVICES_PXE(func) \ BOOT_TARGET_DEVICES_DHCP(func) @@ -203,7 +203,6 @@ "kernel_addr_r=0x2000000\0" \ "scriptaddr=0x3000000\0" \ "ramdisk_addr_r=0x3100000\0" \ - DFU_ALT_INFO \ BOOTENV #endif -- cgit From 0b0705b5ed7865a1c86a3ed6ece82346e5f2e57f Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 26 Apr 2021 08:27:04 +0200 Subject: arm64: zynqmp: Enable capsule update Enable EFI capsule update features to be enabled by default also with all dfu valid options for ZynqMP. This feature was tested on Xilinx ZynqMP zcu104 board with defining dfu_alt_info="mmc 0:1=boot.bin fat 0 1;u-boot.itb fat 0 1" and dfu_alt_info="sf 0:0=boot.bin raw 0 0x50000;u-boot.itb raw 0x80000 0x500000". There is a need to increase malloc size for getting dfu mmc to work. Signed-off-by: Michal Simek CC: Sughosh Ganu CC: Ilias Apalodimas CC: Heinrich Schuchardt --- include/configs/xilinx_zynqmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h index 36f3d962e4..986af2be78 100644 --- a/include/configs/xilinx_zynqmp.h +++ b/include/configs/xilinx_zynqmp.h @@ -27,7 +27,7 @@ #endif /* Size of malloc() pool */ -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x2000000) +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x4000000) /* Serial setup */ #define CONFIG_CPU_ARMV8 -- cgit