diff options
author | Sughosh Ganu <sughosh.ganu@linaro.org> | 2024-03-22 16:27:17 +0530 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-05-24 13:40:03 -0600 |
commit | e67c0b76d8e80856cd88256ef1d6ac5da904f503 (patch) | |
tree | 3d00aa9a3b344437c67c812a3fa610e660767e7f /include | |
parent | f42a61f57f69c9fac1e21cbfde3f40ebdadc518b (diff) | |
download | u-boot-e67c0b76d8e80856cd88256ef1d6ac5da904f503.tar.gz u-boot-e67c0b76d8e80856cd88256ef1d6ac5da904f503.tar.bz2 u-boot-e67c0b76d8e80856cd88256ef1d6ac5da904f503.zip |
drivers: fwu: mtd: allocate buffer for image info dynamically
The FWU metadata access driver for MTD partitioned devices currently
uses a statically allocated array for storing the updatable image
information. This array depends on the number of banks and images per
bank. With migration of the FWU metadata to version 2, these
parameters are now obtained at runtime from the metadata.
Make changes to the FWU metadata access driver for MTD devices to
allocate memory for the image information dynamically in the driver's
probe function, after having obtained the number of banks and images
per bank by reading the metadata. Move the image information as part
of the driver's private structure, instead of using a global variable.
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Tested-by: Michal Simek <michal.simek@amd.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/fwu.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/fwu.h b/include/fwu.h index 1815bd0064..6c4d218e13 100644 --- a/include/fwu.h +++ b/include/fwu.h @@ -26,6 +26,15 @@ struct fwu_mtd_image_info { char uuidbuf[UUID_STR_LEN + 1]; }; +struct fwu_mdata_mtd_priv { + struct mtd_info *mtd; + char pri_label[50]; + char sec_label[50]; + u32 pri_offset; + u32 sec_offset; + struct fwu_mtd_image_info *fwu_mtd_images; +}; + struct fwu_mdata_ops { /** * read_mdata() - Populate the asked FWU metadata copy |