[U-Boot] [PATCH] usb: gadget: Disable gadget options in SPL

Sam Protsenko semen.protsenko at linaro.org
Mon Apr 18 19:22:55 CEST 2016


On Mon, Apr 18, 2016 at 1:59 PM, Lukasz Majewski <l.majewski at 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 at 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


More information about the U-Boot mailing list