All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot]  [PATCH v3 0/7] Add USB boot to HS DRA7xx/AM57xx
@ 2019-01-17 19:43 Andrew F. Davis
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 1/7] spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU Andrew F. Davis
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Andrew F. Davis @ 2019-01-17 19:43 UTC (permalink / raw)
  To: u-boot

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 v2:
 - Only use ISW_ENTRY_ADDR for system with a set default

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         |  15 ++++
 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, 248 insertions(+), 46 deletions(-)
 create mode 100644 configs/am57xx_hs_evm_usb_defconfig
 create mode 100644 configs/dra7xx_hs_evm_usb_defconfig

-- 
2.19.1

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH v3 1/7] spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU
  2019-01-17 19:43 [U-Boot] [PATCH v3 0/7] Add USB boot to HS DRA7xx/AM57xx Andrew F. Davis
@ 2019-01-17 19:43 ` Andrew F. Davis
  2019-01-22 22:40   ` Lukasz Majewski
  2019-01-27  3:52   ` [U-Boot] [U-Boot, v3, " Tom Rini
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 2/7] dfu: Make DFU support more SPL friendly Andrew F. Davis
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 20+ messages in thread
From: Andrew F. Davis @ 2019-01-17 19:43 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
 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(-)

diff --git a/arch/arm/cpu/armv8/zynqmp/spl.c b/arch/arm/cpu/armv8/zynqmp/spl.c
index 01f31d0f0e..fb3955c93f 100644
--- a/arch/arm/cpu/armv8/zynqmp/spl.c
+++ b/arch/arm/cpu/armv8/zynqmp/spl.c
@@ -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
diff --git a/arch/arm/mach-omap2/boot-common.c b/arch/arm/mach-omap2/boot-common.c
index 176d4f67cb..2db19227b9 100644
--- a/arch/arm/mach-omap2/boot-common.c
+++ b/arch/arm/mach-omap2/boot-common.c
@@ -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;
diff --git a/common/Makefile b/common/Makefile
index 0de60b3ced..3711016505 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -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
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 37ecbc6b1c..ce76dcfe2f 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -794,7 +794,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
@@ -809,11 +809,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
diff --git a/common/spl/Makefile b/common/spl/Makefile
index a130a5be4b..6f8d7599ae 100644
--- a/common/spl/Makefile
+++ b/common/spl/Makefile
@@ -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
diff --git a/common/spl/spl_ram.c b/common/spl/spl_ram.c
index 5fcc3b1504..954e91a004 100644
--- a/common/spl/spl_ram.c
+++ b/common/spl/spl_ram.c
@@ -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
 
diff --git a/drivers/Makefile b/drivers/Makefile
index 4105864e2b..14543c7d6c 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -50,7 +50,7 @@ obj-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += usb/musb-new/
 obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/
 obj-$(CONFIG_SPL_USB_GADGET) += usb/common/
 obj-$(CONFIG_SPL_USB_GADGET) += 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/
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 01e2b3abf2..70f3bf43e7 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -8,7 +8,7 @@ obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o
 
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_USB_GADGET) += 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
 
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index 2d8758db75..f36a9c3e08 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -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" \
diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
index 0ab32611ce..7a9b06ec4c 100644
--- a/include/configs/xilinx_zynqmp.h
+++ b/include/configs/xilinx_zynqmp.h
@@ -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
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot]  [PATCH v3 2/7] dfu: Make DFU support more SPL friendly
  2019-01-17 19:43 [U-Boot] [PATCH v3 0/7] Add USB boot to HS DRA7xx/AM57xx Andrew F. Davis
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 1/7] spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU Andrew F. Davis
@ 2019-01-17 19:43 ` Andrew F. Davis
  2019-01-22 22:41   ` Lukasz Majewski
  2019-01-27  3:52   ` [U-Boot] [U-Boot, v3, " Tom Rini
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 3/7] dfu: Remove dependency on HUSH parser in SPL Andrew F. Davis
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 20+ messages in thread
From: Andrew F. Davis @ 2019-01-17 19:43 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
 drivers/Makefile     |  3 +--
 drivers/dfu/Makefile | 12 ++++++------
 include/dfu.h        | 10 +++++-----
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/Makefile b/drivers/Makefile
index 14543c7d6c..eca023ac04 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -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/
@@ -50,7 +51,6 @@ obj-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += usb/musb-new/
 obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/
 obj-$(CONFIG_SPL_USB_GADGET) += usb/common/
 obj-$(CONFIG_SPL_USB_GADGET) += 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/
