1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-26 13:01:17 +02:00

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>
This commit is contained in:
Sughosh Ganu
2022-10-21 18:15:59 +05:30
committed by Tom Rini
parent d70c4a0a20
commit 7d6e2c54b7
3 changed files with 179 additions and 0 deletions

View File

@@ -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_ */