qemu_sbsa_pas_def.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (c) 2024-2025, Linaro Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef QEMU_PAS_DEF_H
  7. #define QEMU_PAS_DEF_H
  8. #include <lib/gpt_rme/gpt_rme.h>
  9. #include "platform_def.h"
  10. /*****************************************************************************
  11. * PAS regions used to initialize the Granule Protection Table (GPT)
  12. ****************************************************************************/
  13. /* EL3 SRAM */
  14. #define QEMU_PAS_ROOT_BASE (BL32_MEM_BASE + BL32_MEM_SIZE)
  15. #define QEMU_PAS_ROOT_SIZE (BL_RAM_SIZE - \
  16. (BL32_MEM_SIZE + RME_GPT_DRAM_SIZE))
  17. /* Secure DRAM */
  18. #define QEMU_PAS_SEC_BASE BL32_MEM_BASE /* BL32_SRAM_BASE */
  19. #define QEMU_PAS_SEC_SIZE BL32_MEM_SIZE
  20. /* GPTs */
  21. #define QEMU_PAS_GPT_BASE RME_GPT_DRAM_BASE /* PLAT_QEMU_L0_GPT_BASE */
  22. #define QEMU_PAS_GPT_SIZE RME_GPT_DRAM_SIZE
  23. /* RMM */
  24. #define QEMU_PAS_RMM_BASE RMM_BASE
  25. #define QEMU_PAS_RMM_SIZE PLAT_QEMU_RMM_SIZE
  26. /* Shared area between EL3 and RMM */
  27. #define QEMU_PAS_RMM_SHARED_BASE RMM_SHARED_BASE
  28. #define QEMU_PAS_RMM_SHARED_SIZE RMM_SHARED_SIZE
  29. #define QEMU_PAS_ROOT GPT_MAP_REGION_GRANULE(QEMU_PAS_ROOT_BASE, \
  30. QEMU_PAS_ROOT_SIZE, \
  31. GPT_GPI_ROOT)
  32. #define QEMU_PAS_SECURE GPT_MAP_REGION_GRANULE(QEMU_PAS_SEC_BASE, \
  33. QEMU_PAS_SEC_SIZE, \
  34. GPT_GPI_SECURE)
  35. #define QEMU_PAS_GPTS GPT_MAP_REGION_GRANULE(QEMU_PAS_GPT_BASE, \
  36. QEMU_PAS_GPT_SIZE, \
  37. GPT_GPI_ROOT)
  38. /*
  39. * NS0 base address and size are fetched from the DT at runtime.
  40. * See bl31_adjust_pas_regions() for details
  41. */
  42. #define QEMU_PAS_NS0 GPT_MAP_REGION_GRANULE(0, 0, GPT_GPI_NS)
  43. #define QEMU_PAS_REALM GPT_MAP_REGION_GRANULE(QEMU_PAS_RMM_BASE, \
  44. QEMU_PAS_RMM_SIZE + \
  45. QEMU_PAS_RMM_SHARED_SIZE, \
  46. GPT_GPI_REALM)
  47. /* Cover 4TB with L0GTP */
  48. #define PLATFORM_GPCCR_PPS GPCCR_PPS_4TB
  49. /* GPT Configuration options */
  50. #define PLATFORM_L0GPTSZ GPCCR_L0GPTSZ_30BITS
  51. #endif /* QEMU_PAS_DEF_H */