Skip to contentSkip to conversation

Add USB boot to HS DRA7xx/AM57xx

PATCH Superseded Andrew F. Davis 3 participants 22 messages Dec 5, 2018 – Jan 17, 2019

Subsystems (5)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add USB boot to HS DRA7xx/AM57xx

Hello all,

This series adds USB boot support to HS DRA7xx/AM57xx platforms.

We start by cleaning up DFU boot in SPL support. What is done in the first patch for DFU, if acceptable, should be done to the other boot modes.

The 4th patch is needed as on HS devices a header is added to the boot image that tells the ROM where to load this image. This only works for block device booting as the ROM can read the header and move the image into memory in steps. For streaming boot modes USB/ UART/NET the image is placed in memory as it is received from the media live. This means the header is ignored and the image has a fixed offset in memory.

For AM47xx we align the boot modes by making the offset for block device booting the same as the fixed offset for streaming boot modes, in this way only one defconfig is needed. For DRA7xx/AM57xx the signing tools will need to be updated to support specifying this address, when this is done the offset in the base HS defconfig can be moved to match the new offset and the defconfigs added here in patch 5 and 6 can be unified back into the base HS defconfig.

The last patch updates the docs for the same above.

Thanks,
Andrew

Changes from v1:
- Drop explicit UART boot support from DRA7xx as this cannot be tested

Andrew F. Davis (7):
spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU
dfu: Make DFU support more SPL friendly
dfu: Remove dependency on HUSH parser in SPL
ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point
defconfigs: Add config for DRA7xx High Security EVM with USB Boot
support
defconfigs: Add config for AM57xx High Security EVM with USB/UART Boot
support
doc: ti-secure: Add ULO info for AM57xx/DRA7xx secure devices from TI

 MAINTAINERS                         |   2 +
 arch/arm/cpu/armv8/zynqmp/spl.c     |   2 +-
 arch/arm/mach-omap2/Kconfig         |  13 ++++
 arch/arm/mach-omap2/am33xx/Kconfig  |  15 ----
 arch/arm/mach-omap2/boot-common.c   |   2 +-
 common/Makefile                     |   3 +-
 common/cli.c                        |   2 +-
 common/spl/Kconfig                  |   6 +-
 common/spl/Makefile                 |   2 +-
 common/spl/spl_ram.c                |   4 +-
 configs/am57xx_hs_evm_usb_defconfig |  92 ++++++++++++++++++++++++
 configs/dra7xx_hs_evm_usb_defconfig | 106 ++++++++++++++++++++++++++++
 doc/README.ti-secure                |   8 ++-
 drivers/Makefile                    |   3 +-
 drivers/dfu/Makefile                |  12 ++--
 drivers/usb/gadget/Makefile         |   2 +-
 include/configs/dra7xx_evm.h        |   2 +-
 include/configs/ti_omap5_common.h   |   2 +-
 include/configs/xilinx_zynqmp.h     |   4 +-
 include/dfu.h                       |  10 +--
 20 files changed, 246 insertions(+), 46 deletions(-)
 create mode 100644 configs/am57xx_hs_evm_usb_defconfig
 create mode 100644 configs/dra7xx_hs_evm_usb_defconfig
Signature · 1 line
2.19.1
#1 lore raw

PATCH v2 1/7 spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU

The symbol CONFIG_SPL_DFU_SUPPORT in SPL build has the same meaning as CONFIG_DFU in regular U-Boot. Drop the _SUPPORT to allow for cleaner use in code.

---
 arch/arm/cpu/armv8/zynqmp/spl.c   | 2 +-
 arch/arm/mach-omap2/boot-common.c | 2 +-
 common/Makefile                   | 4 ++--
 common/spl/Kconfig                | 6 +++---
 common/spl/Makefile               | 2 +-
 common/spl/spl_ram.c              | 4 ++--
 drivers/Makefile                  | 2 +-
 drivers/usb/gadget/Makefile       | 2 +-
 include/configs/dra7xx_evm.h      | 2 +-
 include/configs/xilinx_zynqmp.h   | 4 ++--
 10 files changed, 15 insertions(+), 15 deletions(-)
arch/arm/cpu/armv8/zynqmp/spl.c +1 -1
index 01f31d0f0e..fb3955c93f 100644
@@ -93,7 +93,7 @@ u32 spl_boot_device(void)
 	case EMMC_MODE:
 		return BOOT_DEVICE_MMC1;
 #endif
-#ifdef CONFIG_SPL_DFU_SUPPORT
+#ifdef CONFIG_SPL_DFU
 	case USB_MODE:
 		return BOOT_DEVICE_DFU;
 #endif
arch/arm/mach-omap2/boot-common.c +1 -1
index 176d4f67cb..2db19227b9 100644
@@ -108,7 +108,7 @@ void save_omap_boot_params(void)
 			sys_boot_device = 1;
 			break;
 #endif
-#if defined(BOOT_DEVICE_DFU) && !defined(CONFIG_SPL_DFU_SUPPORT)
+#if defined(BOOT_DEVICE_DFU) && !defined(CONFIG_SPL_DFU)
 		case BOOT_DEVICE_DFU:
 			sys_boot_device = 1;
 			break;
