Sughosh Ganu | 0f9399a | 2022-10-21 18:15:55 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | /* |
| 3 | * Copyright (c) 2022, Linaro Limited |
| 4 | */ |
| 5 | |
| 6 | #if !defined _FWU_MDATA_H_ |
| 7 | #define _FWU_MDATA_H_ |
| 8 | |
| 9 | #include <efi.h> |
| 10 | |
| 11 | /** |
| 12 | * struct fwu_image_bank_info - firmware image information |
| 13 | * @image_uuid: Guid value of the image in this bank |
| 14 | * @accepted: Acceptance status of the image |
| 15 | * @reserved: Reserved |
| 16 | * |
| 17 | * The structure contains image specific fields which are |
| 18 | * used to identify the image and to specify the image's |
| 19 | * acceptance status |
| 20 | */ |
| 21 | struct fwu_image_bank_info { |
| 22 | efi_guid_t image_uuid; |
| 23 | uint32_t accepted; |
| 24 | uint32_t reserved; |
| 25 | }; |
| 26 | |
| 27 | /** |
| 28 | * struct fwu_image_entry - information for a particular type of image |
| 29 | * @image_type_uuid: Guid value for identifying the image type |
| 30 | * @location_uuid: Guid of the storage volume where the image is located |
| 31 | * @img_bank_info: Array containing properties of images |
| 32 | * |
| 33 | * This structure contains information on various types of updatable |
| 34 | * firmware images. Each image type then contains an array of image |
| 35 | * information per bank. |
| 36 | */ |
| 37 | struct fwu_image_entry { |
| 38 | efi_guid_t image_type_uuid; |
| 39 | efi_guid_t location_uuid; |
| 40 | struct fwu_image_bank_info img_bank_info[CONFIG_FWU_NUM_BANKS]; |
| 41 | }; |
| 42 | |
| 43 | /** |
| 44 | * struct fwu_mdata - FWU metadata structure for multi-bank updates |
| 45 | * @crc32: crc32 value for the FWU metadata |
| 46 | * @version: FWU metadata version |
| 47 | * @active_index: Index of the bank currently used for booting images |
| 48 | * @previous_active_inde: Index of the bank used before the current bank |
| 49 | * being used for booting |
| 50 | * @img_entry: Array of information on various firmware images that can |
| 51 | * be updated |
| 52 | * |
| 53 | * This structure is used to store all the needed information for performing |
| 54 | * multi bank updates on the platform. This contains info on the bank being |
| 55 | * used to boot along with the information needed for identification of |
| 56 | * individual images |
| 57 | */ |
| 58 | struct fwu_mdata { |
| 59 | uint32_t crc32; |
| 60 | uint32_t version; |
| 61 | uint32_t active_index; |
| 62 | uint32_t previous_active_index; |
| 63 | |
| 64 | struct fwu_image_entry img_entry[CONFIG_FWU_NUM_IMAGES_PER_BANK]; |
| 65 | }; |
| 66 | |
| 67 | #endif /* _FWU_MDATA_H_ */ |