@@ -86,7 +86,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/
diff --git a/drivers/dfu/Makefile b/drivers/dfu/Makefile
index 56f9b0c5f4..4164f342ac 100644
--- a/drivers/dfu/Makefile
+++ b/drivers/dfu/Makefile
@@ -3,9 +3,9 @@
 # Copyright (C) 2012 Samsung Electronics
 # Lukasz Majewski <l.majewski@samsung.com>
 
-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
diff --git a/include/dfu.h b/include/dfu.h
index fbe978abdc..9340a900a2 100644
--- a/include/dfu.h
+++ b/include/dfu.h
@@ -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
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH v3 3/7] dfu: Remove dependency on HUSH parser in SPL
  2019-01-17 19:43 [U-Boot] [PATCH v3 0/7] Add USB boot to HS DRA7xx/AM57xx Andrew F. Davis
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 1/7] spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU Andrew F. Davis
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 2/7] dfu: Make DFU support more SPL friendly Andrew F. Davis
@ 2019-01-17 19:43 ` Andrew F. Davis
  2019-01-22 22:43   ` Lukasz Majewski
  2019-01-27  3:52   ` [U-Boot] [U-Boot, v3, " Tom Rini
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 4/7] ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point Andrew F. Davis
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 20+ messages in thread
From: Andrew F. Davis @ 2019-01-17 19:43 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
 common/Makefile | 1 -
 common/cli.c    | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/common/Makefile b/common/Makefile
index 3711016505..ad390d083a 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -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
diff --git a/common/cli.c b/common/cli.c
index 51b8d5f85c..fea8f8004c 100644
--- a/common/cli.c
+++ b/common/cli.c
@@ -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.
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH v3 4/7] ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point
  2019-01-17 19:43 [U-Boot] [PATCH v3 0/7] Add USB boot to HS DRA7xx/AM57xx Andrew F. Davis
                   ` (2 preceding siblings ...)
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 3/7] dfu: Remove dependency on HUSH parser in SPL Andrew F. Davis
@ 2019-01-17 19:43 ` Andrew F. Davis
  2019-01-27  3:52   ` [U-Boot] [U-Boot, v3, " Tom Rini
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 5/7] defconfigs: Add config for DRA7xx High Security EVM with USB Boot support Andrew F. Davis
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: Andrew F. Davis @ 2019-01-17 19:43 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Andrew F. Davis <afd@ti.com>
---
 arch/arm/mach-omap2/Kconfig        | 15 +++++++++++++++
 arch/arm/mach-omap2/am33xx/Kconfig | 15 ---------------
 include/configs/ti_omap5_common.h  |  2 +-
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 58e545a45b..d9bdcb355a 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -167,6 +167,21 @@ 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.
 
+if AM43XX || AM33XX || OMAP54XX
+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.
+endif
+
 source "arch/arm/mach-omap2/omap3/Kconfig"
 
 source "arch/arm/mach-omap2/omap4/Kconfig"
diff --git a/arch/arm/mach-omap2/am33xx/Kconfig b/arch/arm/mach-omap2/am33xx/Kconfig
index 57284c4ae1..4f15346c86 100644
--- a/arch/arm/mach-omap2/am33xx/Kconfig
+++ b/arch/arm/mach-omap2/am33xx/Kconfig
@@ -275,21 +275,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
diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h
index 8bf4a6b7e9..ba57c40182 100644
--- a/include/configs/ti_omap5_common.h
+++ b/include/configs/ti_omap5_common.h
@@ -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
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH v3 5/7] defconfigs: Add config for DRA7xx High Security EVM with USB Boot support
  2019-01-17 19:43 [U-Boot] [PATCH v3 0/7] Add USB boot to HS DRA7xx/AM57xx Andrew F. Davis
                   ` (3 preceding siblings ...)
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 4/7] ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point Andrew F. Davis
@ 2019-01-17 19:43 ` Andrew F. Davis
  2019-01-27  3:51   ` [U-Boot] [U-Boot, v3, " Tom Rini
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 6/7] defconfigs: Add config for AM57xx High Security EVM with USB/UART " Andrew F. Davis
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 7/7] doc: ti-secure: Add ULO info for AM57xx/DRA7xx secure devices from TI Andrew F. Davis
  6 siblings, 1 reply; 20+ messages in thread
From: Andrew F. Davis @ 2019-01-17 19:43 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
 MAINTAINERS                         |   1 +
 configs/dra7xx_hs_evm_usb_defconfig | 106 ++++++++++++++++++++++++++++
 2 files changed, 107 insertions(+)
 create mode 100644 configs/dra7xx_hs_evm_usb_defconfig

diff --git a/MAINTAINERS b/MAINTAINERS
index e192db0754..2da1a22e6c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -676,6 +676,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
diff --git a/configs/dra7xx_hs_evm_usb_defconfig b/configs/dra7xx_hs_evm_usb_defconfig
new file mode 100644
index 0000000000..7842851491
--- /dev/null
+++ b/configs/dra7xx_hs_evm_usb_defconfig
@@ -0,0 +1,106 @@
+CONFIG_ARM=y
+CONFIG_ARCH_OMAP2PLUS=y
+CONFIG_TI_SECURE_DEVICE=y
+CONFIG_TI_COMMON_CMD_OPTIONS=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_OMAP54XX=y
+CONFIG_TI_SECURE_EMIF_REGION_START=0xbdb00000
+CONFIG_TI_SECURE_EMIF_TOTAL_REGION_SIZE=0x02000000
+CONFIG_TI_SECURE_EMIF_PROTECTED_REGION_SIZE=0x01c00000
+CONFIG_ISW_ENTRY_ADDR=0x40306d50
+CONFIG_TARGET_DRA7XX_EVM=y
+CONFIG_SPL=y
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_ARMV7_LPAE=y
+CONFIG_AHCI=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_NR_DRAM_BANKS=2
+CONFIG_FIT_IMAGE_POST_PROCESS=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS0,115200 androidboot.console=ttyS0 androidboot.hardware=jacinto6evmboard"
+# CONFIG_USE_BOOTCOMMAND is not set
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+# CONFIG_MISC_INIT_R is not set
+CONFIG_VERSION_VARIABLE=y
+CONFIG_BOARD_EARLY_INIT_F=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_DMA_SUPPORT=y
+# CONFIG_SPL_NAND_SUPPORT is not set
+CONFIG_SPL_RAM_SUPPORT=y
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SPL_USB_GADGET_SUPPORT=y
+CONFIG_SPL_DFU=y
+CONFIG_SPL_YMODEM_SUPPORT=y
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="dra7-evm"
+CONFIG_OF_LIST="dra7-evm dra72-evm dra72-evm-revc dra71-evm dra76-evm"
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SPL_SYSCON=y
+CONFIG_DWC_AHCI=y
+CONFIG_DFU_MMC=y
+CONFIG_DFU_RAM=y
+CONFIG_DFU_SF=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x82000000
+CONFIG_FASTBOOT_BUF_SIZE=0x2F000000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=1
+CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
+CONFIG_DM_GPIO=y
+CONFIG_PCF8575_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_IO_VOLTAGE=y
+CONFIG_MMC_UHS_SUPPORT=y
+CONFIG_MMC_HS200_SUPPORT=y
+CONFIG_MMC_OMAP_HS=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_BAR=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_DM_ETH=y
+CONFIG_PHY_GIGE=y
+CONFIG_MII=y
+CONFIG_DRIVER_TI_CPSW=y
+CONFIG_SPL_PHY=y
+CONFIG_PIPE3_PHY=y
+CONFIG_PMIC_PALMAS=y
+CONFIG_PMIC_LP873X=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_REGULATOR_PALMAS=y
+CONFIG_DM_REGULATOR_LP873X=y
+CONFIG_DM_SCSI=y
+CONFIG_DM_SERIAL=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_TI_QSPI=y
+CONFIG_TIMER=y
+CONFIG_OMAP_TIMER=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_XHCI_DRA7XX_INDEX=1
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_OMAP=y
+CONFIG_USB_DWC3_PHY_OMAP=y
+CONFIG_OMAP_USB_PHY=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH v3 6/7] defconfigs: Add config for AM57xx High Security EVM with USB/UART Boot support
  2019-01-17 19:43 [U-Boot] [PATCH v3 0/7] Add USB boot to HS DRA7xx/AM57xx Andrew F. Davis
                   ` (4 preceding siblings ...)
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 5/7] defconfigs: Add config for DRA7xx High Security EVM with USB Boot support Andrew F. Davis
@ 2019-01-17 19:43 ` Andrew F. Davis
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 7/7] doc: ti-secure: Add ULO info for AM57xx/DRA7xx secure devices from TI Andrew F. Davis
  6 siblings, 0 replies; 20+ messages in thread
From: Andrew F. Davis @ 2019-01-17 19:43 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
 MAINTAINERS                         |  1 +
 configs/am57xx_hs_evm_usb_defconfig | 92 +++++++++++++++++++++++++++++
 2 files changed, 93 insertions(+)
 create mode 100644 configs/am57xx_hs_evm_usb_defconfig

diff --git a/MAINTAINERS b/MAINTAINERS
index 2da1a22e6c..fd5b2282f2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -675,6 +675,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
diff --git a/configs/am57xx_hs_evm_usb_defconfig b/configs/am57xx_hs_evm_usb_defconfig
new file mode 100644
index 0000000000..a0c42387ec
--- /dev/null
+++ b/configs/am57xx_hs_evm_usb_defconfig
@@ -0,0 +1,92 @@
+CONFIG_ARM=y
+CONFIG_ARCH_OMAP2PLUS=y
+CONFIG_TI_SECURE_DEVICE=y
+CONFIG_TI_COMMON_CMD_OPTIONS=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_OMAP54XX=y
+CONFIG_TI_SECURE_EMIF_REGION_START=0xbdb00000
+CONFIG_TI_SECURE_EMIF_TOTAL_REGION_SIZE=0x02000000
+CONFIG_TI_SECURE_EMIF_PROTECTED_REGION_SIZE=0x01c00000
+CONFIG_ISW_ENTRY_ADDR=0x40306d50
+CONFIG_TARGET_AM57XX_EVM=y
+CONFIG_SPL=y
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_ARMV7_LPAE=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_NR_DRAM_BANKS=2
+CONFIG_FIT_IMAGE_POST_PROCESS=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS2,115200 androidboot.console=ttyS2 androidboot.hardware=beagle_x15board"
+# CONFIG_USE_BOOTCOMMAND is not set
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+# CONFIG_MISC_INIT_R is not set
+CONFIG_VERSION_VARIABLE=y
+CONFIG_BOARD_EARLY_INIT_F=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_DMA_SUPPORT=y
+# CONFIG_SPL_NAND_SUPPORT is not set
+CONFIG_SPL_RAM_SUPPORT=y
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SPL_USB_GADGET_SUPPORT=y
+CONFIG_SPL_DFU=y
+CONFIG_SPL_YMODEM_SUPPORT=y
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="am57xx-beagle-x15"
+CONFIG_OF_LIST="am57xx-beagle-x15 am57xx-beagle-x15-revb1 am57xx-beagle-x15-revc am572x-idk am571x-idk am574x-idk"
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_SCSI_AHCI=y
+# CONFIG_BLK is not set
+CONFIG_DFU_MMC=y
+CONFIG_DFU_RAM=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x82000000
+CONFIG_FASTBOOT_BUF_SIZE=0x2F000000
+CONFIG_FASTBOOT_USB_DEV=1
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=1
+CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_OMAP_HS=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_BAR=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ90X1=y
+CONFIG_DM_ETH=y
+CONFIG_MII=y
+CONFIG_DRIVER_TI_CPSW=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_PALMAS=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_PALMAS=y
+CONFIG_DM_SERIAL=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_TI_QSPI=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GADGET=y
+CONFIG_USB_DWC3_OMAP=y
+CONFIG_USB_DWC3_PHY_OMAP=y
+CONFIG_OMAP_USB_PHY=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH v3 7/7] doc: ti-secure: Add ULO info for AM57xx/DRA7xx secure devices from TI
  2019-01-17 19:43 [U-Boot] [PATCH v3 0/7] Add USB boot to HS DRA7xx/AM57xx Andrew F. Davis
                   ` (5 preceding siblings ...)
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 6/7] defconfigs: Add config for AM57xx High Security EVM with USB/UART " Andrew F. Davis
@ 2019-01-17 19:43 ` Andrew F. Davis
  6 siblings, 0 replies; 20+ messages in thread
From: Andrew F. Davis @ 2019-01-17 19:43 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
 doc/README.ti-secure | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/doc/README.ti-secure b/doc/README.ti-secure
index 4b5380c0f3..76950253ac 100644
--- a/doc/README.ti-secure
+++ b/doc/README.ti-secure
@@ -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
 	=============================================
 
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH v3 1/7] spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 1/7] spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU Andrew F. Davis
@ 2019-01-22 22:40   ` Lukasz Majewski
  2019-01-27  3:52   ` [U-Boot] [U-Boot, v3, " Tom Rini
  1 sibling, 0 replies; 20+ messages in thread
From: Lukasz Majewski @ 2019-01-22 22:40 UTC (permalink / raw)
  To: u-boot

On Thu, 17 Jan 2019 13:43:02 -0600
"Andrew F. Davis" <afd@ti.com> wrote:

> 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.
> 

Acked-by: Lukasz Majewski <lukma@denx.de>

> Signed-off-by: Andrew F. Davis <afd@ti.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> ---
>  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(-)
> 
> diff --git a/arch/arm/cpu/armv8/zynqmp/spl.c
> b/arch/arm/cpu/armv8/zynqmp/spl.c index 01f31d0f0e..fb3955c93f 100644
> --- a/arch/arm/cpu/armv8/zynqmp/spl.c
> +++ b/arch/arm/cpu/armv8/zynqmp/spl.c
> @@ -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
> diff --git a/arch/arm/mach-omap2/boot-common.c
> b/arch/arm/mach-omap2/boot-common.c index 176d4f67cb..2db19227b9
> 100644 --- a/arch/arm/mach-omap2/boot-common.c
> +++ b/arch/arm/mach-omap2/boot-common.c
> @@ -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;
> diff --git a/common/Makefile b/common/Makefile
> index 0de60b3ced..3711016505 100644
> --- a/common/Makefile
> +++ b/common/Makefile
> @@ -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
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index 37ecbc6b1c..ce76dcfe2f 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -794,7 +794,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
> @@ -809,11 +809,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
> diff --git a/common/spl/Makefile b/common/spl/Makefile
> index a130a5be4b..6f8d7599ae 100644
> --- a/common/spl/Makefile
> +++ b/common/spl/Makefile
> @@ -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
> diff --git a/common/spl/spl_ram.c b/common/spl/spl_ram.c
> index 5fcc3b1504..954e91a004 100644
> --- a/common/spl/spl_ram.c
> +++ b/common/spl/spl_ram.c
> @@ -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
>  
> diff --git a/drivers/Makefile b/drivers/Makefile
> index 4105864e2b..14543c7d6c 100644
> --- a/drivers/Makefile
> +++ b/drivers/Makefile
> @@ -50,7 +50,7 @@ obj-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += usb/musb-new/
>  obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/
>  obj-$(CONFIG_SPL_USB_GADGET) += usb/common/
>  obj-$(CONFIG_SPL_USB_GADGET) += 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/
> diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
> index 01e2b3abf2..70f3bf43e7 100644
> --- a/drivers/usb/gadget/Makefile
> +++ b/drivers/usb/gadget/Makefile
> @@ -8,7 +8,7 @@ obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o
> usbstring.o 
>  ifdef CONFIG_SPL_BUILD
>  obj-$(CONFIG_SPL_USB_GADGET) += 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
>  
> diff --git a/include/configs/dra7xx_evm.h
> b/include/configs/dra7xx_evm.h index 2d8758db75..f36a9c3e08 100644
> --- a/include/configs/dra7xx_evm.h
> +++ b/include/configs/dra7xx_evm.h
> @@ -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" \
> diff --git a/include/configs/xilinx_zynqmp.h
> b/include/configs/xilinx_zynqmp.h index 0ab32611ce..7a9b06ec4c 100644
> --- a/include/configs/xilinx_zynqmp.h
> +++ b/include/configs/xilinx_zynqmp.h
> @@ -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




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190122/6247e8e4/attachment.sig>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH v3 2/7] dfu: Make DFU support more SPL friendly
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 2/7] dfu: Make DFU support more SPL friendly Andrew F. Davis
@ 2019-01-22 22:41   ` Lukasz Majewski
  2019-01-27  3:52   ` [U-Boot] [U-Boot, v3, " Tom Rini
  1 sibling, 0 replies; 20+ messages in thread
From: Lukasz Majewski @ 2019-01-22 22:41 UTC (permalink / raw)
  To: u-boot

On Thu, 17 Jan 2019 13:43:03 -0600
"Andrew F. Davis" <afd@ti.com> wrote:

> 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.

Acked-by: Lukasz Majewski <lukma@denx.de>

> 
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> ---
>  drivers/Makefile     |  3 +--
>  drivers/dfu/Makefile | 12 ++++++------
>  include/dfu.h        | 10 +++++-----
>  3 files changed, 12 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/Makefile b/drivers/Makefile
> index 14543c7d6c..eca023ac04 100644
> --- a/drivers/Makefile
> +++ b/drivers/Makefile
> @@ -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/
> @@ -50,7 +51,6 @@ obj-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += usb/musb-new/
>  obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/
>  obj-$(CONFIG_SPL_USB_GADGET) += usb/common/
>  obj-$(CONFIG_SPL_USB_GADGET) += 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/
> @@ -86,7 +86,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/
> diff --git a/drivers/dfu/Makefile b/drivers/dfu/Makefile
> index 56f9b0c5f4..4164f342ac 100644
> --- a/drivers/dfu/Makefile
> +++ b/drivers/dfu/Makefile
> @@ -3,9 +3,9 @@
>  # Copyright (C) 2012 Samsung Electronics
>  # Lukasz Majewski <l.majewski@samsung.com>
>  
> -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
> diff --git a/include/dfu.h b/include/dfu.h
> index fbe978abdc..9340a900a2 100644
> --- a/include/dfu.h
> +++ b/include/dfu.h
> @@ -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




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190122/c37589f8/attachment.sig>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH v3 3/7] dfu: Remove dependency on HUSH parser in SPL
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 3/7] dfu: Remove dependency on HUSH parser in SPL Andrew F. Davis
@ 2019-01-22 22:43   ` Lukasz Majewski
  2019-01-22 23:41     ` Tom Rini
  2019-01-27  3:52   ` [U-Boot] [U-Boot, v3, " Tom Rini
  1 sibling, 1 reply; 20+ messages in thread
From: Lukasz Majewski @ 2019-01-22 22:43 UTC (permalink / raw)
  To: u-boot

On Thu, 17 Jan 2019 13:43:04 -0600
"Andrew F. Davis" <afd@ti.com> wrote:

> 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.
> 

If I remember correctly the HUSH was _required_ by TI to be able to use
DFU in SPL (and that was a rationale to add it to SPL - which IMHO was
wrong from the outset).

What has changed that it is not needed anymore?

> Signed-off-by: Andrew F. Davis <afd@ti.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> ---
>  common/Makefile | 1 -
>  common/cli.c    | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/common/Makefile b/common/Makefile
> index 3711016505..ad390d083a 100644
> --- a/common/Makefile
> +++ b/common/Makefile
> @@ -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
> diff --git a/common/cli.c b/common/cli.c
> index 51b8d5f85c..fea8f8004c 100644
> --- a/common/cli.c
> +++ b/common/cli.c
> @@ -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.




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190122/49ee04f2/attachment.sig>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH v3 3/7] dfu: Remove dependency on HUSH parser in SPL
  2019-01-22 22:43   ` Lukasz Majewski
@ 2019-01-22 23:41     ` Tom Rini
  2019-01-23  6:54       ` Lukasz Majewski
  0 siblings, 1 reply; 20+ messages in thread
From: Tom Rini @ 2019-01-22 23:41 UTC (permalink / raw)
  To: u-boot

On Tue, Jan 22, 2019 at 11:43:33PM +0100, Lukasz Majewski wrote:
> On Thu, 17 Jan 2019 13:43:04 -0600
> "Andrew F. Davis" <afd@ti.com> wrote:
> 
> > 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.
> > 
> 
> If I remember correctly the HUSH was _required_ by TI to be able to use
> DFU in SPL (and that was a rationale to add it to SPL - which IMHO was
> wrong from the outset).
> 
> What has changed that it is not needed anymore?

To be fair, it was probably me-at-TI rather than TI that said it was
required.  At the time it was enough of a PITA to try and handle all of
the cases that the dfu cli command handled via API calls instead that at
least in my opinion, it wasn't worth re-whacking everything else.
Times have changed it seems :)

-- 
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/20190122/743931c4/attachment.sig>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH v3 3/7] dfu: Remove dependency on HUSH parser in SPL
  2019-01-22 23:41     ` Tom Rini
