Skip to contentSkip to conversation

usb: gadget: Disable gadget options in SPL

PATCH New Sam Protsenko 3 participants 5 messages Apr 15, 2016 – Apr 19, 2016 Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: gadget: Disable gadget options in SPL

During Kconfig migrating process we missed to check some gadget options for SPL_BUILD. Do it now to properly disable gadget in SPL build for those platforms that disabled it before migrating options to Kconfig.

---
 include/configs/am43xx_evm.h              |  1 +
 include/configs/mx6sabre_common.h         | 11 +++++++++++
 include/configs/siemens-am33x-common.h    | 10 ++++++++++
 include/configs/smartweb.h                |  9 +++++++++
 include/configs/tegra-common-usb-gadget.h | 11 +++++++++++
 5 files changed, 42 insertions(+)
include/configs/am43xx_evm.h +1 -0
index 5d5ae5e..c8beacd 100644
@@ -127,6 +127,7 @@
 #undef CONFIG_USB_DWC3
 #undef CONFIG_USB_DWC3_GADGET
 
+#undef CONFIG_USB_GADGET
 #undef CONFIG_USB_GADGET_DOWNLOAD
 #undef CONFIG_USB_GADGET_VBUS_DRAW
 #undef CONFIG_G_DNL_MANUFACTURER
include/configs/mx6sabre_common.h +11 -0
index 87bbf2e..5ca0fda 100644
@@ -252,4 +252,15 @@
 #define CONFIG_DFU_SF
 #endif
 
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_CI_UDC
+#undef CONFIG_USB_GADGET
+#undef CONFIG_USB_GADGET_VBUS_DRAW
+#undef CONFIG_USB_GADGET_DUALSPEED
+#undef CONFIG_USB_GADGET_DOWNLOAD
+#undef CONFIG_G_DNL_MANUFACTURER
+#undef CONFIG_G_DNL_VENDOR_NUM
+#undef CONFIG_G_DNL_PRODUCT_NUM
+#endif
+
 #endif                         /* __MX6QSABRE_COMMON_CONFIG_H */
include/configs/siemens-am33x-common.h +10 -0
index 5b94fad..d11566e 100644
@@ -253,6 +253,16 @@
 
 #endif /* CONFIG_SPL_BUILD */
 
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_USB_MUSB_GADGET
+#undef CONFIG_USB_GADGET
+#undef CONFIG_USB_GADGET_VBUS_DRAW
+#undef CONFIG_USB_GADGET_DOWNLOAD
+#undef CONFIG_G_DNL_MANUFACTURER
+#undef CONFIG_G_DNL_VENDOR_NUM
+#undef CONFIG_G_DNL_PRODUCT_NUM
+#endif
+
 /*
  * Default to using SPI for environment, etc.  We have multiple copies
  * of SPL as the ROM will check these locations.
include/configs/smartweb.h +9 -0
index 0352379..f2e9b90 100644
@@ -181,6 +181,15 @@
 #define CONFIG_SYS_CACHELINE_SIZE	0x2000
 #endif
 
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_USB_GADGET
+#undef CONFIG_USB_GADGET_VBUS_DRAW
+#undef CONFIG_USB_GADGET_DOWNLOAD
+#undef CONFIG_G_DNL_MANUFACTURER
+#undef CONFIG_G_DNL_VENDOR_NUM
+#undef CONFIG_G_DNL_PRODUCT_NUM
+#endif
+
 /* General Boot Parameter */
 #define CONFIG_BOOTDELAY		3
 #define CONFIG_BOOTCOMMAND		"run flashboot"
include/configs/tegra-common-usb-gadget.h +11 -0
index 18851ca..1d6b99e 100644
@@ -28,4 +28,15 @@
 #define CONFIG_DFU_RAM
 #endif
 
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_CI_UDC
+#undef CONFIG_USB_GADGET
+#undef CONFIG_USB_GADGET_VBUS_DRAW
+#undef CONFIG_USB_GADGET_DUALSPEED
+#undef CONFIG_USB_GADGET_DOWNLOAD
+#undef CONFIG_G_DNL_MANUFACTURER
+#undef CONFIG_G_DNL_VENDOR_NUM
+#undef CONFIG_G_DNL_PRODUCT_NUM
+#endif
+
 #endif /* _TEGRA_COMMON_USB_GADGET_H_ */
Signature · 1 line
2.8.0.rc3
#1 lore raw

