All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] usb: gadget: g_dnl.c: Drop unused includes
@ 2023-08-17 17:41 Tom Rini
  2023-08-17 17:41 ` [PATCH 2/4] fwu-mdata: Make FWU_MDATA_GPT_BLK depend on DFU Tom Rini
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tom Rini @ 2023-08-17 17:41 UTC (permalink / raw
  To: u-boot

We don't need <dfu.h> nor <thor.h> in this file, drop them.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 drivers/usb/gadget/g_dnl.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index afb7b74f3057..8423da377ca9 100644
--- a/drivers/usb/gadget/g_dnl.c
+++ b/drivers/usb/gadget/g_dnl.c
@@ -16,8 +16,6 @@
 
 #include <g_dnl.h>
 #include <usb_mass_storage.h>
-#include <dfu.h>
-#include <thor.h>
 
 #include <env_callback.h>
 
-- 
2.34.1


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

* [PATCH 2/4] fwu-mdata: Make FWU_MDATA_GPT_BLK depend on DFU
  2023-08-17 17:41 [PATCH 1/4] usb: gadget: g_dnl.c: Drop unused includes Tom Rini
@ 2023-08-17 17:41 ` Tom Rini
  2023-11-17 15:35   ` Heinrich Schuchardt
  2023-08-17 17:41 ` [PATCH 3/4] xilinx: zynqmp: Move dfu.h include to be with the code Tom Rini
  2023-08-17 17:41 ` [PATCH 4/4] ti: mach-k3: " Tom Rini
  2 siblings, 1 reply; 7+ messages in thread
From: Tom Rini @ 2023-08-17 17:41 UTC (permalink / raw
  To: u-boot
  Cc: Masami Hiramatsu, Jassi Brar, Sughosh Ganu, Ilias Apalodimas,
	Heinrich Schuchardt

The implementation of this option in lib/fwu_updates/fwu_gpt.c is wholly
dependent on DFU, so make that a requirement here.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
I'm honestly not sure how to best proceed here as
drivers/fwu-mdata/gpt_blk.c doesn't need DFU, but both files are
controlled by this single symbol.

Cc: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Cc: Jassi Brar <jaswinder.singh@linaro.org>
Cc: Sughosh Ganu <sughosh.ganu@linaro.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/fwu-mdata/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fwu-mdata/Kconfig b/drivers/fwu-mdata/Kconfig
index 42736a5e43b0..0bd5fef4abfa 100644
--- a/drivers/fwu-mdata/Kconfig
+++ b/drivers/fwu-mdata/Kconfig
@@ -15,7 +15,7 @@ config FWU_MDATA_GPT_BLK
 	bool "FWU Metadata access for GPT partitioned Block devices"
 	select PARTITION_TYPE_GUID
 	select PARTITION_UUIDS
-	depends on FWU_MDATA && BLK && EFI_PARTITION
+	depends on FWU_MDATA && BLK && EFI_PARTITION && DFU
 	help
 	  Enable support for accessing FWU Metadata on GPT partitioned
 	  block devices.
-- 
2.34.1


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

* [PATCH 3/4] xilinx: zynqmp: Move dfu.h include to be with the code
  2023-08-17 17:41 [PATCH 1/4] usb: gadget: g_dnl.c: Drop unused includes Tom Rini
  2023-08-17 17:41 ` [PATCH 2/4] fwu-mdata: Make FWU_MDATA_GPT_BLK depend on DFU Tom Rini
