trp_private.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef TRP_PRIVATE_H
  7. #define TRP_PRIVATE_H
  8. #include <services/rmmd_svc.h>
  9. #include <trp_helpers.h>
  10. /* Definitions for RMM-EL3 Interface ABI VERSION */
  11. #define TRP_RMM_EL3_ABI_VERS_MAJOR RMM_EL3_IFC_VERSION_MAJOR
  12. #define TRP_RMM_EL3_ABI_VERS_MINOR RMM_EL3_IFC_VERSION_MINOR
  13. #define TRP_RMM_EL3_ABI_VERS (((TRP_RMM_EL3_ABI_VERS_MAJOR & 0x7FFF) << 16) | \
  14. (TRP_RMM_EL3_ABI_VERS_MINOR & 0xFFFF))
  15. #define TRP_PLATFORM_CORE_COUNT PLATFORM_CORE_COUNT
  16. #ifndef __ASSEMBLER__
  17. #include <stdint.h>
  18. #define write_trp_arg(args, offset, val) (((args)->regs[offset >> 3]) \
  19. = val)
  20. /* RMI SMC64 FIDs handled by the TRP */
  21. #define RMI_RMM_REQ_VERSION SMC64_RMI_FID(U(0))
  22. #define RMI_RMM_GRANULE_DELEGATE SMC64_RMI_FID(U(1))
  23. #define RMI_RMM_GRANULE_UNDELEGATE SMC64_RMI_FID(U(2))
  24. /* Definitions for RMI VERSION */
  25. #define RMI_ABI_VERSION_MAJOR U(0x0)
  26. #define RMI_ABI_VERSION_MINOR U(0x0)
  27. #define RMI_ABI_VERSION (((RMI_ABI_VERSION_MAJOR & 0x7FFF) \
  28. << 16) | \
  29. (RMI_ABI_VERSION_MINOR & 0xFFFF))
  30. #define TRP_RMM_EL3_VERSION_GET_MAJOR(x) \
  31. RMM_EL3_IFC_VERSION_GET_MAJOR((x))
  32. #define TRP_RMM_EL3_VERSION_GET_MINOR(x) \
  33. RMM_EL3_IFC_VERSION_GET_MAJOR_MINOR((x))
  34. /* Helper to issue SMC calls to BL31 */
  35. uint64_t trp_smc(trp_args_t *);
  36. /* The main function to executed only by Primary CPU */
  37. void trp_main(void);
  38. /* Setup TRP. Executed only by Primary CPU */
  39. void trp_setup(uint64_t x0,
  40. uint64_t x1,
  41. uint64_t x2,
  42. uint64_t x3);
  43. /* Validate arguments for warm boot only */
  44. int trp_validate_warmboot_args(uint64_t x0, uint64_t x1,
  45. uint64_t x2, uint64_t x3);
  46. #endif /* __ASSEMBLER__ */
  47. #endif /* TRP_PRIVATE_H */