fvp_def.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /*
  2. * Copyright (c) 2014-2021, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef FVP_DEF_H
  7. #define FVP_DEF_H
  8. #include <lib/utils_def.h>
  9. #ifndef FVP_CLUSTER_COUNT
  10. #error "FVP_CLUSTER_COUNT is not set in makefile"
  11. #endif
  12. #ifndef FVP_MAX_CPUS_PER_CLUSTER
  13. #error "FVP_MAX_CPUS_PER_CLUSTER is not set in makefile"
  14. #endif
  15. #ifndef FVP_MAX_PE_PER_CPU
  16. #error "FVP_MAX_PE_PER_CPU is not set in makefile"
  17. #endif
  18. #define FVP_PRIMARY_CPU 0x0
  19. /* Defines for the Interconnect build selection */
  20. #define FVP_CCI 1
  21. #define FVP_CCN 2
  22. /******************************************************************************
  23. * Definition of platform soc id
  24. *****************************************************************************/
  25. #define FVP_SOC_ID 0
  26. /*******************************************************************************
  27. * FVP memory map related constants
  28. ******************************************************************************/
  29. #define FLASH1_BASE UL(0x0c000000)
  30. #define FLASH1_SIZE UL(0x04000000)
  31. #define PSRAM_BASE UL(0x14000000)
  32. #define PSRAM_SIZE UL(0x04000000)
  33. #define VRAM_BASE UL(0x18000000)
  34. #define VRAM_SIZE UL(0x02000000)
  35. /* Aggregate of all devices in the first GB */
  36. #define DEVICE0_BASE UL(0x20000000)
  37. #define DEVICE0_SIZE UL(0x0c200000)
  38. /*
  39. * In case of FVP models with CCN, the CCN register space overlaps into
  40. * the NSRAM area.
  41. */
  42. #if FVP_INTERCONNECT_DRIVER == FVP_CCN
  43. #define DEVICE1_BASE UL(0x2e000000)
  44. #define DEVICE1_SIZE UL(0x1A00000)
  45. #else
  46. #define DEVICE1_BASE BASE_GICD_BASE
  47. #if GIC_ENABLE_V4_EXTN
  48. /* GICv4 mapping: GICD + CORE_COUNT * 256KB */
  49. #define DEVICE1_SIZE ((BASE_GICR_BASE - BASE_GICD_BASE) + \
  50. (PLATFORM_CORE_COUNT * 0x40000))
  51. #else
  52. /* GICv2 and GICv3 mapping: GICD + CORE_COUNT * 128KB */
  53. #define DEVICE1_SIZE ((BASE_GICR_BASE - BASE_GICD_BASE) + \
  54. (PLATFORM_CORE_COUNT * 0x20000))
  55. #endif /* GIC_ENABLE_V4_EXTN */
  56. #define NSRAM_BASE UL(0x2e000000)
  57. #define NSRAM_SIZE UL(0x10000)
  58. #endif
  59. /* Devices in the second GB */
  60. #define DEVICE2_BASE UL(0x7fe00000)
  61. #define DEVICE2_SIZE UL(0x00200000)
  62. #define PCIE_EXP_BASE UL(0x40000000)
  63. #define TZRNG_BASE UL(0x7fe60000)
  64. /* Non-volatile counters */
  65. #define TRUSTED_NVCTR_BASE UL(0x7fe70000)
  66. #define TFW_NVCTR_BASE (TRUSTED_NVCTR_BASE + UL(0x0000))
  67. #define TFW_NVCTR_SIZE UL(4)
  68. #define NTFW_CTR_BASE (TRUSTED_NVCTR_BASE + UL(0x0004))
  69. #define NTFW_CTR_SIZE UL(4)
  70. /* Keys */
  71. #define SOC_KEYS_BASE UL(0x7fe80000)
  72. #define TZ_PUB_KEY_HASH_BASE (SOC_KEYS_BASE + UL(0x0000))
  73. #define TZ_PUB_KEY_HASH_SIZE UL(32)
  74. #define HU_KEY_BASE (SOC_KEYS_BASE + UL(0x0020))
  75. #define HU_KEY_SIZE UL(16)
  76. #define END_KEY_BASE (SOC_KEYS_BASE + UL(0x0044))
  77. #define END_KEY_SIZE UL(32)
  78. /* Constants to distinguish FVP type */
  79. #define HBI_BASE_FVP U(0x020)
  80. #define REV_BASE_FVP_V0 U(0x0)
  81. #define REV_BASE_FVP_REVC U(0x2)
  82. #define HBI_FOUNDATION_FVP U(0x010)
  83. #define REV_FOUNDATION_FVP_V2_0 U(0x0)
  84. #define REV_FOUNDATION_FVP_V2_1 U(0x1)
  85. #define REV_FOUNDATION_FVP_v9_1 U(0x2)
  86. #define REV_FOUNDATION_FVP_v9_6 U(0x3)
  87. #define BLD_GIC_VE_MMAP U(0x0)
  88. #define BLD_GIC_A53A57_MMAP U(0x1)
  89. #define ARCH_MODEL U(0x1)
  90. /* FVP Power controller base address*/
  91. #define PWRC_BASE UL(0x1c100000)
  92. /* FVP SP804 timer frequency is 35 MHz*/
  93. #define SP804_TIMER_CLKMULT 1
  94. #define SP804_TIMER_CLKDIV 35
  95. /* SP810 controller. FVP specific flags */
  96. #define FVP_SP810_CTRL_TIM0_OV BIT_32(16)
  97. #define FVP_SP810_CTRL_TIM1_OV BIT_32(18)
  98. #define FVP_SP810_CTRL_TIM2_OV BIT_32(20)
  99. #define FVP_SP810_CTRL_TIM3_OV BIT_32(22)
  100. /*******************************************************************************
  101. * GIC & interrupt handling related constants
  102. ******************************************************************************/
  103. /* VE compatible GIC memory map */
  104. #define VE_GICD_BASE UL(0x2c001000)
  105. #define VE_GICC_BASE UL(0x2c002000)
  106. #define VE_GICH_BASE UL(0x2c004000)
  107. #define VE_GICV_BASE UL(0x2c006000)
  108. /* Base FVP compatible GIC memory map */
  109. #define BASE_GICD_BASE UL(0x2f000000)
  110. #define BASE_GICD_SIZE UL(0x10000)
  111. #define BASE_GICR_BASE UL(0x2f100000)
  112. #if GIC_ENABLE_V4_EXTN
  113. /* GICv4 redistributor size: 256KB */
  114. #define BASE_GICR_SIZE UL(0x40000)
  115. #else
  116. #define BASE_GICR_SIZE UL(0x20000)
  117. #endif /* GIC_ENABLE_V4_EXTN */
  118. #define BASE_GICC_BASE UL(0x2c000000)
  119. #define BASE_GICH_BASE UL(0x2c010000)
  120. #define BASE_GICV_BASE UL(0x2c02f000)
  121. #define FVP_IRQ_TZ_WDOG 56
  122. #define FVP_IRQ_SEC_SYS_TIMER 57
  123. /*******************************************************************************
  124. * TrustZone address space controller related constants
  125. ******************************************************************************/
  126. /* NSAIDs used by devices in TZC filter 0 on FVP */
  127. #define FVP_NSAID_DEFAULT 0
  128. #define FVP_NSAID_PCI 1
  129. #define FVP_NSAID_VIRTIO 8 /* from FVP v5.6 onwards */
  130. #define FVP_NSAID_AP 9 /* Application Processors */
  131. #define FVP_NSAID_VIRTIO_OLD 15 /* until FVP v5.5 */
  132. /* NSAIDs used by devices in TZC filter 2 on FVP */
  133. #define FVP_NSAID_HDLCD0 2
  134. #define FVP_NSAID_CLCD 7
  135. /*******************************************************************************
  136. * Memprotect definitions
  137. ******************************************************************************/
  138. /* PSCI memory protect definitions:
  139. * This variable is stored in a non-secure flash because some ARM reference
  140. * platforms do not have secure NVRAM. Real systems that provided MEM_PROTECT
  141. * support must use a secure NVRAM to store the PSCI MEM_PROTECT definitions.
  142. */
  143. #define PLAT_ARM_MEM_PROT_ADDR (V2M_FLASH0_BASE + \
  144. V2M_FLASH0_SIZE - V2M_FLASH_BLOCK_SIZE)
  145. #endif /* FVP_DEF_H */