Hi

On 6/21/22 11:34, Patrick DELAUNAY wrote:
Hi,

On 6/9/22 14:29, Sughosh Ganu wrote:
In the FWU Multi Bank Update feature, the information about the
updatable images is stored as part of the metadata, on a separate
partition. Add a driver for reading from and writing to the metadata
when the updatable images and the metadata are stored on a block
device which is formated with GPT based partition scheme.

Signed-off-by: Sughosh Ganu <sughosh.g...@linaro.org>
---
  drivers/fwu-mdata/Kconfig             |   9 +
  drivers/fwu-mdata/Makefile            |   1 +
  drivers/fwu-mdata/fwu_mdata_gpt_blk.c | 404 ++++++++++++++++++++++++++
  include/fwu.h                         |   2 +
  4 files changed, 416 insertions(+)
  create mode 100644 drivers/fwu-mdata/fwu_mdata_gpt_blk.c

diff --git a/drivers/fwu-mdata/Kconfig b/drivers/fwu-mdata/Kconfig
index d6a21c8e19..d5edef19d6 100644
--- a/drivers/fwu-mdata/Kconfig
+++ b/drivers/fwu-mdata/Kconfig
@@ -5,3 +5,12 @@ config DM_FWU_MDATA
        Enable support for accessing FWU Metadata partitions. The
        FWU Metadata partitions reside on the same storage device
        which contains the other FWU updatable firmware images.
+
+config FWU_MDATA_GPT_BLK
+    bool "FWU Metadata access for GPT partitioned Block devices"
+    select PARTITION_TYPE_GUID
+    select PARTITION_UUIDS
+    depends on DM && HAVE_BLOCK_DEVICE && EFI_PARTITION
+    help
+      Enable support for accessing FWU Metadata on GPT partitioned
+      block devices.
diff --git a/drivers/fwu-mdata/Makefile b/drivers/fwu-mdata/Makefile
index 7fec7171f4..12a5b4fe04 100644
--- a/drivers/fwu-mdata/Makefile
+++ b/drivers/fwu-mdata/Makefile
@@ -4,3 +4,4 @@
  #
    obj-$(CONFIG_DM_FWU_MDATA) += fwu-mdata-uclass.o
+obj-$(CONFIG_FWU_MDATA_GPT_BLK) += fwu_mdata_gpt_blk.o


It is strange to have '_' and '-' in file name for the same directory

=> to be coherent = fwu-mdata-gpt-blk.c


diff --git a/drivers/fwu-mdata/fwu_mdata_gpt_blk.c b/drivers/fwu-mdata/fwu_mdata_gpt_blk.c
new file mode 100644
index 0000000000..329bd3779b
--- /dev/null
+++ b/drivers/fwu-mdata/fwu_mdata_gpt_blk.c
@@ -0,0 +1,404 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2022, Linaro Limited
+ */


+ #define LOG_CATEGORY UCLASS_FWU_MDATA

For command log filtering by uclass

+#include <blk.h>
+#include <dm.h>
+#include <efi_loader.h>
+#include <fwu.h>
+#include <fwu_mdata.h>
+#include <log.h>
+#include <malloc.h>
+#include <memalign.h>
+#include <part.h>
+#include <part_efi.h>
+
[...]

Regards

Patrick

Reply via email to