diff options
author | Jerome Forissier <jerome.forissier@linaro.org> | 2024-09-10 12:27:50 +0200 |
---|---|---|
committer | Mattijs Korpershoek <mkorpershoek@baylibre.com> | 2024-09-13 17:41:18 +0200 |
commit | 2f9c472dd7a91bc2d6e7840a550edcd257ff8b57 (patch) | |
tree | 228a33e099cdc1d2d44bd30eebe9d099d6288974 | |
parent | 5f044932413694475422d4b16607dfcf9aff8781 (diff) |
dfu: fix Kconfig dependencies
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: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Link: https://lore.kernel.org/r/20240910102751.3182982-1-jerome.forissier@linaro.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
-rw-r--r-- | drivers/dfu/Kconfig | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/Kconfig | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig index 971204758aa..aadd7e8cf7f 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 4621a6fd5e6..2634154f94a 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 |