PATCH 1/1 usb: gadget: Disable gadget options in SPL

Hi Sam,

Quoted 31 lines

During Kconfig migrating process we missed to check some gadget options for SPL_BUILD. Do it now to properly disable gadget in SPL build for those platforms that disabled it before migrating options to Kconfig.

---
 include/configs/am43xx_evm.h              |  1 +
 include/configs/mx6sabre_common.h         | 11 +++++++++++
 include/configs/siemens-am33x-common.h    | 10 ++++++++++
 include/configs/smartweb.h                |  9 +++++++++
 include/configs/tegra-common-usb-gadget.h | 11 +++++++++++
 5 files changed, 42 insertions(+)
(quoted diff) +0 -0

b/include/configs/am43xx_evm.h index 5d5ae5e..c8beacd 100644

include/configs/am43xx_evm.h +1 -0
@@ -127,6 +127,7 @@
 #undef CONFIG_USB_DWC3
 #undef CONFIG_USB_DWC3_GADGET
 
+#undef CONFIG_USB_GADGET
 #undef CONFIG_USB_GADGET_DOWNLOAD
 #undef CONFIG_USB_GADGET_VBUS_DRAW
 #undef CONFIG_G_DNL_MANUFACTURER
(quoted diff) +0 -0

b/include/configs/mx6sabre_common.h index 87bbf2e..5ca0fda 100644

include/configs/mx6sabre_common.h line 254

Quoted 3 lines
include/configs/mx6sabre_common.h +0 -0
@@ -252,4 +252,15 @@
 #define CONFIG_DFU_SF
 #endif
 

Would it be possible to use:
#ifndef CONFIG_SPL_BUILD

to guard (undef in this case) relevant parts of those config files (the old approach)

include/configs/mx6sabre_common.h line 264

Quoted 10 lines
include/configs/mx6sabre_common.h +10 -0
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_CI_UDC
+#undef CONFIG_USB_GADGET
+#undef CONFIG_USB_GADGET_VBUS_DRAW
+#undef CONFIG_USB_GADGET_DUALSPEED
+#undef CONFIG_USB_GADGET_DOWNLOAD
+#undef CONFIG_G_DNL_MANUFACTURER
+#undef CONFIG_G_DNL_VENDOR_NUM
+#undef CONFIG_G_DNL_PRODUCT_NUM
+#endif

For Kconfig's definition maybe we would be better off by using "depends on !SPL_BUILD" for those relevant boards?

Quoted 64 lines
include/configs/mx6sabre_common.h +1 -0
+
 #endif                         /* __MX6QSABRE_COMMON_CONFIG_H */
(quoted diff) +0 -0

b/include/configs/siemens-am33x-common.h index 5b94fad..d11566e 100644

include/configs/siemens-am33x-common.h +10 -0
@@ -253,6 +253,16 @@
 
 #endif /* CONFIG_SPL_BUILD */
 
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_USB_MUSB_GADGET
+#undef CONFIG_USB_GADGET
+#undef CONFIG_USB_GADGET_VBUS_DRAW
+#undef CONFIG_USB_GADGET_DOWNLOAD
+#undef CONFIG_G_DNL_MANUFACTURER
+#undef CONFIG_G_DNL_VENDOR_NUM
+#undef CONFIG_G_DNL_PRODUCT_NUM
+#endif
+
 /*
  * Default to using SPI for environment, etc.  We have multiple

copies
* of SPL as the ROM will check these locations.

include/configs/smartweb.h +9 -0
index 0352379..f2e9b90 100644
@@ -181,6 +181,15 @@
 #define CONFIG_SYS_CACHELINE_SIZE	0x2000
 #endif
 
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_USB_GADGET
+#undef CONFIG_USB_GADGET_VBUS_DRAW
+#undef CONFIG_USB_GADGET_DOWNLOAD
+#undef CONFIG_G_DNL_MANUFACTURER
+#undef CONFIG_G_DNL_VENDOR_NUM
+#undef CONFIG_G_DNL_PRODUCT_NUM
+#endif
+
 /* General Boot Parameter */
 #define CONFIG_BOOTDELAY		3
 #define CONFIG_BOOTCOMMAND		"run flashboot"
(quoted diff) +0 -0

b/include/configs/tegra-common-usb-gadget.h index 18851ca..1d6b99e 100644 --- a/include/configs/tegra-common-usb-gadget.h +++ b/include/configs/tegra-common-usb-gadget.h

