aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSughosh Ganu2022-10-21 18:15:59 +0530
committerTom Rini2022-10-31 14:47:32 -0400
commit7d6e2c54b7dd057f50bf0116c9e803e214dbe74c (patch)
tree3fe4cd167400939991274f5fa70c80661580bf79 /include
parentd70c4a0a20c3edba3375f51426da2aa7096f58df (diff)
FWU: Add helper functions for accessing FWU metadata
Add weak functions for getting the update index value and dfu alternate number needed for FWU Multi Bank update functionality. The current implementation for getting the update index value is for platforms with 2 banks. If a platform supports more than 2 banks, it can implement it's own function. The function to get the dfu alternate number has been added for platforms with GPT partitioned storage devices. Platforms with other storage partition scheme need to implement their own function. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/fwu.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/fwu.h b/include/fwu.h
index ce99c026185..5391af99f51 100644
--- a/include/fwu.h
+++ b/include/fwu.h
@@ -312,4 +312,33 @@ int fwu_accept_image(efi_guid_t *img_type_id, u32 bank);
*/
int fwu_clear_accept_image(efi_guid_t *img_type_id, u32 bank);
+/**
+ * fwu_plat_get_alt_num() - Get the DFU Alt Num for the image from the platform
+ * @dev: FWU device
+ * @image_guid: Image GUID for which DFU alt number needs to be retrieved
+ * @alt_num: Pointer to the alt_num
+ *
+ * Get the DFU alt number from the platform for the image specified by the
+ * image GUID.
+ *
+ * Return: 0 if OK, -ve on error
+ *
+ */
+int fwu_plat_get_alt_num(struct udevice *dev, efi_guid_t *image_guid,
+ u8 *alt_num);
+
+/**
+ * fwu_plat_get_update_index() - Get the value of the update bank
+ * @update_idx: Bank number to which images are to be updated
+ *
+ * Get the value of the bank(partition) to which the update needs to be
+ * made.
+ *
+ * Note: This is a weak function and platforms can override this with
+ * their own implementation for selection of the update bank.
+ *
+ * Return: 0 if OK, -ve on error
+ *
+ */
+int fwu_plat_get_update_index(uint *update_idx);
#endif /* _FWU_H_ */