@ 2023-08-17 17:41 ` Tom Rini
  2023-08-21 11:59   ` Michal Simek
  2023-08-17 17:41 ` [PATCH 4/4] ti: mach-k3: " Tom Rini
  2 siblings, 1 reply; 7+ messages in thread
From: Tom Rini @ 2023-08-17 17:41 UTC (permalink / raw
  To: u-boot; +Cc: Michal Simek

Move where we include <dfu.h> to be guarded by a DFU-related Kconfig
option.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
This becomes an issue with
https://patchwork.ozlabs.org/project/uboot/patch/20220620111354.448512-1-jh80.chung@samsung.com/
applied as now we can't include <dfu.h> without CONFIG_DFU_NAME_MAX_SIZE
set (or we have a dummy value for ifndef).  Another option would be to
restructure the code to move the dfu code to another file, but I don't
know if that will make the rest of the real use cases here easier or
harder.

Cc: Michal Simek <michal.simek@amd.com>
---
 board/xilinx/zynqmp/zynqmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 309f24a5f43d..367c3c65a9dc 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -8,7 +8,6 @@
 #include <command.h>
 #include <cpu_func.h>
 #include <debug_uart.h>
-#include <dfu.h>
 #include <env.h>
 #include <env_internal.h>
 #include <init.h>
@@ -606,6 +605,7 @@ enum env_location env_get_location(enum env_operation op, int prio)
 }
 
 #if defined(CONFIG_SET_DFU_ALT_INFO)
+#include <dfu.h>
 
 #define DFU_ALT_BUF_LEN		SZ_1K
 
-- 
2.34.1


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

* [PATCH 4/4] ti: mach-k3: Move dfu.h include to be with the code
  2023-08-17 17:41 [PATCH 1/4] usb: gadget: g_dnl.c: Drop unused includes Tom Rini
  2023-08-17 17:41 ` [PATCH 2/4] fwu-mdata: Make FWU_MDATA_GPT_BLK depend on DFU Tom Rini
  2023-08-17 17:41 ` [PATCH 3/4] xilinx: zynqmp: Move dfu.h include to be with the code Tom Rini
@ 2023-08-17 17:41 ` Tom Rini
  2 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2023-08-17 17:41 UTC (permalink / raw
  To: u-boot

Move where we include <dfu.h> to be guarded by a DFU-related Kconfig
option.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
This becomes an issue with
https://patchwork.ozlabs.org/project/uboot/patch/20220620111354.448512-1-jh80.chung@samsung.com/
applied as now we can't include <dfu.h> without CONFIG_DFU_NAME_MAX_SIZE
set (or we have a dummy value for ifndef).
---
 arch/arm/mach-k3/sysfw-loader.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-k3/sysfw-loader.c b/arch/arm/mach-k3/sysfw-loader.c
index 9be2d9eaea26..a8edc4a92d11 100644
--- a/arch/arm/mach-k3/sysfw-loader.c
+++ b/arch/arm/mach-k3/sysfw-loader.c
@@ -18,7 +18,6 @@
 #include <linux/soc/ti/ti_sci_protocol.h>
 #include <g_dnl.h>
 #include <usb.h>
-#include <dfu.h>
 #include <dm/uclass-internal.h>
 #include <spi_flash.h>
 
@@ -297,6 +296,8 @@ static void k3_sysfw_configure_using_fit(void *fit,
 }
 
 #if CONFIG_IS_ENABLED(DFU)
+#include <dfu.h>
+
 static int k3_sysfw_dfu_download(void *addr)
 {
 	char dfu_str[50];
-- 
2.34.1


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

* Re: [PATCH 3/4] xilinx: zynqmp: Move dfu.h include to be with the code
  2023-08-17 17:41 ` [PATCH 3/4] xilinx: zynqmp: Move dfu.h include to be with the code Tom Rini
@ 2023-08-21 11:59   ` Michal Simek
  0 siblings, 0 replies; 7+ messages in thread
From: Michal Simek @ 2023-08-21 11:59 UTC (permalink / raw
  To: Tom Rini, u-boot



On 8/17/23 19:41, Tom Rini wrote:
> Move where we include <dfu.h> to be guarded by a DFU-related Kconfig
> option.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> This becomes an issue with
> https://patchwork.ozlabs.org/project/uboot/patch/20220620111354.448512-1-jh80.chung@samsung.com/
> applied as now we can't include <dfu.h> without CONFIG_DFU_NAME_MAX_SIZE
> set (or we have a dummy value for ifndef).  Another option would be to
> restructure the code to move the dfu code to another file, but I don't
> know if that will make the rest of the real use cases here easier or
> harder.
> 
> Cc: Michal Simek <michal.simek@amd.com>
> ---
>   board/xilinx/zynqmp/zynqmp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
> index 309f24a5f43d..367c3c65a9dc 100644
> --- a/board/xilinx/zynqmp/zynqmp.c
> +++ b/board/xilinx/zynqmp/zynqmp.c
> @@ -8,7 +8,6 @@
>   #include <command.h>
>   #include <cpu_func.h>
>   #include <debug_uart.h>
> -#include <dfu.h>
>   #include <env.h>
>   #include <env_internal.h>
>   #include <init.h>
> @@ -606,6 +605,7 @@ enum env_location env_get_location(enum env_operation op, int prio)
>   }
>   
>   #if defined(CONFIG_SET_DFU_ALT_INFO)
> +#include <dfu.h>
>   
>   #define DFU_ALT_BUF_LEN		SZ_1K
>   

Reviewed-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

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

* Re: [PATCH 2/4] fwu-mdata: Make FWU_MDATA_GPT_BLK depend on DFU
  2023-08-17 17:41 ` [PATCH 2/4] fwu-mdata: Make FWU_MDATA_GPT_BLK depend on DFU Tom Rini
@ 2023-11-17 15:35   ` Heinrich Schuchardt
  2023-11-17 15:47     ` Tom Rini
  0 siblings, 1 reply; 7+ messages in thread
From: Heinrich Schuchardt @ 2023-11-17 15:35 UTC (permalink / raw
  To: Tom Rini
  Cc: Masami Hiramatsu, Jassi Brar, Sughosh Ganu, Ilias Apalodimas,
	u-boot

On 8/17/23 19:41, Tom Rini wrote:
> The implementation of this option in lib/fwu_updates/fwu_gpt.c is wholly
> dependent on DFU, so make that a requirement here.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> I'm honestly not sure how to best proceed here as
> drivers/fwu-mdata/gpt_blk.c doesn't need DFU, but both files are
> controlled by this single symbol.
>
> Cc: Masami Hiramatsu <masami.hiramatsu@linaro.org>
> Cc: Jassi Brar <jaswinder.singh@linaro.org>
> Cc: Sughosh Ganu <sughosh.ganu@linaro.org>
> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>   drivers/fwu-mdata/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/fwu-mdata/Kconfig b/drivers/fwu-mdata/Kconfig
> index 42736a5e43b0..0bd5fef4abfa 100644
> --- a/drivers/fwu-mdata/Kconfig
> +++ b/drivers/fwu-mdata/Kconfig
> @@ -15,7 +15,7 @@ config FWU_MDATA_GPT_BLK
>   	bool "FWU Metadata access for GPT partitioned Block devices"
>   	select PARTITION_TYPE_GUID
>   	select PARTITION_UUIDS
> -	depends on FWU_MDATA && BLK && EFI_PARTITION
> +	depends on FWU_MDATA && BLK && EFI_PARTITION && DFU

Hello Tom,

This looks like the wrong level of configuration to add a DFU dependency.

EFI_CAPSULE_FIRMWARE_FIT and EFI_CAPSULE_FIRMWARE_RAW select DFU and
EFI_CAPSULE_FIRMWARE.

We probably should let CONFIG_FWU_MDATA depend on EFI_CAPSULE_ON_DISK.

Best regards

Heinrich

>   	help
>   	  Enable support for accessing FWU Metadata on GPT partitioned
>   	  block devices.


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

* Re: [PATCH 2/4] fwu-mdata: Make FWU_MDATA_GPT_BLK depend on DFU
  2023-11-17 15:35   ` Heinrich Schuchardt
@ 2023-11-17 15:47     ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2023-11-17 15:47 UTC (permalink / raw
  To: Heinrich Schuchardt
  Cc: Masami Hiramatsu, Jassi Brar, Sughosh Ganu, Ilias Apalodimas,
	u-boot

[-- Attachment #1: Type: text/plain, Size: 2223 bytes --]

On Fri, Nov 17, 2023 at 04:35:22PM +0100, Heinrich Schuchardt wrote:
> On 8/17/23 19:41, Tom Rini wrote:
> > The implementation of this option in lib/fwu_updates/fwu_gpt.c is wholly
> > dependent on DFU, so make that a requirement here.
> > 
> > Signed-off-by: Tom Rini <trini@konsulko.com>
> > ---
> > I'm honestly not sure how to best proceed here as
> > drivers/fwu-mdata/gpt_blk.c doesn't need DFU, but both files are
> > controlled by this single symbol.
> > 
> > Cc: Masami Hiramatsu <masami.hiramatsu@linaro.org>
> > Cc: Jassi Brar <jaswinder.singh@linaro.org>
> > Cc: Sughosh Ganu <sughosh.ganu@linaro.org>
> > Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> > Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> > ---
> >   drivers/fwu-mdata/Kconfig | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/fwu-mdata/Kconfig b/drivers/fwu-mdata/Kconfig
> > index 42736a5e43b0..0bd5fef4abfa 100644
> > --- a/drivers/fwu-mdata/Kconfig
> > +++ b/drivers/fwu-mdata/Kconfig
> > @@ -15,7 +15,7 @@ config FWU_MDATA_GPT_BLK
> >   	bool "FWU Metadata access for GPT partitioned Block devices"
> >   	select PARTITION_TYPE_GUID
> >   	select PARTITION_UUIDS
> > -	depends on FWU_MDATA && BLK && EFI_PARTITION
> > +	depends on FWU_MDATA && BLK && EFI_PARTITION && DFU
> 
> Hello Tom,
> 
> This looks like the wrong level of configuration to add a DFU dependency.
> 
> EFI_CAPSULE_FIRMWARE_FIT and EFI_CAPSULE_FIRMWARE_RAW select DFU and
> EFI_CAPSULE_FIRMWARE.
> 
> We probably should let CONFIG_FWU_MDATA depend on EFI_CAPSULE_ON_DISK.

OK, but that doesn't address the dependency? The code in
lib/fwu_updates/fwu_gpt.c needs DFU and is under FWU_MDATA_GPT_BLK. It
provides fwu_plat_get_alt_num() which is called by fwu_get_image_index()
and is under FWU_MULTI_BANK_UPDATE and in turn called by
efi_firmware_raw_set_image() which is under EFI_CAPSULE_FIRMWARE_RAW. If
both lib/fwu_updates/fwu_gpt.c and drivers/fwu-mdata/gpt_blk.c should be
under the same symbol then it needs to depend on DFU, since it's a
direct dependency in the code. We could change it up to
EFI_CAPSULE_FIRMWARE_RAW I guess, but I'm not sure that's cleaner.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

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

end of thread, other threads:[~2023-11-17 15:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17 17:41 [PATCH 1/4] usb: gadget: g_dnl.c: Drop unused includes Tom Rini
2023-08-17 17:41 ` [PATCH 2/4] fwu-mdata: Make FWU_MDATA_GPT_BLK depend on DFU Tom Rini
2023-11-17 15:35   ` Heinrich Schuchardt
2023-11-17 15:47     ` Tom Rini
2023-08-17 17:41 ` [PATCH 3/4] xilinx: zynqmp: Move dfu.h include to be with the code Tom Rini
2023-08-21 11:59   ` Michal Simek
2023-08-17 17:41 ` [PATCH 4/4] ti: mach-k3: " Tom Rini

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.