include/configs/tegra-common-usb-gadget.h +11 -0
@@ -28,4 +28,15 @@
 #define CONFIG_DFU_RAM
 #endif
 
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_CI_UDC
+#undef CONFIG_USB_GADGET
+#undef CONFIG_USB_GADGET_VBUS_DRAW
+#undef CONFIG_USB_GADGET_DUALSPEED
+#undef CONFIG_USB_GADGET_DOWNLOAD
+#undef CONFIG_G_DNL_MANUFACTURER
+#undef CONFIG_G_DNL_VENDOR_NUM
+#undef CONFIG_G_DNL_PRODUCT_NUM
+#endif
+
 #endif /* _TEGRA_COMMON_USB_GADGET_H_ */
Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#2 lore raw

PATCH 1/1 usb: gadget: Disable gadget options in SPL

Quoted 43 lines · Lukasz Majewski

Hi Sam,

Quoted 31 lines

During Kconfig migrating process we missed to check some gadget options for SPL_BUILD. Do it now to properly disable gadget in SPL build for those platforms that disabled it before migrating options to Kconfig.

---
 include/configs/am43xx_evm.h              |  1 +
 include/configs/mx6sabre_common.h         | 11 +++++++++++
 include/configs/siemens-am33x-common.h    | 10 ++++++++++
 include/configs/smartweb.h                |  9 +++++++++
 include/configs/tegra-common-usb-gadget.h | 11 +++++++++++
 5 files changed, 42 insertions(+)
(quoted diff) +0 -0

b/include/configs/am43xx_evm.h index 5d5ae5e..c8beacd 100644

include/configs/am43xx_evm.h +1 -0
@@ -127,6 +127,7 @@
 #undef CONFIG_USB_DWC3
 #undef CONFIG_USB_DWC3_GADGET
 
+#undef CONFIG_USB_GADGET
 #undef CONFIG_USB_GADGET_DOWNLOAD
 #undef CONFIG_USB_GADGET_VBUS_DRAW
 #undef CONFIG_G_DNL_MANUFACTURER
(quoted diff) +0 -0

b/include/configs/mx6sabre_common.h index 87bbf2e..5ca0fda 100644

include/configs/mx6sabre_common.h line 254

Quoted 3 lines
include/configs/mx6sabre_common.h +0 -0
@@ -252,4 +252,15 @@
 #define CONFIG_DFU_SF
 #endif
 

Would it be possible to use:
#ifndef CONFIG_SPL_BUILD

to guard (undef in this case) relevant parts of those config files (the old approach)

Quoted 14 lines

include/configs/mx6sabre_common.h line 264

Quoted 10 lines
include/configs/mx6sabre_common.h +10 -0
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_CI_UDC
+#undef CONFIG_USB_GADGET
+#undef CONFIG_USB_GADGET_VBUS_DRAW
+#undef CONFIG_USB_GADGET_DUALSPEED
+#undef CONFIG_USB_GADGET_DOWNLOAD
+#undef CONFIG_G_DNL_MANUFACTURER
+#undef CONFIG_G_DNL_VENDOR_NUM
+#undef CONFIG_G_DNL_PRODUCT_NUM
+#endif

For Kconfig's definition maybe we would be better off by using "depends on !SPL_BUILD" for those relevant boards?

You mean we should add that "depends on !SPL_BUILD" to Kconfigs for each option and also check relevant boards there? Wouldn't it make mess in Kconfigs? As for me, #undef approach is more clear (if I understood your proposal correctly), but of course, if we're gonna get rid of include/configs/ completely, it should be moved to Kconfigs. But I'd prefer (if you don't mind) to have this patch merged as is, and probably move those to Kconfigs further in separate patch, as this patch just brings things back to original state (after my previous patch series), and it would be hard to do all the work at once.

Thanks.

Quoted 73 lines
Quoted 54 lines
include/configs/mx6sabre_common.h +1 -0
+
 #endif                         /* __MX6QSABRE_COMMON_CONFIG_H */
(quoted diff) +0 -0

b/include/configs/siemens-am33x-common.h index 5b94fad..d11566e 100644