@ 2019-01-23  6:54       ` Lukasz Majewski
  2019-01-23 14:13         ` Andrew F. Davis
  0 siblings, 1 reply; 20+ messages in thread
From: Lukasz Majewski @ 2019-01-23  6:54 UTC (permalink / raw)
  To: u-boot

Hi Tom,

> On Tue, Jan 22, 2019 at 11:43:33PM +0100, Lukasz Majewski wrote:
> > On Thu, 17 Jan 2019 13:43:04 -0600
> > "Andrew F. Davis" <afd@ti.com> wrote:
> >   
> > > 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. 
> > 
> > If I remember correctly the HUSH was _required_ by TI to be able to
> > use DFU in SPL (and that was a rationale to add it to SPL - which
> > IMHO was wrong from the outset).
> > 
> > What has changed that it is not needed anymore?  
> 
> To be fair, it was probably me-at-TI rather than TI that said it was
> required.  At the time it was enough of a PITA to try and handle all
> of the cases that the dfu cli command handled via API calls instead
> that at least in my opinion, it wasn't worth re-whacking everything
> else. Times have changed it seems :)
> 

I don't mind :-).

Less code in SPL - the better.


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190123/7d5a0ef7/attachment.sig>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [PATCH v3 3/7] dfu: Remove dependency on HUSH parser in SPL
  2019-01-23  6:54       ` Lukasz Majewski
@ 2019-01-23 14:13         ` Andrew F. Davis
  0 siblings, 0 replies; 20+ messages in thread
