diff mbox series

[v10,21/25] Kconfig: fix undefined symbols (g_dnl*) when NET_LWIP is default enabled

Message ID 9462e25d33d93c670a882e6ee329ca7e6668d7ab.1725625913.git.jerome.forissier@linaro.org
State New
Headers show
Series Introduce the lwIP network stack | expand

Commit Message

Jérôme Forissier Sept. 6, 2024, 12:33 p.m. UTC
Fix for link errors on am62px_evm_a53and other platforms when NET_LWIP
is enabled:

 common/dfu.c:34:(.text.run_usb_dnl_gadget+0x68): undefined reference to `g_dnl_clear_detach
 [...]
 common/spl/spl_dfu.c:29:(.text.spl_dfu_cmd+0xb0): undefined reference to `run_usb_dnl_gadget'

- DFU_OVER_USB compiles common/dfu.c which calls g_dnl_clear_detach()
which is implemented in drivers/usb/gadget/g_dnl.c which needs
USB_GADGET_DOWNLOAD
- SPL_DFU compiles common/spl/spl_dfu.c which calls run_usb_dnl_gadget()
which is implemented in common/dfu.c which needs DFU_OVER_USB

Therefore add these dependencies to Kconfig.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
---
 drivers/dfu/Kconfig        | 1 +
 drivers/usb/gadget/Kconfig | 1 +
 2 files changed, 2 insertions(+)

Comments

Tom Rini Sept. 9, 2024, 2:32 p.m. UTC | #1
On Fri, Sep 06, 2024 at 02:33:37PM +0200, Jerome Forissier wrote:

> Fix for link errors on am62px_evm_a53and other platforms when NET_LWIP
> is enabled:
> 
>  common/dfu.c:34:(.text.run_usb_dnl_gadget+0x68): undefined reference to `g_dnl_clear_detach
>  [...]
>  common/spl/spl_dfu.c:29:(.text.spl_dfu_cmd+0xb0): undefined reference to `run_usb_dnl_gadget'
> 
> - DFU_OVER_USB compiles common/dfu.c which calls g_dnl_clear_detach()
> which is implemented in drivers/usb/gadget/g_dnl.c which needs
> USB_GADGET_DOWNLOAD
> - SPL_DFU compiles common/spl/spl_dfu.c which calls run_usb_dnl_gadget()
> which is implemented in common/dfu.c which needs DFU_OVER_USB
> 
> Therefore add these dependencies to Kconfig.
> 
> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>

Reviewed-by: Tom Rini <trini@konsulko.com>
Marek Vasut Sept. 9, 2024, 2:35 p.m. UTC | #2
On 9/6/24 2:33 PM, Jerome Forissier wrote:
> Fix for link errors on am62px_evm_a53and other platforms when NET_LWIP
> is enabled:
> 
>   common/dfu.c:34:(.text.run_usb_dnl_gadget+0x68): undefined reference to `g_dnl_clear_detach
>   [...]
>   common/spl/spl_dfu.c:29:(.text.spl_dfu_cmd+0xb0): undefined reference to `run_usb_dnl_gadget'
> 
> - DFU_OVER_USB compiles common/dfu.c which calls g_dnl_clear_detach()
> which is implemented in drivers/usb/gadget/g_dnl.c which needs
> USB_GADGET_DOWNLOAD
> - SPL_DFU compiles common/spl/spl_dfu.c which calls run_usb_dnl_gadget()
> which is implemented in common/dfu.c which needs DFU_OVER_USB
> 
> Therefore add these dependencies to Kconfig.
> 
> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
> ---
>   drivers/dfu/Kconfig        | 1 +
>   drivers/usb/gadget/Kconfig | 1 +
>   2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig
> index d034b501360..7de629f103a 100644
> --- a/drivers/dfu/Kconfig
> +++ b/drivers/dfu/Kconfig
> @@ -8,6 +8,7 @@ config DFU_OVER_USB
>   	bool
>   	select HASH
>   	depends on USB_GADGET
> +	depends on USB_GADGET_DOWNLOAD

