Commit 5991703e88f320767d9390d64a6a9bd62560696b
Committed by
Tom Rini
1 parent
34ee947ac3
Exists in
v2017.01-smarct4x
and in
25 other branches
spl: dfu: move DFU Kconfig to SPL Kconfig
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> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Showing 6 changed files with 35 additions and 33 deletions Side-by-side Diff
Kconfig
... | ... | @@ -292,33 +292,6 @@ |
292 | 292 | injected into the FIT creation (i.e. the blobs would have been pre- |
293 | 293 | processed before being added to the FIT image). |
294 | 294 | |
295 | -config SPL_DFU_SUPPORT | |
296 | - bool "Enable SPL with DFU to load binaries to memory device" | |
297 | - depends on USB | |
298 | - help | |
299 | - Currently the SPL does not have capability to load the | |
300 | - binaries or boot images to boot devices like ram,eMMC,SPI,etc. | |
301 | - This feature enables the DFU (Device Firmware Upgarde) in SPL with | |
302 | - RAM memory device support. The ROM code will load and execute | |
303 | - the SPL built with dfu. The user can load binaries (u-boot/kernel) to | |
304 | - selected device partition from host-pc using dfu-utils. | |
305 | - This feature will be useful to flash the binaries to factory | |
306 | - or bare-metal boards using USB interface. | |
307 | - | |
308 | -choice | |
309 | - bool "DFU device selection" | |
310 | - depends on SPL_DFU_SUPPORT | |
311 | - | |
312 | -config SPL_DFU_RAM | |
313 | - bool "RAM device" | |
314 | - depends on SPL_DFU_SUPPORT | |
315 | - help | |
316 | - select RAM/DDR memory device for loading binary images | |
317 | - (u-boot/kernel) to the selected device partition using | |
318 | - DFU and execute the u-boot/kernel from RAM. | |
319 | - | |
320 | -endchoice | |
321 | - | |
322 | 295 | config SYS_CLK_FREQ |
323 | 296 | depends on ARC || ARCH_SUNXI |
324 | 297 | int "CPU clock frequency" |
common/spl/Kconfig
... | ... | @@ -524,6 +524,32 @@ |
524 | 524 | config options. This enables loading from USB using a configured |
525 | 525 | device. |
526 | 526 | |
527 | +config SPL_DFU_SUPPORT | |
528 | + bool "Support DFU (Device Firmware Upgarde)" | |
529 | + depends on SPL | |
530 | + select SPL_HASH_SUPPORT | |
531 | + help | |
532 | + This feature enables the DFU (Device Firmware Upgarde) in SPL with | |
533 | + RAM memory device support. The ROM code will load and execute | |
534 | + the SPL built with dfu. The user can load binaries (u-boot/kernel) to | |
535 | + selected device partition from host-pc using dfu-utils. | |
536 | + This feature is useful to flash the binaries to factory or bare-metal | |
537 | + boards using USB interface. | |
538 | + | |
539 | +choice | |
540 | + bool "DFU device selection" | |
541 | + depends on SPL_DFU_SUPPORT | |
542 | + | |
543 | +config SPL_DFU_RAM | |
544 | + bool "RAM device" | |
545 | + depends on SPL_DFU_SUPPORT | |
546 | + help | |
547 | + select RAM/DDR memory device for loading binary images | |
548 | + (u-boot/kernel) to the selected device partition using | |
549 | + DFU and execute the u-boot/kernel from RAM. | |
550 | + | |
551 | +endchoice | |
552 | + | |
527 | 553 | config SPL_WATCHDOG_SUPPORT |
528 | 554 | bool "Support watchdog drivers" |
529 | 555 | depends on SPL |
drivers/Makefile
... | ... | @@ -34,6 +34,9 @@ |
34 | 34 | obj-$(CONFIG_SPL_USBETH_SUPPORT) += net/phy/ |
35 | 35 | obj-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += usb/musb-new/ |
36 | 36 | obj-$(CONFIG_SPL_USBETH_SUPPORT) += usb/gadget/ |
37 | +obj-$(CONFIG_SPL_DFU_SUPPORT) += usb/gadget/ | |
38 | +obj-$(CONFIG_SPL_DFU_SUPPORT) += usb/gadget/udc/ | |
39 | +obj-$(CONFIG_SPL_DFU_SUPPORT) += dfu/ | |
37 | 40 | obj-$(CONFIG_SPL_WATCHDOG_SUPPORT) += watchdog/ |
38 | 41 | obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += usb/host/ |
39 | 42 | obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/ |
drivers/usb/gadget/Makefile
... | ... | @@ -8,6 +8,10 @@ |
8 | 8 | obj-$(CONFIG_USB_GADGET) += epautoconf.o config.o usbstring.o |
9 | 9 | obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o |
10 | 10 | |
11 | +ifdef CONFIG_SPL_BUILD | |
12 | +obj-$(CONFIG_SPL_DFU_SUPPORT) += f_dfu.o | |
13 | +endif | |
14 | + | |
11 | 15 | # new USB gadget layer dependencies |
12 | 16 | ifdef CONFIG_USB_GADGET |
13 | 17 | obj-$(CONFIG_USB_GADGET_AT91) += at91_udc.o |
14 | 18 | |
15 | 19 | |
16 | 20 | |
... | ... | @@ -18,12 +22,12 @@ |
18 | 22 | obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o |
19 | 23 | obj-$(CONFIG_CI_UDC) += ci_udc.o |
20 | 24 | obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o |
21 | -obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o | |
22 | 25 | ifndef CONFIG_SPL_BUILD |
26 | +obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o | |
23 | 27 | obj-$(CONFIG_USB_FUNCTION_DFU) += f_dfu.o |
24 | -endif | |
25 | 28 | obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o |
26 | 29 | obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += f_fastboot.o |
30 | +endif | |
27 | 31 | endif |
28 | 32 | ifdef CONFIG_USB_ETHER |
29 | 33 | obj-y += ether.o |
include/configs/dra7xx_evm.h
scripts/Makefile.spl
... | ... | @@ -66,9 +66,6 @@ |
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 | 69 | libs-$(CONFIG_SPL_DFU_SUPPORT) += drivers/usb/dwc3/ |
73 | 70 | libs-y += dts/ |
74 | 71 | libs-y += fs/ |