[PATCH v3 06/20] fwu: metadata: add a version agnostic structure

Sughosh Ganu sughosh.ganu at linaro.org
Fri Mar 22 11:57:19 CET 2024


The FWU specification now has two versions of the FWU metadata
structure, and both are to be supported. Introduce a version agnostic
structure for storing information about the FWU updatable images. This
allows for a split of common version agnostic FWU code and version
specific code.

The version specific code is then responsible for arranging the data
as per the corresponding metadata structure before it gets written to
the metadata partitions.

Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
---
Changes since V2:
* New patch

 include/fwu.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/include/fwu.h b/include/fwu.h
index 6c4d218e13..e681e91027 100644
--- a/include/fwu.h
+++ b/include/fwu.h
@@ -8,6 +8,7 @@
 
 #include <blk.h>
 #include <efi.h>
+#include <fwu_mdata.h>
 #include <mtd.h>
 #include <uuid.h>
 
@@ -35,6 +36,23 @@ struct fwu_mdata_mtd_priv {
 	struct fwu_mtd_image_info *fwu_mtd_images;
 };
 
+struct fwu_data {
+	uint32_t crc32;
+	uint32_t version;
+	uint32_t active_index;
+	uint32_t previous_active_index;
+	uint32_t metadata_size;
+	uint32_t boot_index;
+	uint32_t num_banks;
+	uint32_t num_images;
+	uint8_t  bank_state[4];
+	bool     trial_state;
+
+	struct fwu_mdata *fwu_mdata;
+
+	struct fwu_image_entry fwu_images[CONFIG_FWU_NUM_IMAGES_PER_BANK];
+};
+
 struct fwu_mdata_ops {
 	/**
 	 * read_mdata() - Populate the asked FWU metadata copy
-- 
2.34.1



More information about the U-Boot mailing list