Is it necessary to 'depends' on both USB_GADGET and USB_GADGET_DOWNLOAD 
? The later should imply the former is already selected, no ?

>   config DFU_OVER_TFTP
>   	bool
> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
> index 03fe3bca197..ce9364c3172 100644
> --- a/drivers/usb/gadget/Kconfig
> +++ b/drivers/usb/gadget/Kconfig
> @@ -324,6 +324,7 @@ config SPL_DFU
>   	select SPL_HASH
>   	select SPL_DFU_NO_RESET
>   	depends on SPL_RAM_SUPPORT
> +	depends on DFU_OVER_USB
Keep the list sorted please.
Jérôme Forissier Sept. 10, 2024, 9:50 a.m. UTC | #3
On 9/9/24 16:35, Marek Vasut wrote:
> On 9/6/24 2:33 PM, Jerome Forissier wrote:
>> Fix for link errors on am62px_evm_a53and other platforms when NET_LWIP
>> is enabled:
>>
>>   common/dfu.c:34:(.text.run_usb_dnl_gadget+0x68): undefined reference to `g_dnl_clear_detach
>>   [...]
>>   common/spl/spl_dfu.c:29:(.text.spl_dfu_cmd+0xb0): undefined reference to `run_usb_dnl_gadget'
>>
>> - DFU_OVER_USB compiles common/dfu.c which calls g_dnl_clear_detach()
>> which is implemented in drivers/usb/gadget/g_dnl.c which needs
>> USB_GADGET_DOWNLOAD
>> - SPL_DFU compiles common/spl/spl_dfu.c which calls run_usb_dnl_gadget()
>> which is implemented in common/dfu.c which needs DFU_OVER_USB
>>
>> Therefore add these dependencies to Kconfig.
>>
>> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
>> ---
>>   drivers/dfu/Kconfig        | 1 +
>>   drivers/usb/gadget/Kconfig | 1 +
>>   2 files changed, 2 insertions(+)
>>
>> diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig
>> index d034b501360..7de629f103a 100644
>> --- a/drivers/dfu/Kconfig
>> +++ b/drivers/dfu/Kconfig
>> @@ -8,6 +8,7 @@ config DFU_OVER_USB
>>       bool
>>       select HASH
>>       depends on USB_GADGET
>> +    depends on USB_GADGET_DOWNLOAD
> 
> Is it necessary to 'depends' on both USB_GADGET and USB_GADGET_DOWNLOAD ? The later should imply the former is already selected, no ?

Yes, it looks like so. Will fix.

> 
>>   config DFU_OVER_TFTP
>>       bool
>> diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
>> index 03fe3bca197..ce9364c3172 100644
>> --- a/drivers/usb/gadget/Kconfig
>> +++ b/drivers/usb/gadget/Kconfig
>> @@ -324,6 +324,7 @@ config SPL_DFU
>>       select SPL_HASH
>>       select SPL_DFU_NO_RESET
>>       depends on SPL_RAM_SUPPORT
>> +    depends on DFU_OVER_USB
> Keep the list sorted please.

Sure.

I will post this one separately as I did for other fixes. Thanks for
the review.
diff mbox series

Patch

diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig
index d034b501360..7de629f103a 100644
--- a/drivers/dfu/Kconfig
+++ b/drivers/dfu/Kconfig
@@ -8,6 +8,7 @@  config DFU_OVER_USB
 	bool
 	select HASH
 	depends on USB_GADGET
+	depends on USB_GADGET_DOWNLOAD
 
 config DFU_OVER_TFTP
 	bool
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 03fe3bca197..ce9364c3172 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -324,6 +324,7 @@  config SPL_DFU
 	select SPL_HASH
 	select SPL_DFU_NO_RESET
 	depends on SPL_RAM_SUPPORT
+	depends on DFU_OVER_USB
 	help
 	  This feature enables the DFU (Device Firmware Upgrade) in SPL with
 	  RAM memory device support. The ROM code will load and execute