Skip to contentSkip to conversation

usb:gadget: Disallow DFU in SPL for now

PATCH New Tom Rini 2 participants 3 messages Sep 27, 2016 – Sep 28, 2016 USB

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 usb:gadget: Disallow DFU in SPL for now

Previously, DFU was not built in for SPL and often disabled via the board config.h file, in the SPL build. By moving DFU to Kconfig we now need to move this logic to the Makefile to continue to allow boards to fit within their SPL size limit (until gcc 6 is more widespread and unused strings will be discarded).

---
Without this, but everything converted am335x_evm_usbspl fails to link (does gadget USB in SPL) unless we make drivers/dfu/ unconditional. This however breaks a few other platforms that have a smaller SPL size due to undiscarded strings, and a lot of other platforms just grow by a few KiB. This is the best solution I can come up with for now.

 drivers/usb/gadget/Makefile | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/gadget/Makefile +2 -0
index c915c79..acc9964 100644
@@ -19,7 +19,9 @@ 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_DFU) += f_dfu.o
+endif
 obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o
 obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += f_fastboot.o
 endif
Signature · 1 line
2.8.1
author
#1 lore raw

PATCH 1/1 usb:gadget: Disallow DFU in SPL for now

Quoted 7 lines · Tom Rini

Previously, DFU was not built in for SPL and often disabled via the board config.h file, in the SPL build. By moving DFU to Kconfig we now need to move this logic to the Makefile to continue to allow boards to fit within their SPL size limit (until gcc 6 is more widespread and unused strings will be discarded).

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160927/873bda89/attachment.sig>
#2 lore raw

PATCH 1/1 usb:gadget: Disallow DFU in SPL for now

In reply to Tom Rini

Hi Tom,

Quoted 6 lines

Previously, DFU was not built in for SPL and often disabled via the board config.h file, in the SPL build. By moving DFU to Kconfig we now need to move this logic to the Makefile to continue to allow boards to fit within their SPL size limit (until gcc 6 is more widespread and unused strings will be discarded).

Quoted 8 lines

---
Without this, but everything converted am335x_evm_usbspl fails to link (does gadget USB in SPL) unless we make drivers/dfu/ unconditional. This however breaks a few other platforms that have a smaller SPL size due to undiscarded strings, and a lot of other platforms just grow by a few KiB. This is the best solution I can come up with for now.

Ok, lets disable it (hopefully for now).

Quoted 18 lines
 drivers/usb/gadget/Makefile | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/gadget/Makefile +2 -0
index c915c79..acc9964 100644
@@ -19,7 +19,9 @@ 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_DFU) += f_dfu.o
+endif
 obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o
 obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += f_fastboot.o
 endif
Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group