Commit bc5dbcb91813a429d168de58b37cb5b291d7be75

Authored by B, Ravi
Committed by Marek Vasut
1 parent e915716a5c

spl: dfu: add dfu support in SPL

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>

Showing 3 changed files with 32 additions and 0 deletions Side-by-side Diff

... ... @@ -291,6 +291,33 @@
291 291 injected into the FIT creation (i.e. the blobs would have been pre-
292 292 processed before being added to the FIT image).
293 293  
  294 +config SPL_DFU_SUPPORT
  295 + bool "Enable SPL with DFU to load binaries to memory device"
  296 + depends on USB
  297 + help
  298 + Currently the SPL does not have capability to load the
  299 + binaries or boot images to boot devices like ram,eMMC,SPI,etc.
  300 + This feature enables the DFU (Device Firmware Upgarde) in SPL with
  301 + RAM memory device support. The ROM code will load and execute
  302 + the SPL built with dfu. The user can load binaries (u-boot/kernel) to
  303 + selected device partition from host-pc using dfu-utils.
  304 + This feature will be useful to flash the binaries to factory
  305 + or bare-metal boards using USB interface.
  306 +
  307 +choice
  308 + bool "DFU device selection"
  309 + depends on SPL_DFU_SUPPORT
  310 +
  311 +config SPL_DFU_RAM
  312 + bool "RAM device"
  313 + depends on SPL_DFU_SUPPORT
  314 + help
  315 + select RAM/DDR memory device for loading binary images
  316 + (u-boot/kernel) to the selected device partition using
  317 + DFU and execute the u-boot/kernel from RAM.
  318 +
  319 +endchoice
  320 +
294 321 config SYS_CLK_FREQ
295 322 depends on ARC || ARCH_SUNXI
296 323 int "CPU clock frequency"
... ... @@ -89,6 +89,7 @@
89 89 endif # !CONFIG_SPL_BUILD
90 90  
91 91 ifdef CONFIG_SPL_BUILD
  92 +obj-$(CONFIG_SPL_DFU_SUPPORT) += cli_hush.o
92 93 obj-$(CONFIG_SPL_HASH_SUPPORT) += hash.o
93 94 obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
94 95 obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
scripts/Makefile.spl
... ... @@ -66,6 +66,10 @@
66 66  
67 67 libs-$(CONFIG_SPL_LIBDISK_SUPPORT) += disk/
68 68 libs-y += drivers/
  69 +libs-$(CONFIG_SPL_DFU_SUPPORT) += drivers/dfu/
  70 +libs-$(CONFIG_SPL_DFU_SUPPORT) += drivers/usb/gadget/
  71 +libs-$(CONFIG_SPL_DFU_SUPPORT) += drivers/usb/gadget/udc/
  72 +libs-$(CONFIG_SPL_DFU_SUPPORT) += drivers/usb/dwc3/
69 73 libs-y += dts/
70 74 libs-y += fs/
71 75 libs-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/