From: Andrew F. Davis @ 2019-01-23 14:13 UTC (permalink / raw)
  To: u-boot

On 1/23/19 12:54 AM, Lukasz Majewski wrote:
> Hi Tom,
> 
>> On Tue, Jan 22, 2019 at 11:43:33PM +0100, Lukasz Majewski wrote:
>>> On Thu, 17 Jan 2019 13:43:04 -0600
>>> "Andrew F. Davis" <afd@ti.com> wrote:
>>>   
>>>> 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. 
>>>
>>> If I remember correctly the HUSH was _required_ by TI to be able to
>>> use DFU in SPL (and that was a rationale to add it to SPL - which
>>> IMHO was wrong from the outset).
>>>
>>> What has changed that it is not needed anymore?  

The cli_simple code can now handle all the common DFU commands I was
able to throw at it, so the full HUSH is not needed anymore.

>>
>> To be fair, it was probably me-at-TI rather than TI that said it was
>> required.  At the time it was enough of a PITA to try and handle all
>> of the cases that the dfu cli command handled via API calls instead
>> that at least in my opinion, it wasn't worth re-whacking everything
>> else. Times have changed it seems :)
>>
> 
> I don't mind :-).
> 
> Less code in SPL - the better.
> 

+1

Andrew

> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [U-Boot, v3, 5/7] defconfigs: Add config for DRA7xx High Security EVM with USB Boot support
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 5/7] defconfigs: Add config for DRA7xx High Security EVM with USB Boot support Andrew F. Davis
@ 2019-01-27  3:51   ` Tom Rini
  2019-01-28 17:43     ` Andrew F. Davis
  0 siblings, 1 reply; 20+ messages in thread
