metadata.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2024, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef METADATA_H
  7. #define METADATA_H
  8. /* Minimum measurement value size that can be requested to store */
  9. #define MEASUREMENT_VALUE_MIN_SIZE 32U
  10. /* Maximum measurement value size that can be requested to store */
  11. #define MEASUREMENT_VALUE_MAX_SIZE 64U
  12. /* Minimum signer id size that can be requested to store */
  13. #define SIGNER_ID_MIN_SIZE MEASUREMENT_VALUE_MIN_SIZE
  14. /* Maximum signer id size that can be requested to store */
  15. #define SIGNER_ID_MAX_SIZE MEASUREMENT_VALUE_MAX_SIZE
  16. /* The theoretical maximum image version is: "255.255.65535\0" */
  17. #define VERSION_MAX_SIZE 14U
  18. /* Example sw_type: "BL_2, BL_33, etc." */
  19. #define SW_TYPE_MAX_SIZE 32U
  20. /*
  21. * Images, measured during the boot process, have some associated metadata.
  22. * One of these types of metadata is the image identifier strings. These macros
  23. * define these strings. They are used across the different measured boot
  24. * backends.
  25. * Note that these strings follow the standardization recommendations
  26. * defined in the Arm Server Base Security Guide (a.k.a. SBSG, Arm DEN 0086),
  27. * where applicable. They should not be changed in the code.
  28. * Where the SBSG does not make recommendations, we are free to choose any
  29. * naming convention.
  30. * The key thing is to choose meaningful strings so that when the measured boot
  31. * metadata is used in attestation, the different components can be identified.
  32. */
  33. #define MBOOT_BL2_IMAGE_STRING "BL_2"
  34. #define MBOOT_BL31_IMAGE_STRING "SECURE_RT_EL3"
  35. #if defined(SPD_opteed)
  36. #define MBOOT_BL32_IMAGE_STRING "SECURE_RT_EL1_OPTEE"
  37. #elif defined(SPD_tspd)
  38. #define MBOOT_BL32_IMAGE_STRING "SECURE_RT_EL1_TSPD"
  39. #elif defined(SPD_tlkd)
  40. #define MBOOT_BL32_IMAGE_STRING "SECURE_RT_EL1_TLKD"
  41. #elif defined(SPD_trusty)
  42. #define MBOOT_BL32_IMAGE_STRING "SECURE_RT_EL1_TRUSTY"
  43. #elif defined(SPD_spmd)
  44. #define MBOOT_BL32_IMAGE_STRING "SECURE_RT_EL1_SPMD"
  45. #else
  46. #define MBOOT_BL32_IMAGE_STRING "SECURE_RT_EL1_UNKNOWN"
  47. #endif /* SPD_opteed */
  48. #define MBOOT_BL32_EXTRA1_IMAGE_STRING "SECURE_RT_EL1_OPTEE_EXTRA1"
  49. #define MBOOT_BL32_EXTRA2_IMAGE_STRING "SECURE_RT_EL1_OPTEE_EXTRA2"
  50. #define MBOOT_BL33_IMAGE_STRING "BL_33"
  51. #define MBOOT_FW_CONFIG_STRING "FW_CONFIG"
  52. #define MBOOT_HW_CONFIG_STRING "HW_CONFIG"
  53. #define MBOOT_NT_FW_CONFIG_STRING "NT_FW_CONFIG"
  54. #define MBOOT_SCP_BL2_IMAGE_STRING "SYS_CTRL_2"
  55. #define MBOOT_SOC_FW_CONFIG_STRING "SOC_FW_CONFIG"
  56. #define MBOOT_STM32_STRING "STM32"
  57. #define MBOOT_TB_FW_CONFIG_STRING "TB_FW_CONFIG"
  58. #define MBOOT_TOS_FW_CONFIG_STRING "TOS_FW_CONFIG"
  59. #define MBOOT_RMM_IMAGE_STRING "RMM"
  60. #define MBOOT_SP1_STRING "SP1"
  61. #define MBOOT_SP2_STRING "SP2"
  62. #define MBOOT_SP3_STRING "SP3"
  63. #define MBOOT_SP4_STRING "SP4"
  64. #define MBOOT_SP5_STRING "SP5"
  65. #define MBOOT_SP6_STRING "SP6"
  66. #define MBOOT_SP7_STRING "SP7"
  67. #define MBOOT_SP8_STRING "SP8"
  68. #endif /* METADATA_H */