fwu_mdata.h 2.1 KB

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