All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dfu: fix Kconfig dependencies
@ 2024-09-10 10:27 Jerome Forissier
  2024-09-10 10:48 ` Marek Vasut
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jerome Forissier @ 2024-09-10 10:27 UTC (permalink / raw)
  To: u-boot
  Cc: Ilias Apalodimas, Jerome Forissier, Lukasz Majewski,
	Mattijs Korpershoek, Tom Rini, Marek Vasut, Heinrich Schuchardt,
	Jaehoon Chung, Jonas Karlman, Miquel Raynal

Fix link errors caused by missing Kconfig dependencies:

1. 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. Test case:

 $ printf "CONFIG_USB_GADGET_DOWNLOAD=n\nCONFIG_USB_FUNCTION_FASTBOOT=n" \
       >>configs/am62px_evm_a53_defconfig
 $ make am62px_evm_a53_defconfig
 $ make CROSS_COMPILE=aarch64-linux-gnu-
 [...]
 common/dfu.c:34:(.text.run_usb_dnl_gadget+0x68): undefined reference to `g_dnl_clear_detach
 [...]

2. With the above fixed, the same build causes:

 common/spl/spl_dfu.c:29:(.text.spl_dfu_cmd+0xb0): undefined reference to `run_usb_dnl_gadget'

This is because 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        | 2 +-
 drivers/usb/gadget/Kconfig | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig
index d034b501360..604386bb734 100644
--- a/drivers/dfu/Kconfig
+++ b/drivers/dfu/Kconfig
@@ -7,7 +7,7 @@ config DFU
 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..9921d3e0a77 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -323,6 +323,7 @@ config SPL_DFU
 	bool "Support DFU (Device Firmware Upgrade) in SPL"
 	select SPL_HASH
 	select SPL_DFU_NO_RESET
+	depends on DFU_OVER_USB
 	depends on SPL_RAM_SUPPORT
 	help
 	  This feature enables the DFU (Device Firmware Upgrade) in SPL with
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] dfu: fix Kconfig dependencies
  2024-09-10 10:27 [PATCH] dfu: fix Kconfig dependencies Jerome Forissier
@ 2024-09-10 10:48 ` Marek Vasut
  2024-09-10 13:19 ` Mattijs Korpershoek
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2024-09-10 10:48 UTC (permalink / raw)
  To: Jerome Forissier, u-boot
  Cc: Ilias Apalodimas, Lukasz Majewski, Mattijs Korpershoek, Tom Rini,
	Heinrich Schuchardt, Jaehoon Chung, Jonas Karlman, Miquel Raynal

On 9/10/24 12:27 PM, Jerome Forissier wrote:
> Fix link errors caused by missing Kconfig dependencies:
> 
> 1. 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. Test case:
> 
>   $ printf "CONFIG_USB_GADGET_DOWNLOAD=n\nCONFIG_USB_FUNCTION_FASTBOOT=n" \
>         >>configs/am62px_evm_a53_defconfig
>   $ make am62px_evm_a53_defconfig
>   $ make CROSS_COMPILE=aarch64-linux-gnu-
>   [...]
>   common/dfu.c:34:(.text.run_usb_dnl_gadget+0x68): undefined reference to `g_dnl_clear_detach
>   [...]
> 
> 2. With the above fixed, the same build causes:
> 
>   common/spl/spl_dfu.c:29:(.text.spl_dfu_cmd+0xb0): undefined reference to `run_usb_dnl_gadget'
> 
> This is because 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.
Reviewed-by: Marek Vasut <marex@denx.de>

Thanks !

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dfu: fix Kconfig dependencies
  2024-09-10 10:27 [PATCH] dfu: fix Kconfig dependencies Jerome Forissier
  2024-09-10 10:48 ` Marek Vasut
