diff mbox

usb: gadget: Disable gadget options in SPL

Message ID 1460731256-8940-1-git-send-email-semen.protsenko@linaro.org
State New
Headers show

Commit Message

Sam Protsenko April 15, 2016, 2:40 p.m. UTC
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.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>

---
 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(+)

-- 
2.8.0.rc3

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Comments

Sam Protsenko April 18, 2016, 5:22 p.m. UTC | #1
On Mon, Apr 18, 2016 at 1:59 PM, Lukasz Majewski <l.majewski@samsung.com> wrote:
> Hi Sam,

>

>> 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.

>>

>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>

>> ---

>>  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(+)

>>

>> diff --git a/include/configs/am43xx_evm.h

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

>> --- a/include/configs/am43xx_evm.h

>> +++ b/include/configs/am43xx_evm.h

>> @@ -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

>> diff --git a/include/configs/mx6sabre_common.h

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

>> --- a/include/configs/mx6sabre_common.h

>> +++ b/include/configs/mx6sabre_common.h

>> @@ -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)

>

>> +#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.

>> +

>>  #endif                         /* __MX6QSABRE_COMMON_CONFIG_H */

>> diff --git a/include/configs/siemens-am33x-common.h

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

>> --- a/include/configs/siemens-am33x-common.h

>> +++ b/include/configs/siemens-am33x-common.h

>> @@ -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.

>> diff --git a/include/configs/smartweb.h b/include/configs/smartweb.h

>> index 0352379..f2e9b90 100644

>> --- a/include/configs/smartweb.h

>> +++ b/include/configs/smartweb.h

>> @@ -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"

>> diff --git a/include/configs/tegra-common-usb-gadget.h

>> 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

>> @@ -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_ */

>

>

>

> --

> Best regards,

>

> Lukasz Majewski

>

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

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Sam Protsenko April 19, 2016, 12:40 p.m. UTC | #2
On Mon, Apr 18, 2016 at 8:37 PM, Tom Rini <trini@konsulko.com> wrote:
> On Fri, Apr 15, 2016 at 05:40:56PM +0300, Sam Protsenko wrote:

>

>> 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.

>>

>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>

>> ---

>>  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.

>


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.

> --

> Tom

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
diff mbox

Patch

diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h
index 5d5ae5e..c8beacd 100644
--- a/include/configs/am43xx_evm.h
+++ b/include/configs/am43xx_evm.h
@@ -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
diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h
index 87bbf2e..5ca0fda 100644
--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -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 */
diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h
index 5b94fad..d11566e 100644
--- a/include/configs/siemens-am33x-common.h
+++ b/include/configs/siemens-am33x-common.h
@@ -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.
diff --git a/include/configs/smartweb.h b/include/configs/smartweb.h
index 0352379..f2e9b90 100644
--- a/include/configs/smartweb.h
+++ b/include/configs/smartweb.h
@@ -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"
diff --git a/include/configs/tegra-common-usb-gadget.h 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
@@ -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_ */