common/Makefile +2 -2
index 65d89dc62d..69cec69608 100644
@@ -64,10 +64,10 @@ obj-$(CONFIG_$(SPL_TPL_)BOOTSTAGE) += bootstage.o
 obj-$(CONFIG_$(SPL_TPL_)BLOBLIST) += bloblist.o
 
 ifdef CONFIG_SPL_BUILD
-ifdef CONFIG_SPL_DFU_SUPPORT
+ifdef CONFIG_SPL_DFU
 obj-$(CONFIG_DFU_OVER_USB) += dfu.o
 endif
-obj-$(CONFIG_SPL_DFU_SUPPORT) += cli_hush.o
+obj-$(CONFIG_SPL_DFU) += cli_hush.o
 obj-$(CONFIG_SPL_HASH_SUPPORT) += hash.o
 obj-$(CONFIG_TPL_HASH_SUPPORT) += hash.o
 obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
common/spl/Kconfig +3 -3
index 0ddbffc7d1..8dec080deb 100644
@@ -790,7 +790,7 @@ config SPL_USB_ETHER
 	  since the network stack uses a number of environment variables.
 	  See also SPL_NET_SUPPORT and SPL_ETH_SUPPORT.
 
-config SPL_DFU_SUPPORT
+config SPL_DFU
 	bool "Support DFU (Device Firmware Upgrade)"
 	select SPL_HASH_SUPPORT
 	select SPL_DFU_NO_RESET
@@ -805,11 +805,11 @@ config SPL_DFU_SUPPORT
 
 choice
 	bool "DFU device selection"
-	depends on SPL_DFU_SUPPORT
+	depends on SPL_DFU
 
 config SPL_DFU_RAM
 	bool "RAM device"
-	depends on SPL_DFU_SUPPORT && SPL_RAM_SUPPORT
+	depends on SPL_DFU && SPL_RAM_SUPPORT
 	help
 	 select RAM/DDR memory device for loading binary images
 	 (u-boot/kernel) to the selected device partition using
common/spl/Makefile +1 -1
index a130a5be4b..6f8d7599ae 100644
@@ -26,7 +26,7 @@ obj-$(CONFIG_$(SPL_TPL_)USB_SUPPORT) += spl_usb.o
 obj-$(CONFIG_$(SPL_TPL_)FAT_SUPPORT) += spl_fat.o
 obj-$(CONFIG_$(SPL_TPL_)EXT_SUPPORT) += spl_ext.o
 obj-$(CONFIG_$(SPL_TPL_)SATA_SUPPORT) += spl_sata.o
-obj-$(CONFIG_$(SPL_TPL_)DFU_SUPPORT) += spl_dfu.o
+obj-$(CONFIG_$(SPL_TPL_)DFU) += spl_dfu.o
 obj-$(CONFIG_$(SPL_TPL_)SPI_LOAD) += spl_spi.o
 obj-$(CONFIG_$(SPL_TPL_)RAM_SUPPORT) += spl_ram.o
 obj-$(CONFIG_$(SPL_TPL_)USB_SDP_SUPPORT) += spl_sdp.o
common/spl/spl_ram.c +2 -2
index 5fcc3b1504..954e91a004 100644
@@ -35,7 +35,7 @@ static int spl_ram_load_image(struct spl_image_info *spl_image,
 
 	header = (struct image_header *)CONFIG_SPL_LOAD_FIT_ADDRESS;
 
-#if CONFIG_IS_ENABLED(DFU_SUPPORT)
+#if CONFIG_IS_ENABLED(DFU)
 	if (bootdev->boot_device == BOOT_DEVICE_DFU)
 		spl_dfu_cmd(0, "dfu_alt_info_ram", "ram", "0");
 #endif
@@ -76,7 +76,7 @@ static int spl_ram_load_image(struct spl_image_info *spl_image,
 #if CONFIG_IS_ENABLED(RAM_DEVICE)
 SPL_LOAD_IMAGE_METHOD("RAM", 0, BOOT_DEVICE_RAM, spl_ram_load_image);
 #endif
-#if CONFIG_IS_ENABLED(DFU_SUPPORT)
+#if CONFIG_IS_ENABLED(DFU)
 SPL_LOAD_IMAGE_METHOD("DFU", 0, BOOT_DEVICE_DFU, spl_ram_load_image);
 #endif
 
drivers/Makefile +1 -1
index 55de10926e..7fe80b1d72 100644
@@ -48,7 +48,7 @@ obj-$(CONFIG_SPL_USB_ETHER) += net/phy/
 obj-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += usb/musb-new/
 obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += usb/gadget/
 obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += usb/gadget/udc/
-obj-$(CONFIG_SPL_DFU_SUPPORT) += dfu/
+obj-$(CONFIG_SPL_DFU) += dfu/
 obj-$(CONFIG_SPL_WATCHDOG_SUPPORT) += watchdog/
 obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += usb/host/
 obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/
drivers/usb/gadget/Makefile +1 -1
index b74c1fdce9..b5bc59eecb 100644
@@ -8,7 +8,7 @@ obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o
 
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += g_dnl.o
-obj-$(CONFIG_SPL_DFU_SUPPORT) += f_dfu.o
+obj-$(CONFIG_SPL_DFU) += f_dfu.o
 obj-$(CONFIG_SPL_USB_SDP_SUPPORT) += f_sdp.o
 endif
 
include/configs/dra7xx_evm.h +1 -1
index 2d8758db75..f36a9c3e08 100644
@@ -53,7 +53,7 @@
 
 #ifdef CONFIG_SPL_BUILD
 #undef CONFIG_CMD_BOOTD
-#ifdef CONFIG_SPL_DFU_SUPPORT
+#ifdef CONFIG_SPL_DFU
 #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x80200000
 #define DFUARGS \
 	"dfu_bufsiz=0x10000\0" \
include/configs/xilinx_zynqmp.h +2 -2
index 0ab32611ce..7a9b06ec4c 100644
@@ -183,7 +183,7 @@
 #endif
 
 /* SPL can't handle all huge variables - define just DFU */
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU_SUPPORT)
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU)
 #undef CONFIG_EXTRA_ENV_SETTINGS
 # define CONFIG_EXTRA_ENV_SETTINGS \
 	"dfu_alt_info_ram=uboot.bin ram 0x8000000 0x1000000;" \