include/configs/siemens-am33x-common.h +10 -0
@@ -253,6 +253,16 @@
 
 #endif /* CONFIG_SPL_BUILD */
 
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_USB_MUSB_GADGET
+#undef CONFIG_USB_GADGET
+#undef CONFIG_USB_GADGET_VBUS_DRAW
+#undef CONFIG_USB_GADGET_DOWNLOAD
+#undef CONFIG_G_DNL_MANUFACTURER
+#undef CONFIG_G_DNL_VENDOR_NUM
+#undef CONFIG_G_DNL_PRODUCT_NUM
+#endif
+
 /*
  * Default to using SPI for environment, etc.  We have multiple

copies
* of SPL as the ROM will check these locations.

include/configs/smartweb.h +9 -0
index 0352379..f2e9b90 100644
@@ -181,6 +181,15 @@
 #define CONFIG_SYS_CACHELINE_SIZE    0x2000
 #endif
 
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_USB_GADGET
+#undef CONFIG_USB_GADGET_VBUS_DRAW
+#undef CONFIG_USB_GADGET_DOWNLOAD
+#undef CONFIG_G_DNL_MANUFACTURER
+#undef CONFIG_G_DNL_VENDOR_NUM
+#undef CONFIG_G_DNL_PRODUCT_NUM
+#endif
+
 /* General Boot Parameter */
 #define CONFIG_BOOTDELAY             3
 #define CONFIG_BOOTCOMMAND           "run flashboot"
(quoted diff) +0 -0

b/include/configs/tegra-common-usb-gadget.h index 18851ca..1d6b99e 100644 --- a/include/configs/tegra-common-usb-gadget.h +++ b/include/configs/tegra-common-usb-gadget.h

include/configs/tegra-common-usb-gadget.h +2 -0
@@ -28,4 +28,15 @@
 #define CONFIG_DFU_RAM
 #endif
 
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_CI_UDC

include/configs/tegra-common-usb-gadget.h line 42

Quoted 10 lines
include/configs/tegra-common-usb-gadget.h +9 -0
+#undef CONFIG_USB_GADGET
+#undef CONFIG_USB_GADGET_VBUS_DRAW
+#undef CONFIG_USB_GADGET_DUALSPEED
+#undef CONFIG_USB_GADGET_DOWNLOAD
+#undef CONFIG_G_DNL_MANUFACTURER
+#undef CONFIG_G_DNL_VENDOR_NUM
+#undef CONFIG_G_DNL_PRODUCT_NUM
+#endif
+
 #endif /* _TEGRA_COMMON_USB_GADGET_H_ */

--
Best regards,

Lukasz Majewski

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

#3 lore raw

PATCH 1/1 usb: gadget: Disable gadget options in SPL

In reply to Sam Protsenko
Quoted 4 lines · Sam Protsenko

During Kconfig migrating process we missed to check some gadget options for SPL_BUILD. Do it now to properly disable gadget in SPL build for those platforms that disabled it before migrating options to Kconfig.

Quoted 8 lines
---
 include/configs/am43xx_evm.h              |  1 +
 include/configs/mx6sabre_common.h         | 11 +++++++++++
 include/configs/siemens-am33x-common.h    | 10 ++++++++++
 include/configs/smartweb.h                |  9 +++++++++
 include/configs/tegra-common-usb-gadget.h | 11 +++++++++++
 5 files changed, 42 insertions(+)

I don't quite understand why we need to do this. For SPL, if we build stuff we don't need it will get discarded at link time.

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/20160418/12ffe548/attachment.sig>
#4 lore raw

PATCH 1/1 usb: gadget: Disable gadget options in SPL

Quoted 15 lines · Tom Rini
Quoted 4 lines · Sam Protsenko

During Kconfig migrating process we missed to check some gadget options for SPL_BUILD. Do it now to properly disable gadget in SPL build for those platforms that disabled it before migrating options to Kconfig.

Quoted 8 lines
---
 include/configs/am43xx_evm.h              |  1 +
 include/configs/mx6sabre_common.h         | 11 +++++++++++
 include/configs/siemens-am33x-common.h    | 10 ++++++++++
 include/configs/smartweb.h                |  9 +++++++++
 include/configs/tegra-common-usb-gadget.h | 11 +++++++++++
 5 files changed, 42 insertions(+)
Quoted 3 lines

I don't quite understand why we need to do this. For SPL, if we build stuff we don't need it will get discarded at link time.

Didn't know that. Strange, why did we have those #ifdef CONFIG_SPL_BUILD in the first place. Anyway, I think we can drop this patch then. Thanks for explanation, Tom.

Quoted 2 lines

--
Tom