aboutsummaryrefslogtreecommitdiff
path: root/include/fwu.h
diff options
context:
space:
mode:
authorSughosh Ganu2024-03-22 16:27:16 +0530
committerTom Rini2024-05-24 13:40:03 -0600
commitf42a61f57f69c9fac1e21cbfde3f40ebdadc518b (patch)
tree02906bb961b9537a9765dd301fea9e249442d6ed /include/fwu.h
parentd99127a69ebf65cd35c33896ea6f4b45b77b8c82 (diff)
drivers: fwu: add the size parameter to the metadata access API's
In version 2 of the metadata structure, the size of the structure cannot be determined statically at build time. The structure is now broken into the top level structure which contains a field indicating the total size of the structure. Add a size parameter to the metadata access API functions to indicate the number of bytes to be accessed. This is then used to either read the entire structure, or only the top level structure. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Tested-by: Michal Simek <michal.simek@amd.com>
Diffstat (limited to 'include/fwu.h')
-rw-r--r--include/fwu.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/fwu.h b/include/fwu.h
index eb5638f4f3a..1815bd0064c 100644
--- a/include/fwu.h
+++ b/include/fwu.h
@@ -32,20 +32,24 @@ struct fwu_mdata_ops {
* @dev: FWU metadata device
* @mdata: Output FWU mdata read
* @primary: If primary or secondary copy of metadata is to be read
+ * @size: Size in bytes of the metadata to be read
*
* Return: 0 if OK, -ve on error
*/
- int (*read_mdata)(struct udevice *dev, struct fwu_mdata *mdata, bool primary);
+ int (*read_mdata)(struct udevice *dev, struct fwu_mdata *mdata,
+ bool primary, uint32_t size);
/**
* write_mdata() - Write the given FWU metadata copy
* @dev: FWU metadata device
* @mdata: Copy of the FWU metadata to write
* @primary: If primary or secondary copy of metadata is to be written
+ * @size: Size in bytes of the metadata to be written
*
* Return: 0 if OK, -ve on error
*/
- int (*write_mdata)(struct udevice *dev, struct fwu_mdata *mdata, bool primary);
+ int (*write_mdata)(struct udevice *dev, struct fwu_mdata *mdata,
+ bool primary, uint32_t size);
};
#define FWU_MDATA_VERSION 0x1
@@ -80,12 +84,14 @@ struct fwu_mdata_ops {
/**
* fwu_read_mdata() - Wrapper around fwu_mdata_ops.read_mdata()
*/
-int fwu_read_mdata(struct udevice *dev, struct fwu_mdata *mdata, bool primary);
+int fwu_read_mdata(struct udevice *dev, struct fwu_mdata *mdata,
+ bool primary, uint32_t size);
/**
* fwu_write_mdata() - Wrapper around fwu_mdata_ops.write_mdata()
*/
-int fwu_write_mdata(struct udevice *dev, struct fwu_mdata *mdata, bool primary);
+int fwu_write_mdata(struct udevice *dev, struct fwu_mdata *mdata,
+ bool primary, uint32_t size);
/**
* fwu_get_mdata() - Read, verify and return the FWU metadata