@@ -228,7 +228,7 @@
 # define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME	"u-boot.img"
 #endif
 
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU_SUPPORT)
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU)
 # undef CONFIG_CMD_BOOTD
 # define CONFIG_SPL_ENV_SUPPORT
 # define CONFIG_SPL_HASH_SUPPORT
Signature · 1 line
2.19.1
#3 lore raw

PATCH v2 2/7 dfu: Make DFU support more SPL friendly

In reply to Andrew F. Davis

Do this by using $(SPL_) in Makefiles and CONFIG_IS_ENABLED in C code. This ensures the files and features are only built into the right build for which they are enabled. Using the macros to simplify this patch was made possible by the config symbol rename done in the last patch.

---
 drivers/Makefile     |  3 +--
 drivers/dfu/Makefile | 12 ++++++------
 include/dfu.h        | 10 +++++-----
 3 files changed, 12 insertions(+), 13 deletions(-)
drivers/Makefile +1 -2
index 7fe80b1d72..26e4d39df6 100644
@@ -2,6 +2,7 @@
 
 obj-$(CONFIG_$(SPL_TPL_)CLK) += clk/
 obj-$(CONFIG_$(SPL_TPL_)DM) += core/
+obj-$(CONFIG_$(SPL_TPL_)DFU) += dfu/
 obj-$(CONFIG_$(SPL_TPL_)GPIO_SUPPORT) += gpio/
 obj-$(CONFIG_$(SPL_TPL_)DRIVERS_MISC_SUPPORT) += misc/ sysreset/ firmware/
 obj-$(CONFIG_$(SPL_TPL_)I2C_SUPPORT) += i2c/
@@ -48,7 +49,6 @@ obj-$(CONFIG_SPL_USB_ETHER) += net/phy/
 obj-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += usb/musb-new/
 obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += usb/gadget/
 obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += usb/gadget/udc/
-obj-$(CONFIG_SPL_DFU) += dfu/
 obj-$(CONFIG_SPL_WATCHDOG_SUPPORT) += watchdog/
 obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += usb/host/
 obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/
@@ -85,7 +85,6 @@ obj-y += misc/
 obj-$(CONFIG_MMC) += mmc/
 obj-$(CONFIG_NVME) += nvme/
 obj-y += pcmcia/
-obj-y += dfu/
 obj-$(CONFIG_X86) += pch/
 obj-y += phy/allwinner/
 obj-y += phy/marvell/
drivers/dfu/Makefile +6 -6
index 56f9b0c5f4..4164f342ac 100644
@@ -3,9 +3,9 @@
 # Copyright (C) 2012 Samsung Electronics
 # Lukasz Majewski <[email protected]>
 
-obj-$(CONFIG_DFU) += dfu.o
-obj-$(CONFIG_DFU_MMC) += dfu_mmc.o
-obj-$(CONFIG_DFU_NAND) += dfu_nand.o
-obj-$(CONFIG_DFU_RAM) += dfu_ram.o
-obj-$(CONFIG_DFU_SF) += dfu_sf.o
-obj-$(CONFIG_DFU_TFTP) += dfu_tftp.o
+obj-$(CONFIG_$(SPL_)DFU) += dfu.o
+obj-$(CONFIG_$(SPL_)DFU_MMC) += dfu_mmc.o
+obj-$(CONFIG_$(SPL_)DFU_NAND) += dfu_nand.o
+obj-$(CONFIG_$(SPL_)DFU_RAM) += dfu_ram.o
+obj-$(CONFIG_$(SPL_)DFU_SF) += dfu_sf.o
+obj-$(CONFIG_$(SPL_)DFU_TFTP) += dfu_tftp.o
include/dfu.h +5 -5
index fbe978abdc..9340a900a2 100644
@@ -202,7 +202,7 @@ static inline void dfu_set_defer_flush(struct dfu_entity *dfu)
 int dfu_write_from_mem_addr(struct dfu_entity *dfu, void *buf, int size);
 
 /* Device specific */
