From: Stefan Agner <stefan@agner.ch>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 2/3] spl: dfu: move DFU Kconfig to SPL Kconfig
Date: Tue, 15 Nov 2016 13:02:45 -0800 [thread overview]
Message-ID: <20161115210246.2245-3-stefan@agner.ch> (raw)
In-Reply-To: <20161115210246.2245-1-stefan@agner.ch>
From: Stefan Agner <stefan.agner@toradex.com>
The DFU Kconfig menu entries should be part of the SPL
Kconfig file. Also avoid using the top level Makefile by
moving the config dependent build artifacts to the driver/
and driver/usb/gadget/ Makfiles.
With that, DFU can be built again in SPL if
CONFIG_SPL_DFU_SUPPORT is enabled.
Fixes: 6ad6102246d8 ("usb:gadget: Disallow DFU in SPL for now")
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
Tom, I checked size for am335x_evm_usbspl_defconfig, it stays
fine with this patch.
Changes in v3: None
Changes in v2:
- Leave DWC3 config in top level SPL Makefile (as U-Boot does)
Kconfig | 27 ---------------------------
common/spl/Kconfig | 26 ++++++++++++++++++++++++++
drivers/Makefile | 3 +++
drivers/usb/gadget/Makefile | 8 ++++++--
include/configs/dra7xx_evm.h | 1 -
scripts/Makefile.spl | 3 ---
6 files changed, 35 insertions(+), 33 deletions(-)
diff --git a/Kconfig b/Kconfig
index 1263d0b..a759e4d 100644
--- a/Kconfig
+++ b/Kconfig
@@ -291,33 +291,6 @@ config FIT_IMAGE_POST_PROCESS
injected into the FIT creation (i.e. the blobs would have been pre-
processed before being added to the FIT image).
-config SPL_DFU_SUPPORT
- bool "Enable SPL with DFU to load binaries to memory device"
- depends on USB
- help
- Currently the SPL does not have capability to load the
- binaries or boot images to boot devices like ram,eMMC,SPI,etc.
- This feature enables the DFU (Device Firmware Upgarde) in SPL with
- RAM memory device support. The ROM code will load and execute
- the SPL built with dfu. The user can load binaries (u-boot/kernel) to
- selected device partition from host-pc using dfu-utils.
- This feature will be useful to flash the binaries to factory
- or bare-metal boards using USB interface.
-
-choice
- bool "DFU device selection"
- depends on SPL_DFU_SUPPORT
-
-config SPL_DFU_RAM
- bool "RAM device"
- depends on SPL_DFU_SUPPORT
- help
- select RAM/DDR memory device for loading binary images
- (u-boot/kernel) to the selected device partition using
- DFU and execute the u-boot/kernel from RAM.
-
-endchoice
-
config SYS_CLK_FREQ
depends on ARC || ARCH_SUNXI
int "CPU clock frequency"
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index bb99f1f..54bcba3 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -497,6 +497,32 @@ config SPL_USB_SUPPORT
config options. This enables loading from USB using a configured
device.
+config SPL_DFU_SUPPORT
+ bool "Support DFU (Device Firmware Upgarde)"
+ depends on SPL
+ select SPL_HASH_SUPPORT
+ help
+ This feature enables the DFU (Device Firmware Upgarde) in SPL with
+ RAM memory device support. The ROM code will load and execute
+ the SPL built with dfu. The user can load binaries (u-boot/kernel) to
+ selected device partition from host-pc using dfu-utils.
+ This feature is useful to flash the binaries to factory or bare-metal
+ boards using USB interface.
+
+choice
+ bool "DFU device selection"
+ depends on SPL_DFU_SUPPORT
+
+config SPL_DFU_RAM
+ bool "RAM device"
+ depends on SPL_DFU_SUPPORT
+ help
+ select RAM/DDR memory device for loading binary images
+ (u-boot/kernel) to the selected device partition using
+ DFU and execute the u-boot/kernel from RAM.
+
+endchoice
+
config SPL_WATCHDOG_SUPPORT
bool "Support watchdog drivers"
depends on SPL
diff --git a/drivers/Makefile b/drivers/Makefile
index 761d0b3..40aba58 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -34,6 +34,9 @@ obj-$(CONFIG_SPL_ETH_SUPPORT) += net/phy/
obj-$(CONFIG_SPL_USBETH_SUPPORT) += net/phy/
obj-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += usb/musb-new/
obj-$(CONFIG_SPL_USBETH_SUPPORT) += usb/gadget/
+obj-$(CONFIG_SPL_DFU_SUPPORT) += usb/gadget/
+obj-$(CONFIG_SPL_DFU_SUPPORT) += usb/gadget/udc/
+obj-$(CONFIG_SPL_DFU_SUPPORT) += 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 acc9964..5b18e8c 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -8,6 +8,10 @@
obj-$(CONFIG_USB_GADGET) += epautoconf.o config.o usbstring.o
obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o
+ifdef CONFIG_SPL_BUILD
+obj-$(CONFIG_SPL_DFU_SUPPORT) += f_dfu.o
+endif
+
# new USB gadget layer dependencies
ifdef CONFIG_USB_GADGET
obj-$(CONFIG_USB_GADGET_AT91) += at91_udc.o
@@ -18,13 +22,13 @@ obj-$(CONFIG_USB_GADGET_DWC2_OTG_PHY) += dwc2_udc_otg_phy.o
obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
obj-$(CONFIG_CI_UDC) += ci_udc.o
obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o
-obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
ifndef CONFIG_SPL_BUILD
+obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
obj-$(CONFIG_USB_FUNCTION_DFU) += f_dfu.o
-endif
obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o
obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += f_fastboot.o
endif
+endif
ifdef CONFIG_USB_ETHER
obj-y += ether.o
obj-$(CONFIG_USB_ETH_RNDIS) += rndis.o
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index 798002d..e295a84 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -133,7 +133,6 @@
#undef CONFIG_CMD_BOOTD
#ifdef CONFIG_SPL_DFU_SUPPORT
#define CONFIG_SPL_LOAD_FIT_ADDRESS 0x80200000
-#define CONFIG_SPL_HASH_SUPPORT
#define DFU_ALT_INFO_RAM \
"dfu_alt_info_ram=" \
"kernel ram 0x80200000 0x4000000;" \
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index e0b0117..1e3b60a 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -66,9 +66,6 @@ endif
libs-$(CONFIG_SPL_LIBDISK_SUPPORT) += disk/
libs-y += drivers/
-libs-$(CONFIG_SPL_DFU_SUPPORT) += drivers/dfu/
-libs-$(CONFIG_SPL_DFU_SUPPORT) += drivers/usb/gadget/
-libs-$(CONFIG_SPL_DFU_SUPPORT) += drivers/usb/gadget/udc/
libs-$(CONFIG_SPL_DFU_SUPPORT) += drivers/usb/dwc3/
libs-y += dts/
libs-y += fs/
--
2.10.2
next prev parent reply other threads:[~2016-11-15 21:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-15 21:02 [U-Boot] [PATCH v3 0/3] spl: USB Gadget cleanup Stefan Agner
2016-11-15 21:02 ` [U-Boot] [PATCH v3 1/3] spl: add RAM boot device only if it is actually defined Stefan Agner
2016-11-16 13:44 ` Lukasz Majewski
2016-11-18 1:14 ` Simon Glass
2016-11-18 1:27 ` Stefan Agner
2016-11-19 13:48 ` Simon Glass
2016-11-15 21:02 ` Stefan Agner [this message]
2016-11-15 21:34 ` [U-Boot] [PATCH v3 2/3] spl: dfu: move DFU Kconfig to SPL Kconfig Brüns, Stefan
2016-11-16 14:06 ` Lukasz Majewski
2016-11-15 21:02 ` [U-Boot] [PATCH v3 3/3] spl: add USB Gadget config option Stefan Agner
2016-11-16 14:31 ` Lukasz Majewski
2016-11-16 7:04 ` [U-Boot] [PATCH v3 0/3] spl: USB Gadget cleanup B, Ravi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161115210246.2245-3-stefan@agner.ch \
--to=stefan@agner.ch \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox