aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSughosh Ganu <sughosh.ganu@linaro.org>2024-03-22 16:27:26 +0530
committerTom Rini <trini@konsulko.com>2024-05-24 13:40:04 -0600
commit8ee8b9c900e350464ab2337ce0b0a7b2aa71f0f3 (patch)
tree0bbdbe0c2c4021790e1366c102f07f318b3c6b8b
parent1bef7198cd8f747ccd91cc103613afde96d4199f (diff)
downloadu-boot-8ee8b9c900e350464ab2337ce0b0a7b2aa71f0f3.zip
u-boot-8ee8b9c900e350464ab2337ce0b0a7b2aa71f0f3.tar.gz
u-boot-8ee8b9c900e350464ab2337ce0b0a7b2aa71f0f3.tar.bz2
fwu: mtd: obtain image information from version agnostic structure
Make changes to the functions used for generating the DFU's alt variable so that the FWU image information is obtained from the common version agnostic structure instead of reading the metadata. While here, also update the name of the field used for storing the image GUID in the FWU metadata. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
-rw-r--r--lib/fwu_updates/fwu_mtd.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/fwu_updates/fwu_mtd.c b/lib/fwu_updates/fwu_mtd.c
index f4e0e31..e8211dd 100644
--- a/lib/fwu_updates/fwu_mtd.c
+++ b/lib/fwu_updates/fwu_mtd.c
@@ -136,7 +136,7 @@ static int gen_image_alt_info(char *buf, size_t len,
/* Query a partition by image UUID */
bank = &img->img_bank_info[i];
- uuid_bin_to_str(bank->image_uuid.b, uuidbuf, UUID_STR_FORMAT_STD);
+ uuid_bin_to_str(bank->image_guid.b, uuidbuf, UUID_STR_FORMAT_STD);
mtd_img_info = mtd_img_by_uuid(uuidbuf);
if (!mtd_img_info) {
@@ -163,17 +163,13 @@ static int gen_image_alt_info(char *buf, size_t len,
int fwu_gen_alt_info_from_mtd(char *buf, size_t len, struct mtd_info *mtd)
{
- struct fwu_mdata mdata;
int i, l, ret;
-
- ret = fwu_get_mdata(&mdata);
- if (ret < 0) {
- log_err("Failed to get the FWU mdata.\n");
- return ret;
- }
+ struct fwu_data *data = fwu_get_data();
+ struct fwu_image_entry *img_entry;
for (i = 0; i < CONFIG_FWU_NUM_IMAGES_PER_BANK; i++) {
- ret = gen_image_alt_info(buf, len, &mdata.img_entry[i], mtd);
+ img_entry = &data->fwu_images[i];
+ ret = gen_image_alt_info(buf, len, img_entry, mtd);
if (ret)
break;