From: Tom Rini @ 2019-01-27  3:51 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 17, 2019 at 01:43:06PM -0600, Andrew F. Davis wrote:

> Add a new defconfig file for the DRA7xx High Security EVM. This config
> is specific for the case of USB booting.
> 
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

OK, this an the am57xx_hs_evm_usb config no longer build on top of tree.
Can you please rebase the last 3 parts of this series?  Thanks!

-- 
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/20190126/053b6533/attachment.sig>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [U-Boot, v3, 1/7] spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 1/7] spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU Andrew F. Davis
  2019-01-22 22:40   ` Lukasz Majewski
@ 2019-01-27  3:52   ` Tom Rini
  1 sibling, 0 replies; 20+ messages in thread
From: Tom Rini @ 2019-01-27  3:52 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 17, 2019 at 01:43:02PM -0600, Andrew F. Davis wrote:

> 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.
> 
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> Acked-by: Lukasz Majewski <lukma@denx.de>

Applied to u-boot/master, thanks!

-- 
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/20190126/1e395000/attachment.sig>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [U-Boot, v3, 2/7] dfu: Make DFU support more SPL friendly
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 2/7] dfu: Make DFU support more SPL friendly Andrew F. Davis
  2019-01-22 22:41   ` Lukasz Majewski
@ 2019-01-27  3:52   ` Tom Rini
  1 sibling, 0 replies; 20+ messages in thread
