tc_bl2_measured_boot.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (c) 2022-2024, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <stdint.h>
  7. #include <drivers/arm/rse_comms.h>
  8. #include <drivers/measured_boot/metadata.h>
  9. #include <drivers/measured_boot/rse/rse_measured_boot.h>
  10. #include <tools_share/tbbr_oid.h>
  11. #include <plat/common/common_def.h>
  12. #include <platform_def.h>
  13. /* TC specific table with image IDs and metadata. Intentionally not a
  14. * const struct, some members might set by bootloaders during trusted boot.
  15. */
  16. struct rse_mboot_metadata tc_rse_mboot_metadata[] = {
  17. {
  18. .id = BL31_IMAGE_ID,
  19. .slot = U(9),
  20. .signer_id_size = SIGNER_ID_MIN_SIZE,
  21. .sw_type = MBOOT_BL31_IMAGE_STRING,
  22. .pk_oid = BL31_IMAGE_KEY_OID,
  23. .lock_measurement = true },
  24. {
  25. .id = HW_CONFIG_ID,
  26. .slot = U(10),
  27. .signer_id_size = SIGNER_ID_MIN_SIZE,
  28. .sw_type = MBOOT_HW_CONFIG_STRING,
  29. .pk_oid = HW_CONFIG_KEY_OID,
  30. .lock_measurement = true },
  31. {
  32. .id = SOC_FW_CONFIG_ID,
  33. .slot = U(11),
  34. .signer_id_size = SIGNER_ID_MIN_SIZE,
  35. .sw_type = MBOOT_SOC_FW_CONFIG_STRING,
  36. .pk_oid = SOC_FW_CONFIG_KEY_OID,
  37. .lock_measurement = true },
  38. {
  39. .id = SCP_BL2_IMAGE_ID,
  40. .slot = U(12),
  41. .signer_id_size = SIGNER_ID_MIN_SIZE,
  42. .sw_type = MBOOT_SCP_BL2_IMAGE_STRING,
  43. .pk_oid = SCP_BL2_IMAGE_KEY_OID,
  44. .lock_measurement = true },
  45. {
  46. .id = RSE_MBOOT_INVALID_ID }
  47. };
  48. void bl2_plat_mboot_init(void)
  49. {
  50. /* Initialize the communication channel between AP and RSE */
  51. (void)rse_comms_init(PLAT_RSE_AP_SND_MHU_BASE,
  52. PLAT_RSE_AP_RCV_MHU_BASE);
  53. rse_measured_boot_init(tc_rse_mboot_metadata);
  54. }
  55. void bl2_plat_mboot_finish(void)
  56. {
  57. /* Nothing to do. */
  58. }