-#ifdef CONFIG_DFU_MMC
+#if CONFIG_IS_ENABLED(DFU_MMC)
 extern int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s);
 #else
 static inline int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr,
@@ -213,7 +213,7 @@ static inline int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr,
 }
 #endif
 
-#ifdef CONFIG_DFU_NAND
+#if CONFIG_IS_ENABLED(DFU_NAND)
 extern int dfu_fill_entity_nand(struct dfu_entity *dfu, char *devstr, char *s);
 #else
 static inline int dfu_fill_entity_nand(struct dfu_entity *dfu, char *devstr,
@@ -224,7 +224,7 @@ static inline int dfu_fill_entity_nand(struct dfu_entity *dfu, char *devstr,
 }
 #endif
 
-#ifdef CONFIG_DFU_RAM
+#if CONFIG_IS_ENABLED(DFU_RAM)
 extern int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr, char *s);
 #else
 static inline int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr,
@@ -235,7 +235,7 @@ static inline int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr,
 }
 #endif
 
-#ifdef CONFIG_DFU_SF
+#if CONFIG_IS_ENABLED(DFU_SF)
 extern int dfu_fill_entity_sf(struct dfu_entity *dfu, char *devstr, char *s);
 #else
 static inline int dfu_fill_entity_sf(struct dfu_entity *dfu, char *devstr,
@@ -259,7 +259,7 @@ static inline int dfu_fill_entity_sf(struct dfu_entity *dfu, char *devstr,
  *
  * @return 0 on success, otherwise error code
  */
-#ifdef CONFIG_DFU_TFTP
+#if CONFIG_IS_ENABLED(DFU_TFTP)
 int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int len,
 		   char *interface, char *devstring);
 #else
Signature · 1 line
2.19.1
#5 lore raw

PATCH v2 3/7 dfu: Remove dependency on HUSH parser in SPL

In reply to Andrew F. Davis

CLI support with the HUSH parser is not currently SPL safe due to it's use of realloc. That function is not defined for SPLs that use SYS_MALLOC_SIMPLE. CLI support can be built in to SPL and some functions do work, but use of some like run_command() will cause build to fail. When no SPL code calls this function build works as the compiler removes this unreachable code so the unresolved symbols are ignored.

If DFU support is enabled in SPL then MMU DFU support may get brought in also, this code does make a call to run_command() causing build to fail if the HUSH parser is not built-in. To break this odd and unneeded dependency chain we use CONFIG_IS_ENABLED where appropriate to prevent calls into HUSH code from SPL. This also removes our need to pull in the rather unrelated source file when SPL_DFU is defined.

---
 common/Makefile | 1 -
 common/cli.c    | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
common/Makefile +0 -1
index 69cec69608..bbb03e1c57 100644
@@ -67,7 +67,6 @@ ifdef CONFIG_SPL_BUILD
 ifdef CONFIG_SPL_DFU
 obj-$(CONFIG_DFU_OVER_USB) += dfu.o
 endif
-obj-$(CONFIG_SPL_DFU) += cli_hush.o
 obj-$(CONFIG_SPL_HASH_SUPPORT) += hash.o
 obj-$(CONFIG_TPL_HASH_SUPPORT) += hash.o
 obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
common/cli.c +1 -1
index 51b8d5f85c..fea8f8004c 100644
@@ -27,7 +27,7 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 int run_command(const char *cmd, int flag)
 {
-#ifndef CONFIG_HUSH_PARSER
+#if !CONFIG_IS_ENABLED(HUSH_PARSER)
 	/*
 	 * cli_run_command can return 0 or 1 for success, so clean up
 	 * its result.
Signature · 1 line
2.19.1
#7 lore raw

PATCH v2 4/7 ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point

In reply to Andrew F. Davis

Like AM33xx and AM43xx, DRA7xx and AM57xx devices may need to have an non-standard boot address in memory. This may be due to the device being a high security variant, which place the Initial SoftWare (ISW) after certificates and secure software.

Allow these devices to set this from Kconfig.

---
 arch/arm/mach-omap2/Kconfig        | 13 +++++++++++++
 arch/arm/mach-omap2/am33xx/Kconfig | 15 ---------------
 include/configs/ti_omap5_common.h  |  2 +-
 3 files changed, 14 insertions(+), 16 deletions(-)
arch/arm/mach-omap2/Kconfig +13 -0
index 58e545a45b..ebe3c0f39a 100644
@@ -167,6 +167,19 @@ config TI_SECURE_EMIF_PROTECTED_REGION_SIZE
 	  using hardware memory firewalls. This value must be smaller than the
 	  TI_SECURE_EMIF_TOTAL_REGION_SIZE value.
 
+config ISW_ENTRY_ADDR
+	hex "Address in memory or XIP address of bootloader entry point"
+	default 0x402F4000 if AM43XX
+	default 0x402F0400 if AM33XX
+	default 0x40301350 if OMAP54XX
+	help
+	  After any reset, the boot ROM searches the boot media for a valid
+	  boot image. For non-XIP devices, the ROM then copies the image into
+	  internal memory. For all boot modes, after the ROM processes the
+	  boot image it eventually computes the entry point address depending
+	  on the device type (secure/non-secure), boot media (xip/non-xip) and
+	  image headers.
+
 source "arch/arm/mach-omap2/omap3/Kconfig"
 
 source "arch/arm/mach-omap2/omap4/Kconfig"
arch/arm/mach-omap2/am33xx/Kconfig +0 -15
index 3529607479..5f2ee83c27 100644
@@ -274,21 +274,6 @@ config SPL_RTC_DDR_SUPPORT
 endif
 
 if AM43XX || AM33XX
-config ISW_ENTRY_ADDR
-	hex "Address in memory or XIP flash of bootloader entry point"
-	default 0x402F4000 if AM43XX
-	default 0x402F0400 if AM33XX
-	help
-	  After any reset, the boot ROM on the AM43XX SOC
-	  searches the boot media for a valid boot image.
-	  For non-XIP devices, the ROM then copies the
-	  image into internal memory.
-	  For all boot modes, after the ROM processes the
-	  boot image it eventually computes the entry
-	  point address depending on the device type
-	  (secure/non-secure), boot media (xip/non-xip) and
-	  image headers.
-
 config PUB_ROM_DATA_SIZE
 	hex "Size in bytes of the L3 SRAM reserved by ROM to store data"
 	default 0x8400
include/configs/ti_omap5_common.h +1 -1
index 8bf4a6b7e9..ba57c40182 100644
@@ -81,7 +81,7 @@
  * RAM from address 0x40301350 (0x40300000+0x1000(reserved)+0x350(cert)).
  */
 #define TI_OMAP5_SECURE_BOOT_RESV_SRAM_SZ	0x1000
-#define CONFIG_SPL_TEXT_BASE	0x40301350
+#define CONFIG_SPL_TEXT_BASE	CONFIG_ISW_ENTRY_ADDR
 /* If no specific start address is specified then the secure EMIF
  * region will be placed at the end of the DDR space. In order to prevent
  * the main u-boot relocation from clobbering that memory and causing a
Signature · 1 line
2.19.1
#14 lore raw

PATCH v2 5/7 defconfigs: Add config for DRA7xx High Security EVM with USB Boot support

In reply to Andrew F. Davis

Add a new defconfig file for the DRA7xx High Security EVM. This config is specific for the case of USB booting.

---
 MAINTAINERS                         |   1 +
 configs/dra7xx_hs_evm_usb_defconfig | 106 ++++++++++++++++++++++++++++
 2 files changed, 107 insertions(+)
 create mode 100644 configs/dra7xx_hs_evm_usb_defconfig
MAINTAINERS +1 -0
index 8ea8ef9924..e574662d9d 100644
@@ -651,6 +651,7 @@ F:	configs/am335x_hs_evm_uart_defconfig
 F:	configs/am43xx_hs_evm_defconfig
 F:	configs/am57xx_hs_evm_defconfig
 F:	configs/dra7xx_hs_evm_defconfig
+F:	configs/dra7xx_hs_evm_usb_defconfig
 F:	configs/k2hk_hs_evm_defconfig
 F:	configs/k2e_hs_evm_defconfig
 F:	configs/k2g_hs_evm_defconfig
configs/dra7xx_hs_evm_usb_defconfig new file +106 -0

106 lines not on this page · raw message

Signature · 1 line
2.19.1
#16 lore raw

PATCH v2 6/7 defconfigs: Add config for AM57xx High Security EVM with USB/UART Boot support

In reply to Andrew F. Davis

Add a new defconfig file for the AM57xx High Security EVM. This config is specific for the case of USB/UART booting.

---
 MAINTAINERS                         |  1 +
 configs/am57xx_hs_evm_usb_defconfig | 92 +++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+)
 create mode 100644 configs/am57xx_hs_evm_usb_defconfig
MAINTAINERS +1 -0
index e574662d9d..c021ec2024 100644
@@ -650,6 +650,7 @@ F:	configs/am335x_hs_evm_defconfig
 F:	configs/am335x_hs_evm_uart_defconfig
 F:	configs/am43xx_hs_evm_defconfig
 F:	configs/am57xx_hs_evm_defconfig
+F:	configs/am57xx_hs_evm_usb_defconfig
 F:	configs/dra7xx_hs_evm_defconfig
 F:	configs/dra7xx_hs_evm_usb_defconfig
 F:	configs/k2hk_hs_evm_defconfig
configs/am57xx_hs_evm_usb_defconfig new file +92 -0

92 lines not on this page · raw message

Signature · 1 line
2.19.1
#18 lore raw

PATCH v2 7/7 doc: ti-secure: Add ULO info for AM57xx/DRA7xx secure devices from TI

In reply to Andrew F. Davis

Booting from UART and USB on HS devices is now supported for this platform. Update documentation for the same.

---
 doc/README.ti-secure | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
doc/README.ti-secure +6 -2
index 4b5380c0f3..76950253ac 100644
@@ -108,7 +108,8 @@ Booting of U-Boot SPL
 	Invoking the script for DRA7xx/AM57xx Secure Devices
 	====================================================
 
-	create-boot-image.sh <IMAGE_TYPE> <INPUT_FILE> <OUTPUT_FILE>
+	create-boot-image.sh \
+		<IMAGE_TYPE> <INPUT_FILE> <OUTPUT_FILE> <SPL_LOAD_ADDR>
 
 	<IMAGE_TYPE> is a value that specifies the type of the image to
 	generate OR the action the image generation tool will take. Valid
@@ -116,7 +117,6 @@ Booting of U-Boot SPL
 		X-LOADER - Generates an image for NOR or QSPI boot modes
 		MLO - Generates an image for SD/MMC/eMMC boot modes
 		ULO - Generates an image for USB/UART peripheral boot modes
-		Note: ULO is not yet used by the u-boot build process
 
 	<INPUT_FILE> is the full path and filename of the public world boot
 	loader binary file (for this platform, this is always u-boot-spl.bin).
@@ -130,9 +130,13 @@ Booting of U-Boot SPL
 		the device ROM bootloader requires for loading from
 		the FAT partition of an SD card (same as on
 		non-secure devices)
+	u-boot-spl_HS_ULO - boot image for USB/UART peripheral boot modes
 	u-boot-spl_HS_X-LOADER - boot image for all other flash memories
 		including QSPI and NOR flash
 
+	<SPL_LOAD_ADDR> is the address at which SOC ROM should load the
+	<INPUT_FILE>
+
 	Invoking the script for Keystone2 Secure Devices
 	=============================================
 
Signature · 1 line
2.19.1
#21 lore raw

v2 cover Add USB boot to HS DRA7xx/AM57xx

In reply to Andrew F. Davis
Quoted 24 lines · Andrew F. Davis

Hello all,

This series adds USB boot support to HS DRA7xx/AM57xx platforms.

We start by cleaning up DFU boot in SPL support. What is done in the first patch for DFU, if acceptable, should be done to the other boot modes.

The 4th patch is needed as on HS devices a header is added to the boot image that tells the ROM where to load this image. This only works for block device booting as the ROM can read the header and move the image into memory in steps. For streaming boot modes USB/ UART/NET the image is placed in memory as it is received from the media live. This means the header is ignored and the image has a fixed offset in memory.

For AM47xx we align the boot modes by making the offset for block device booting the same as the fixed offset for streaming boot modes, in this way only one defconfig is needed. For DRA7xx/AM57xx the signing tools will need to be updated to support specifying this address, when this is done the offset in the base HS defconfig can be moved to match the new offset and the defconfigs added here in patch 5 and 6 can be unified back into the base HS defconfig.

Quoted 1 line

The last patch updates the docs for the same above.

For the entire series:

Thanks and regards,
Lokesh

Quoted 42 lines

Thanks,
Andrew

Changes from v1:
- Drop explicit UART boot support from DRA7xx as this cannot be tested

Andrew F. Davis (7):
spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU
dfu: Make DFU support more SPL friendly
dfu: Remove dependency on HUSH parser in SPL
ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point
defconfigs: Add config for DRA7xx High Security EVM with USB Boot
support
defconfigs: Add config for AM57xx High Security EVM with USB/UART Boot
support
doc: ti-secure: Add ULO info for AM57xx/DRA7xx secure devices from TI

  MAINTAINERS                         |   2 +
  arch/arm/cpu/armv8/zynqmp/spl.c     |   2 +-
  arch/arm/mach-omap2/Kconfig         |  13 ++++
  arch/arm/mach-omap2/am33xx/Kconfig  |  15 ----
  arch/arm/mach-omap2/boot-common.c   |   2 +-
  common/Makefile                     |   3 +-
  common/cli.c                        |   2 +-
  common/spl/Kconfig                  |   6 +-
  common/spl/Makefile                 |   2 +-
  common/spl/spl_ram.c                |   4 +-
  configs/am57xx_hs_evm_usb_defconfig |  92 ++++++++++++++++++++++++
  configs/dra7xx_hs_evm_usb_defconfig | 106 ++++++++++++++++++++++++++++
  doc/README.ti-secure                |   8 ++-
  drivers/Makefile                    |   3 +-
  drivers/dfu/Makefile                |  12 ++--
  drivers/usb/gadget/Makefile         |   2 +-
  include/configs/dra7xx_evm.h        |   2 +-
  include/configs/ti_omap5_common.h   |   2 +-
  include/configs/xilinx_zynqmp.h     |   4 +-
  include/dfu.h                       |  10 +--
  20 files changed, 246 insertions(+), 46 deletions(-)

create mode 100644 configs/am57xx_hs_evm_usb_defconfig create mode 100644 configs/dra7xx_hs_evm_usb_defconfig

#2 lore raw

PATCH v2 1/7 spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU

In reply to Andrew F. Davis
Quoted 5 lines · Andrew F. Davis

The symbol CONFIG_SPL_DFU_SUPPORT in SPL build has the same meaning as CONFIG_DFU in regular U-Boot. Drop the _SUPPORT to allow for cleaner use in code.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181206/a0b0c669/attachment.sig>
#4 lore raw

PATCH v2 2/7 dfu: Make DFU support more SPL friendly

In reply to Andrew F. Davis
Quoted 6 lines · Andrew F. Davis

Do this by using $(SPL_) in Makefiles and CONFIG_IS_ENABLED in C code. This ensures the files and features are only built into the right build for which they are enabled. Using the macros to simplify this patch was made possible by the config symbol rename done in the last patch.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181206/b2a639a0/attachment.sig>
#6 lore raw

PATCH v2 3/7 dfu: Remove dependency on HUSH parser in SPL

In reply to Andrew F. Davis
Quoted 7 lines · Andrew F. Davis

CLI support with the HUSH parser is not currently SPL safe due to it's use of realloc. That function is not defined for SPLs that use SYS_MALLOC_SIMPLE. CLI support can be built in to SPL and some functions do work, but use of some like run_command() will cause build to fail. When no SPL code calls this function build works as the compiler removes this unreachable code so the unresolved symbols are ignored.

Quoted 8 lines

If DFU support is enabled in SPL then MMU DFU support may get brought in also, this code does make a call to run_command() causing build to fail if the HUSH parser is not built-in. To break this odd and unneeded dependency chain we use CONFIG_IS_ENABLED where appropriate to prevent calls into HUSH code from SPL. This also removes our need to pull in the rather unrelated source file when SPL_DFU is defined.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181206/45d92b34/attachment.sig>
#8 lore raw

PATCH v2 4/7 ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point

In reply to Andrew F. Davis
Quoted 8 lines · Andrew F. Davis

Like AM33xx and AM43xx, DRA7xx and AM57xx devices may need to have an non-standard boot address in memory. This may be due to the device being a high security variant, which place the Initial SoftWare (ISW) after certificates and secure software.

Allow these devices to set this from Kconfig.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181206/97d97e4f/attachment.sig>
#15 lore raw

PATCH v2 5/7 defconfigs: Add config for DRA7xx High Security EVM with USB Boot support

In reply to Andrew F. Davis
Quoted 4 lines · Andrew F. Davis

Add a new defconfig file for the DRA7xx High Security EVM. This config is specific for the case of USB booting.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181206/eb90b8de/attachment.sig>
#17 lore raw

PATCH v2 6/7 defconfigs: Add config for AM57xx High Security EVM with USB/UART Boot support

In reply to Andrew F. Davis
Quoted 4 lines · Andrew F. Davis

Add a new defconfig file for the AM57xx High Security EVM. This config is specific for the case of USB/UART booting.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181206/c764c362/attachment.sig>
#19 lore raw

PATCH v2 7/7 doc: ti-secure: Add ULO info for AM57xx/DRA7xx secure devices from TI

In reply to Andrew F. Davis
Quoted 4 lines · Andrew F. Davis

Booting from UART and USB on HS devices is now supported for this platform. Update documentation for the same.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181206/5fa02851/attachment.sig>
#9 lore raw

PATCH v2 4/7 ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point

In reply to Andrew F. Davis
Quoted 7 lines · Andrew F. Davis

Like AM33xx and AM43xx, DRA7xx and AM57xx devices may need to have an non-standard boot address in memory. This may be due to the device being a high security variant, which place the Initial SoftWare (ISW) after certificates and secure software.

Allow these devices to set this from Kconfig.

Quoted 7 lines
---
 arch/arm/mach-omap2/Kconfig        | 13 +++++++++++++
 arch/arm/mach-omap2/am33xx/Kconfig | 15 ---------------
 include/configs/ti_omap5_common.h  |  2 +-
 3 files changed, 14 insertions(+), 16 deletions(-)

Turns out this breaks OMAP3 among others as the question is asked there now and we have no default value (nor I suspect a reasonable one). Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190116/0b7d41d7/attachment.sig>
#10 lore raw

PATCH v2 4/7 ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point

Quoted 17 lines · Tom Rini
Quoted 7 lines · Andrew F. Davis

Like AM33xx and AM43xx, DRA7xx and AM57xx devices may need to have an non-standard boot address in memory. This may be due to the device being a high security variant, which place the Initial SoftWare (ISW) after certificates and secure software.

Allow these devices to set this from Kconfig.

Quoted 7 lines
---
 arch/arm/mach-omap2/Kconfig        | 13 +++++++++++++
 arch/arm/mach-omap2/am33xx/Kconfig | 15 ---------------
 include/configs/ti_omap5_common.h  |  2 +-
 3 files changed, 14 insertions(+), 16 deletions(-)
Quoted 2 lines

Turns out this breaks OMAP3 among others as the question is asked there now and we have no default value (nor I suspect a reasonable one).

The only thing changed is ti_omap5_common.h, the default provided in that file is 0x40301350, would it be okay to just make that the default for ISW_ENTRY_ADDR for all platforms that included that file?

Andrew

Quoted 2 lines

Thanks!

#11 lore raw

PATCH v2 4/7 ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point

Quoted 18 lines · Andrew F. Davis
Quoted 17 lines · Tom Rini
Quoted 14 lines · Andrew F. Davis

Like AM33xx and AM43xx, DRA7xx and AM57xx devices may need to have an non-standard boot address in memory. This may be due to the device being a high security variant, which place the Initial SoftWare (ISW) after certificates and secure software.

Allow these devices to set this from Kconfig.

---
 arch/arm/mach-omap2/Kconfig        | 13 +++++++++++++
 arch/arm/mach-omap2/am33xx/Kconfig | 15 ---------------
 include/configs/ti_omap5_common.h  |  2 +-
 3 files changed, 14 insertions(+), 16 deletions(-)
Quoted 6 lines
Quoted 2 lines

Turns out this breaks OMAP3 among others as the question is asked there now and we have no default value (nor I suspect a reasonable one).

The only thing changed is ti_omap5_common.h, the default provided in that file is 0x40301350, would it be okay to just make that the default for ISW_ENTRY_ADDR for all platforms that included that file?

Well, ISW_ENTRY_ADDR doesn't make sense for OMAP3, right? I suspect the problem is that in moving it from mach-omap2/am33xx/Kconfig to mach-omap2/Kconfig you need to update the depends on guards so that it doesn't show up where it's not used.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190117/4505e750/attachment.sig>
#12 lore raw

PATCH v2 4/7 ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point

Quoted 22 lines · Tom Rini
Quoted 21 lines · Andrew F. Davis
Quoted 19 lines · Tom Rini
Quoted 7 lines · Andrew F. Davis

Like AM33xx and AM43xx, DRA7xx and AM57xx devices may need to have an non-standard boot address in memory. This may be due to the device being a high security variant, which place the Initial SoftWare (ISW) after certificates and secure software.

Allow these devices to set this from Kconfig.

Quoted 7 lines
---
 arch/arm/mach-omap2/Kconfig        | 13 +++++++++++++
 arch/arm/mach-omap2/am33xx/Kconfig | 15 ---------------
 include/configs/ti_omap5_common.h  |  2 +-
 3 files changed, 14 insertions(+), 16 deletions(-)

Turns out this breaks OMAP3 among others as the question is asked there now and we have no default value (nor I suspect a reasonable one).

Quoted 9 lines
Quoted 3 lines

The only thing changed is ti_omap5_common.h, the default provided in that file is 0x40301350, would it be okay to just make that the default for ISW_ENTRY_ADDR for all platforms that included that file?

Well, ISW_ENTRY_ADDR doesn't make sense for OMAP3, right? I suspect the problem is that in moving it from mach-omap2/am33xx/Kconfig to mach-omap2/Kconfig you need to update the depends on guards so that it doesn't show up where it's not used.

CONFIG_SPL_TEXT_BASE should be converted to Kconfig, but cannot be right now due to some other platforms using strange methods for setting it in header files. So we have ISW_ENTRY_ADDR in Kconfig that is used to set CONFIG_SPL_TEXT_BASE. ISW_ENTRY_ADDR can be defined for any platform, I just may not be used depending on what headers it includes and whether they use it to set CONFIG_SPL_TEXT_BASE.

The change here is using it in ti_omap5_common.h, which a lot more platforms use is seems than I noticed. So all these platforms now need ISW_ENTRY_ADDR set to what the header to set them as (0x40301350).

Again, all this goes away when CONFIG_SPL_TEXT_BASE gets converted to Kconfig.

Andrew

#13 lore raw

PATCH v2 4/7 ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point

Quoted 40 lines · Andrew F. Davis
Quoted 22 lines · Tom Rini
Quoted 21 lines · Andrew F. Davis
Quoted 19 lines · Tom Rini
Quoted 7 lines · Andrew F. Davis

Like AM33xx and AM43xx, DRA7xx and AM57xx devices may need to have an non-standard boot address in memory. This may be due to the device being a high security variant, which place the Initial SoftWare (ISW) after certificates and secure software.

Allow these devices to set this from Kconfig.

Quoted 7 lines
---
 arch/arm/mach-omap2/Kconfig        | 13 +++++++++++++
 arch/arm/mach-omap2/am33xx/Kconfig | 15 ---------------
 include/configs/ti_omap5_common.h  |  2 +-
 3 files changed, 14 insertions(+), 16 deletions(-)

Turns out this breaks OMAP3 among others as the question is asked there now and we have no default value (nor I suspect a reasonable one).

Quoted 9 lines
Quoted 3 lines

The only thing changed is ti_omap5_common.h, the default provided in that file is 0x40301350, would it be okay to just make that the default for ISW_ENTRY_ADDR for all platforms that included that file?

Well, ISW_ENTRY_ADDR doesn't make sense for OMAP3, right? I suspect the problem is that in moving it from mach-omap2/am33xx/Kconfig to mach-omap2/Kconfig you need to update the depends on guards so that it doesn't show up where it's not used.

CONFIG_SPL_TEXT_BASE should be converted to Kconfig, but cannot be right now due to some other platforms using strange methods for setting it in header files. So we have ISW_ENTRY_ADDR in Kconfig that is used to set CONFIG_SPL_TEXT_BASE. ISW_ENTRY_ADDR can be defined for any platform, I just may not be used depending on what headers it includes and whether they use it to set CONFIG_SPL_TEXT_BASE.

Quoted 6 lines

The change here is using it in ti_omap5_common.h, which a lot more platforms use is seems than I noticed. So all these platforms now need ISW_ENTRY_ADDR set to what the header to set them as (0x40301350).

Again, all this goes away when CONFIG_SPL_TEXT_BASE gets converted to Kconfig.

Scratch that, it's not SPL_TEXT_BASE converted to Kconfig (that's done for some platforms) it looks to be us overwriting it still in many places.

Anyway posted v3 with fix for above.

Andrew

Quoted 3 lines

Andrew