]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
spl: dfu: add dfu support in SPL
authorB, Ravi <ravibabu@ti.com>
Thu, 28 Jul 2016 12:09:14 +0000 (17:39 +0530)
committerMarek Vasut <marex@denx.de>
Tue, 27 Sep 2016 21:30:17 +0000 (23:30 +0200)
Traditionally the DFU support is available only
as part 2nd stage boot loader(u-boot) and DFU
is not supported in SPL.

The SPL-DFU feature is useful for boards which
does not have MMC/SD, ethernet boot mechanism
to boot the board and only has USB inteface.

This patch add DFU support in SPL with RAM
memory device support to load and execute u-boot.
And then leverage full functionality DFU in
u-boot to flash boot inital binary images to
factory or bare-metal boards to memory devices
like SPI, eMMC, MMC/SD card using USB interface.

This SPL-DFU support can be enabled through
Menuconfig->Boot Images->Enable SPL-DFU support

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Kconfig
common/Makefile
scripts/Makefile.spl

diff --git a/Kconfig b/Kconfig
index a759e4da2729e689cc7a0185cb22b257cb9c34fa..1263d0b612dd0668e0264d08b6cdef70bcb97853 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -291,6 +291,33 @@ 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"
index 9a9a065ad21d34224674ce7d30094433c619dd0c..6b4456edff6d0c97151fdf5a4567ea9247914d1f 100644 (file)
@@ -89,6 +89,7 @@ obj-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
 endif # !CONFIG_SPL_BUILD
 
 ifdef CONFIG_SPL_BUILD
+obj-$(CONFIG_SPL_DFU_SUPPORT) += cli_hush.o
 obj-$(CONFIG_SPL_HASH_SUPPORT) += hash.o
 obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
 obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
index 5a7f79c25a76cbd12b1b193276b282c242f88d85..4febc6b401aaa657df730a8e6627c6eb733697da 100644 (file)
@@ -66,6 +66,10 @@ 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/
 libs-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/