From: Tom Rini @ 2019-01-27  3:52 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 17, 2019 at 01:43:03PM -0600, Andrew F. Davis wrote:

> 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.
> 
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> Acked-by: Lukasz Majewski <lukma@denx.de>

Applied to u-boot/master, thanks!

-- 
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/20190126/baff811e/attachment.sig>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [U-Boot, v3, 3/7] dfu: Remove dependency on HUSH parser in SPL
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 3/7] dfu: Remove dependency on HUSH parser in SPL Andrew F. Davis
  2019-01-22 22:43   ` Lukasz Majewski
@ 2019-01-27  3:52   ` Tom Rini
  1 sibling, 0 replies; 20+ messages in thread
From: Tom Rini @ 2019-01-27  3:52 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 17, 2019 at 01:43:04PM -0600, Andrew F. Davis wrote:

> 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.
> 
> Signed-off-by: Andrew F. Davis <afd@ti.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!

-- 
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/20190126/d5bfb2be/attachment.sig>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [U-Boot, v3, 4/7] ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point
  2019-01-17 19:43 ` [U-Boot] [PATCH v3 4/7] ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point Andrew F. Davis
@ 2019-01-27  3:52   ` Tom Rini
  0 siblings, 0 replies; 20+ messages in thread
From: Tom Rini @ 2019-01-27  3:52 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 17, 2019 at 01:43:05PM -0600, Andrew F. Davis wrote:

> 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.
> 
> Signed-off-by: Andrew F. Davis <afd@ti.com>

Applied to u-boot/master, thanks!

-- 
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/20190126/2c7c63cd/attachment.sig>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [U-Boot] [U-Boot, v3, 5/7] defconfigs: Add config for DRA7xx High Security EVM with USB Boot support
  2019-01-27  3:51   ` [U-Boot] [U-Boot, v3, " Tom Rini
@ 2019-01-28 17:43     ` Andrew F. Davis
  0 siblings, 0 replies; 20+ messages in thread
From: Andrew F. Davis @ 2019-01-28 17:43 UTC (permalink / raw)
  To: u-boot

On 1/26/19 9:51 PM, Tom Rini wrote:
> On Thu, Jan 17, 2019 at 01:43:06PM -0600, Andrew F. Davis wrote:
> 
>> Add a new defconfig file for the DRA7xx High Security EVM. This config
>> is specific for the case of USB booting.
>>
>> Signed-off-by: Andrew F. Davis <afd@ti.com>
>> Reviewed-by: Tom Rini <trini@konsulko.com>
> 
> OK, this an the am57xx_hs_evm_usb config no longer build on top of tree.
> Can you please rebase the last 3 parts of this series?  Thanks!
> 

No problem, sent.

Andrew

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2019-01-28 17:43 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-17 19:43 [U-Boot] [PATCH v3 0/7] Add USB boot to HS DRA7xx/AM57xx Andrew F. Davis
2019-01-17 19:43 ` [U-Boot] [PATCH v3 1/7] spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU Andrew F. Davis
2019-01-22 22:40   ` Lukasz Majewski
2019-01-27  3:52   ` [U-Boot] [U-Boot, v3, " Tom Rini
2019-01-17 19:43 ` [U-Boot] [PATCH v3 2/7] dfu: Make DFU support more SPL friendly Andrew F. Davis
2019-01-22 22:41   ` Lukasz Majewski
2019-01-27  3:52   ` [U-Boot] [U-Boot, v3, " Tom Rini
2019-01-17 19:43 ` [U-Boot] [PATCH v3 3/7] dfu: Remove dependency on HUSH parser in SPL Andrew F. Davis
2019-01-22 22:43   ` Lukasz Majewski
2019-01-22 23:41     ` Tom Rini
2019-01-23  6:54       ` Lukasz Majewski
2019-01-23 14:13         ` Andrew F. Davis
2019-01-27  3:52   ` [U-Boot] [U-Boot, v3, " Tom Rini
2019-01-17 19:43 ` [U-Boot] [PATCH v3 4/7] ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point Andrew F. Davis
2019-01-27  3:52   ` [U-Boot] [U-Boot, v3, " Tom Rini
2019-01-17 19:43 ` [U-Boot] [PATCH v3 5/7] defconfigs: Add config for DRA7xx High Security EVM with USB Boot support Andrew F. Davis
2019-01-27  3:51   ` [U-Boot] [U-Boot, v3, " Tom Rini
2019-01-28 17:43     ` Andrew F. Davis
2019-01-17 19:43 ` [U-Boot] [PATCH v3 6/7] defconfigs: Add config for AM57xx High Security EVM with USB/UART " Andrew F. Davis
2019-01-17 19:43 ` [U-Boot] [PATCH v3 7/7] doc: ti-secure: Add ULO info for AM57xx/DRA7xx secure devices from TI Andrew F. Davis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.