fwu_metadata.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (c) 2021, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. * FWU metadata information as per the specification section 4.1:
  7. * https://developer.arm.com/documentation/den0118/a/
  8. *
  9. */
  10. #ifndef FWU_METADATA_H
  11. #define FWU_METADATA_H
  12. #include <stdint.h>
  13. #include <tools_share/uuid.h>
  14. /* Properties of image in a bank */
  15. struct fwu_image_properties {
  16. /* UUID of the image in this bank */
  17. uuid_t img_uuid;
  18. /* [0]: bit describing the image acceptance status –
  19. * 1 means the image is accepted
  20. * [31:1]: MBZ
  21. */
  22. uint32_t accepted;
  23. /* reserved (MBZ) */
  24. uint32_t reserved;
  25. } __packed;
  26. /* Image entry information */
  27. struct fwu_image_entry {
  28. /* UUID identifying the image type */
  29. uuid_t img_type_uuid;
  30. /* UUID of the storage volume where the image is located */
  31. uuid_t location_uuid;
  32. /* Properties of images with img_type_uuid in the different FW banks */
  33. struct fwu_image_properties img_props[NR_OF_FW_BANKS];
  34. } __packed;
  35. /*
  36. * FWU metadata filled by the updater and consumed by TF-A for
  37. * various purposes as below:
  38. * 1. Get active FW bank.
  39. * 2. Rollback to previous working FW bank.
  40. * 3. Get properties of all images present in all banks.
  41. */
  42. struct fwu_metadata {
  43. /* Metadata CRC value */
  44. uint32_t crc_32;
  45. /* Metadata version */
  46. uint32_t version;
  47. /* Bank index with which device boots */
  48. uint32_t active_index;
  49. /* Previous bank index with which device booted successfully */
  50. uint32_t previous_active_index;
  51. /* Image entry information */
  52. struct fwu_image_entry img_entry[NR_OF_IMAGES_IN_FW_BANK];
  53. } __packed;
  54. #endif /* FWU_METADATA_H */