@ 2024-09-10 13:19 ` Mattijs Korpershoek
  2024-09-10 13:55 ` Ilias Apalodimas
  2024-09-13 15:42 ` Mattijs Korpershoek
  3 siblings, 0 replies; 5+ messages in thread
From: Mattijs Korpershoek @ 2024-09-10 13:19 UTC (permalink / raw)
  To: Jerome Forissier, u-boot
  Cc: Ilias Apalodimas, Jerome Forissier, Lukasz Majewski, Tom Rini,
	Marek Vasut, Heinrich Schuchardt, Jaehoon Chung, Jonas Karlman,
	Miquel Raynal

Hi Jerome,

Thank you for the patch.

On mar., sept. 10, 2024 at 12:27, Jerome Forissier <jerome.forissier@linaro.org> wrote:

> Fix link errors caused by missing Kconfig dependencies:
>
> 1. 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. Test case:
>
>  $ printf "CONFIG_USB_GADGET_DOWNLOAD=n\nCONFIG_USB_FUNCTION_FASTBOOT=n" \
>        >>configs/am62px_evm_a53_defconfig
>  $ make am62px_evm_a53_defconfig
>  $ make CROSS_COMPILE=aarch64-linux-gnu-
>  [...]
>  common/dfu.c:34:(.text.run_usb_dnl_gadget+0x68): undefined reference to `g_dnl_clear_detach
>  [...]
>
> 2. With the above fixed, the same build causes:
>
>  common/spl/spl_dfu.c:29:(.text.spl_dfu_cmd+0xb0): undefined reference to `run_usb_dnl_gadget'
>
> This is because 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: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
>  drivers/dfu/Kconfig        | 2 +-
>  drivers/usb/gadget/Kconfig | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig
> index d034b501360..604386bb734 100644
> --- a/drivers/dfu/Kconfig
> +++ b/drivers/dfu/Kconfig
> @@ -7,7 +7,7 @@ config DFU
>  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..9921d3e0a77 100644
> --- a/drivers/usb/gadget/Kconfig
> +++ b/drivers/usb/gadget/Kconfig
> @@ -323,6 +323,7 @@ config SPL_DFU
>  	bool "Support DFU (Device Firmware Upgrade) in SPL"
>  	select SPL_HASH
>  	select SPL_DFU_NO_RESET
> +	depends on DFU_OVER_USB
>  	depends on SPL_RAM_SUPPORT
>  	help
>  	  This feature enables the DFU (Device Firmware Upgrade) in SPL with
> -- 
> 2.40.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dfu: fix Kconfig dependencies
  2024-09-10 10:27 [PATCH] dfu: fix Kconfig dependencies Jerome Forissier
  2024-09-10 10:48 ` Marek Vasut
  2024-09-10 13:19 ` Mattijs Korpershoek
@ 2024-09-10 13:55 ` Ilias Apalodimas
  2024-09-13 15:42 ` Mattijs Korpershoek
  3 siblings, 0 replies; 5+ messages in thread
From: Ilias Apalodimas @ 2024-09-10 13:55 UTC (permalink / raw)
  To: Jerome Forissier
  Cc: u-boot, Lukasz Majewski, Mattijs Korpershoek, Tom Rini,
	Marek Vasut, Heinrich Schuchardt, Jaehoon Chung, Jonas Karlman,
	Miquel Raynal

On Tue, 10 Sept 2024 at 13:28, Jerome Forissier
<jerome.forissier@linaro.org> wrote:
>
> Fix link errors caused by missing Kconfig dependencies:
>
> 1. 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. Test case:
>
>  $ printf "CONFIG_USB_GADGET_DOWNLOAD=n\nCONFIG_USB_FUNCTION_FASTBOOT=n" \
>        >>configs/am62px_evm_a53_defconfig
>  $ make am62px_evm_a53_defconfig
>  $ make CROSS_COMPILE=aarch64-linux-gnu-
>  [...]
>  common/dfu.c:34:(.text.run_usb_dnl_gadget+0x68): undefined reference to `g_dnl_clear_detach
>  [...]
>
> 2. With the above fixed, the same build causes:
>
>  common/spl/spl_dfu.c:29:(.text.spl_dfu_cmd+0xb0): undefined reference to `run_usb_dnl_gadget'
>
> This is because 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        | 2 +-
>  drivers/usb/gadget/Kconfig | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig
> index d034b501360..604386bb734 100644
> --- a/drivers/dfu/Kconfig
> +++ b/drivers/dfu/Kconfig
> @@ -7,7 +7,7 @@ config DFU
>  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..9921d3e0a77 100644
> --- a/drivers/usb/gadget/Kconfig
> +++ b/drivers/usb/gadget/Kconfig
> @@ -323,6 +323,7 @@ config SPL_DFU
>         bool "Support DFU (Device Firmware Upgrade) in SPL"
>         select SPL_HASH
>         select SPL_DFU_NO_RESET
> +       depends on DFU_OVER_USB
>         depends on SPL_RAM_SUPPORT
>         help
>           This feature enables the DFU (Device Firmware Upgrade) in SPL with
> --
> 2.40.1
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] dfu: fix Kconfig dependencies
  2024-09-10 10:27 [PATCH] dfu: fix Kconfig dependencies Jerome Forissier
                   ` (2 preceding siblings ...)
  2024-09-10 13:55 ` Ilias Apalodimas
@ 2024-09-13 15:42 ` Mattijs Korpershoek
  3 siblings, 0 replies; 5+ messages in thread
From: Mattijs Korpershoek @ 2024-09-13 15:42 UTC (permalink / raw)
  To: u-boot, Jerome Forissier
  Cc: Ilias Apalodimas, Lukasz Majewski, Tom Rini, Marek Vasut,
	Heinrich Schuchardt, Jaehoon Chung, Jonas Karlman, Miquel Raynal

Hi,

On Tue, 10 Sep 2024 12:27:50 +0200, Jerome Forissier wrote:
> Fix link errors caused by missing Kconfig dependencies:
> 
> 1. 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. Test case:
> 
>  $ printf "CONFIG_USB_GADGET_DOWNLOAD=n\nCONFIG_USB_FUNCTION_FASTBOOT=n" \
>        >>configs/am62px_evm_a53_defconfig
>  $ make am62px_evm_a53_defconfig
>  $ make CROSS_COMPILE=aarch64-linux-gnu-
>  [...]
>  common/dfu.c:34:(.text.run_usb_dnl_gadget+0x68): undefined reference to `g_dnl_clear_detach
>  [...]
> 
> [...]

Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-dfu (u-boot-dfu)

[1/1] dfu: fix Kconfig dependencies
      https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/2f9c472dd7a91bc2d6e7840a550edcd257ff8b57

--
Mattijs

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-09-13 15:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-10 10:27 [PATCH] dfu: fix Kconfig dependencies Jerome Forissier
2024-09-10 10:48 ` Marek Vasut
2024-09-10 13:19 ` Mattijs Korpershoek
2024-09-10 13:55 ` Ilias Apalodimas
2024-09-13 15:42 ` Mattijs Korpershoek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.