platform_def.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. /*
  2. * Copyright (c) 2020-2024, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef PLATFORM_DEF_H
  7. #define PLATFORM_DEF_H
  8. #include <cortex_a520.h>
  9. #include <lib/utils_def.h>
  10. #include <lib/xlat_tables/xlat_tables_defs.h>
  11. #include <plat/arm/board/common/board_css_def.h>
  12. #include <plat/arm/board/common/v2m_def.h>
  13. /*
  14. * arm_def.h depends on the platform system counter macros, so must define the
  15. * platform macros before including arm_def.h.
  16. */
  17. #if TARGET_PLATFORM == 4
  18. #ifdef ARM_SYS_CNTCTL_BASE
  19. #error "error: ARM_SYS_CNTCTL_BASE is defined prior to the PLAT_ARM_SYS_CNTCTL_BASE definition"
  20. #endif
  21. #define PLAT_ARM_SYS_CNTCTL_BASE UL(0x47000000)
  22. #define PLAT_ARM_SYS_CNTREAD_BASE UL(0x47010000)
  23. #endif
  24. #include <plat/arm/common/arm_def.h>
  25. #include <plat/arm/common/arm_spm_def.h>
  26. #include <plat/arm/css/common/css_def.h>
  27. #include <plat/arm/soc/common/soc_css_def.h>
  28. #include <plat/common/common_def.h>
  29. #define PLAT_ARM_TRUSTED_SRAM_SIZE 0x00080000 /* 512 KB */
  30. /*
  31. * The top 16MB of ARM_DRAM1 is configured as secure access only using the TZC,
  32. * its base is ARM_AP_TZC_DRAM1_BASE.
  33. *
  34. * Reserve 96 MB below ARM_AP_TZC_DRAM1_BASE for:
  35. * - BL32_BASE when SPD_spmd is enabled
  36. * - Region to load secure partitions
  37. *
  38. *
  39. * 0x8000_0000 ------------------ TC_NS_DRAM1_BASE
  40. * | DTB |
  41. * | (32K) |
  42. * 0x8000_8000 ------------------
  43. * | NT_FW_CONFIG |
  44. * | (4KB) |
  45. * 0x8000_9000 ------------------
  46. * | ... |
  47. * 0xf8e0_0000 ------------------ TC_NS_OPTEE_BASE
  48. * | OP-TEE shmem |
  49. * | (2MB) |
  50. * 0xF900_0000 ------------------ TC_TZC_DRAM1_BASE
  51. * | |
  52. * | SPMC |
  53. * | SP |
  54. * | (96MB) |
  55. * 0xFF00_0000 ------------------ ARM_AP_TZC_DRAM1_BASE
  56. * | AP |
  57. * | EL3 Monitor |
  58. * | SCP |
  59. * | (16MB) |
  60. * 0xFFFF_FFFF ------------------
  61. *
  62. *
  63. */
  64. #define TC_TZC_DRAM1_BASE (ARM_AP_TZC_DRAM1_BASE - \
  65. TC_TZC_DRAM1_SIZE)
  66. #define TC_TZC_DRAM1_SIZE (96 * SZ_1M) /* 96 MB */
  67. #define TC_TZC_DRAM1_END (TC_TZC_DRAM1_BASE + \
  68. TC_TZC_DRAM1_SIZE - 1)
  69. #define TC_NS_DRAM1_BASE ARM_DRAM1_BASE
  70. #define TC_NS_DRAM1_SIZE (ARM_DRAM1_SIZE - \
  71. ARM_TZC_DRAM1_SIZE - \
  72. TC_TZC_DRAM1_SIZE)
  73. #define TC_NS_DRAM1_END (TC_NS_DRAM1_BASE + TC_NS_DRAM1_SIZE - 1)
  74. #define TC_NS_OPTEE_SIZE (2 * SZ_1M)
  75. #define TC_NS_OPTEE_BASE (TC_NS_DRAM1_BASE + TC_NS_DRAM1_SIZE - TC_NS_OPTEE_SIZE)
  76. /*
  77. * Mappings for TC DRAM1 (non-secure) and TC TZC DRAM1 (secure)
  78. */
  79. #define TC_MAP_NS_DRAM1 MAP_REGION_FLAT( \
  80. TC_NS_DRAM1_BASE, \
  81. TC_NS_DRAM1_SIZE, \
  82. MT_MEMORY | MT_RW | MT_NS)
  83. #define TC_MAP_TZC_DRAM1 MAP_REGION_FLAT( \
  84. TC_TZC_DRAM1_BASE, \
  85. TC_TZC_DRAM1_SIZE, \
  86. MT_MEMORY | MT_RW | MT_SECURE)
  87. #define PLAT_HW_CONFIG_DTB_BASE TC_NS_DRAM1_BASE
  88. #define PLAT_ARM_HW_CONFIG_SIZE ULL(0x8000)
  89. #define PLAT_DTB_DRAM_NS MAP_REGION_FLAT( \
  90. PLAT_HW_CONFIG_DTB_BASE, \
  91. PLAT_ARM_HW_CONFIG_SIZE, \
  92. MT_MEMORY | MT_RO | MT_NS)
  93. /*
  94. * Max size of SPMC is 2MB for tc. With SPMD enabled this value corresponds to
  95. * max size of BL32 image.
  96. */
  97. #if defined(SPD_spmd)
  98. #define TC_EL2SPMC_LOAD_ADDR (TC_TZC_DRAM1_BASE + 0x04000000)
  99. #define PLAT_ARM_SPMC_BASE TC_EL2SPMC_LOAD_ADDR
  100. #define PLAT_ARM_SPMC_SIZE UL(0x200000) /* 2 MB */
  101. #endif
  102. /*
  103. * PLAT_ARM_MMAP_ENTRIES depends on the number of entries in the
  104. * plat_arm_mmap array defined for each BL stage.
  105. */
  106. #if defined(IMAGE_BL31)
  107. # if SPM_MM
  108. # define PLAT_ARM_MMAP_ENTRIES 9
  109. # define MAX_XLAT_TABLES 7
  110. # define PLAT_SP_IMAGE_MMAP_REGIONS 7
  111. # define PLAT_SP_IMAGE_MAX_XLAT_TABLES 10
  112. # else
  113. # define PLAT_ARM_MMAP_ENTRIES 8
  114. # define MAX_XLAT_TABLES 8
  115. # endif
  116. #elif defined(IMAGE_BL32)
  117. # define PLAT_ARM_MMAP_ENTRIES 8
  118. # define MAX_XLAT_TABLES 5
  119. #elif !USE_ROMLIB
  120. # define PLAT_ARM_MMAP_ENTRIES 11
  121. # define MAX_XLAT_TABLES 7
  122. #else
  123. # define PLAT_ARM_MMAP_ENTRIES 12
  124. # define MAX_XLAT_TABLES 6
  125. #endif
  126. /*
  127. * PLAT_ARM_MAX_BL1_RW_SIZE is calculated using the current BL1 RW debug size
  128. * plus a little space for growth.
  129. */
  130. #define PLAT_ARM_MAX_BL1_RW_SIZE 0x12000
  131. /*
  132. * PLAT_ARM_MAX_ROMLIB_RW_SIZE is define to use a full page
  133. */
  134. #if USE_ROMLIB
  135. #define PLAT_ARM_MAX_ROMLIB_RW_SIZE 0x1000
  136. #define PLAT_ARM_MAX_ROMLIB_RO_SIZE 0xe000
  137. #else
  138. #define PLAT_ARM_MAX_ROMLIB_RW_SIZE 0
  139. #define PLAT_ARM_MAX_ROMLIB_RO_SIZE 0
  140. #endif
  141. /*
  142. * PLAT_ARM_MAX_BL2_SIZE is calculated using the current BL2 debug size plus a
  143. * little space for growth. Current size is considering that TRUSTED_BOARD_BOOT
  144. * and MEASURED_BOOT is enabled.
  145. */
  146. # define PLAT_ARM_MAX_BL2_SIZE 0x29000
  147. /*
  148. * Since BL31 NOBITS overlays BL2 and BL1-RW, PLAT_ARM_MAX_BL31_SIZE is
  149. * calculated using the current BL31 PROGBITS debug size plus the sizes of
  150. * BL2 and BL1-RW. Current size is considering that TRUSTED_BOARD_BOOT and
  151. * MEASURED_BOOT is enabled.
  152. */
  153. #define PLAT_ARM_MAX_BL31_SIZE 0x60000
  154. /*
  155. * Size of cacheable stacks
  156. */
  157. #if defined(IMAGE_BL1)
  158. # define PLATFORM_STACK_SIZE 0x1000
  159. #elif defined(IMAGE_BL2)
  160. # define PLATFORM_STACK_SIZE 0x1000
  161. #elif defined(IMAGE_BL2U)
  162. # define PLATFORM_STACK_SIZE 0x400
  163. #elif defined(IMAGE_BL31)
  164. # if SPM_MM
  165. # define PLATFORM_STACK_SIZE 0x500
  166. # else
  167. # define PLATFORM_STACK_SIZE 0xb00
  168. # endif
  169. #elif defined(IMAGE_BL32)
  170. # define PLATFORM_STACK_SIZE 0x440
  171. #endif
  172. /*
  173. * In the current implementation the RoT Service request that requires the
  174. * biggest message buffer is the RSE_DELEGATED_ATTEST_GET_PLATFORM_TOKEN. The
  175. * maximum required buffer size is calculated based on the platform-specific
  176. * needs of this request.
  177. */
  178. #define PLAT_RSE_COMMS_PAYLOAD_MAX_SIZE 0x500
  179. #define TC_DEVICE_BASE 0x21000000
  180. #define TC_DEVICE_SIZE 0x5f000000
  181. #if defined(TARGET_FLAVOUR_FPGA)
  182. #undef V2M_FLASH0_BASE
  183. #undef V2M_FLASH0_SIZE
  184. #define V2M_FLASH0_BASE UL(0x0C000000)
  185. #define V2M_FLASH0_SIZE UL(0x02000000)
  186. #endif
  187. // TC_MAP_DEVICE covers different peripherals
  188. // available to the platform
  189. #define TC_MAP_DEVICE MAP_REGION_FLAT( \
  190. TC_DEVICE_BASE, \
  191. TC_DEVICE_SIZE, \
  192. MT_DEVICE | MT_RW | MT_SECURE)
  193. #define TC_FLASH0_RO MAP_REGION_FLAT(V2M_FLASH0_BASE,\
  194. V2M_FLASH0_SIZE, \
  195. MT_DEVICE | MT_RO | MT_SECURE)
  196. #if TARGET_PLATFORM == 2
  197. #define PLAT_ARM_NSTIMER_FRAME_ID U(0)
  198. #else
  199. #define PLAT_ARM_NSTIMER_FRAME_ID U(1)
  200. #endif
  201. #define PLAT_ARM_TRUSTED_ROM_BASE 0x0
  202. /* PLAT_ARM_TRUSTED_ROM_SIZE 512KB minus ROM base. */
  203. #define PLAT_ARM_TRUSTED_ROM_SIZE (0x00080000 - PLAT_ARM_TRUSTED_ROM_BASE)
  204. #define PLAT_ARM_NSRAM_BASE 0x06000000
  205. #if TARGET_FLAVOUR_FVP
  206. #define PLAT_ARM_NSRAM_SIZE 0x00080000 /* 512KB */
  207. #else /* TARGET_FLAVOUR_FPGA */
  208. #define PLAT_ARM_NSRAM_SIZE 0x00008000 /* 64KB */
  209. #endif /* TARGET_FLAVOUR_FPGA */
  210. #if TARGET_PLATFORM <= 2
  211. #define PLAT_ARM_DRAM2_BASE ULL(0x8080000000)
  212. #elif TARGET_PLATFORM >= 3
  213. #define PLAT_ARM_DRAM2_BASE ULL(0x880000000)
  214. #endif /* TARGET_PLATFORM >= 3 */
  215. #define PLAT_ARM_DRAM2_SIZE ULL(0x180000000)
  216. #define PLAT_ARM_DRAM2_END (PLAT_ARM_DRAM2_BASE + PLAT_ARM_DRAM2_SIZE - 1ULL)
  217. #define TC_NS_MTE_SIZE (256 * SZ_1M)
  218. /* the SCP puts the carveout at the end of DRAM2 */
  219. #define TC_NS_DRAM2_SIZE (PLAT_ARM_DRAM2_SIZE - TC_NS_MTE_SIZE)
  220. #define PLAT_ARM_G1S_IRQ_PROPS(grp) CSS_G1S_INT_PROPS(grp)
  221. #define PLAT_ARM_G0_IRQ_PROPS(grp) ARM_G0_IRQ_PROPS(grp), \
  222. INTR_PROP_DESC(SBSA_SECURE_WDOG_INTID, \
  223. GIC_HIGHEST_SEC_PRIORITY, grp, \
  224. GIC_INTR_CFG_LEVEL)
  225. #define PLAT_ARM_SP_IMAGE_STACK_BASE (PLAT_SP_IMAGE_NS_BUF_BASE + \
  226. PLAT_SP_IMAGE_NS_BUF_SIZE)
  227. #define PLAT_ARM_SP_MAX_SIZE U(0x2000000)
  228. /*******************************************************************************
  229. * Memprotect definitions
  230. ******************************************************************************/
  231. /* PSCI memory protect definitions:
  232. * This variable is stored in a non-secure flash because some ARM reference
  233. * platforms do not have secure NVRAM. Real systems that provided MEM_PROTECT
  234. * support must use a secure NVRAM to store the PSCI MEM_PROTECT definitions.
  235. */
  236. #define PLAT_ARM_MEM_PROT_ADDR (V2M_FLASH0_BASE + \
  237. V2M_FLASH0_SIZE - V2M_FLASH_BLOCK_SIZE)
  238. /* Secure Watchdog Constants */
  239. #define SBSA_SECURE_WDOG_CONTROL_BASE UL(0x2A480000)
  240. #define SBSA_SECURE_WDOG_REFRESH_BASE UL(0x2A490000)
  241. #define SBSA_SECURE_WDOG_TIMEOUT UL(100)
  242. #define SBSA_SECURE_WDOG_INTID 86
  243. #define PLAT_ARM_SCMI_CHANNEL_COUNT 1
  244. /* Index of SDS region used in the communication with SCP */
  245. #define SDS_SCP_AP_REGION_ID U(0)
  246. /* Index of SDS region used in the communication with RSE */
  247. #define SDS_RSE_AP_REGION_ID U(1)
  248. /*
  249. * Memory region for RSE's shared data storage (SDS)
  250. * It is placed right after the SCMI payload area.
  251. */
  252. #define PLAT_ARM_RSE_AP_SDS_MEM_BASE (CSS_SCMI_PAYLOAD_BASE + \
  253. CSS_SCMI_PAYLOAD_SIZE_MAX)
  254. #define PLAT_ARM_CLUSTER_COUNT U(1)
  255. #if TARGET_FLAVOUR_FPGA && TARGET_PLATFORM == 2
  256. #define PLAT_MAX_CPUS_PER_CLUSTER U(14)
  257. #else /* TARGET_FLAVOUR_FPGA && TARGET_PLATFORM == 2 */
  258. #define PLAT_MAX_CPUS_PER_CLUSTER U(8)
  259. #endif /* TARGET_FLAVOUR_FPGA && TARGET_PLATFORM == 2 */
  260. #define PLAT_MAX_PE_PER_CPU U(1)
  261. #define PLATFORM_CORE_COUNT (PLAT_MAX_CPUS_PER_CLUSTER * PLAT_ARM_CLUSTER_COUNT)
  262. /* Message Handling Unit (MHU) base addresses */
  263. #if TARGET_PLATFORM <= 2
  264. #define PLAT_CSS_MHU_BASE UL(0x45400000)
  265. #elif TARGET_PLATFORM >= 3
  266. #define PLAT_CSS_MHU_BASE UL(0x46000000)
  267. #endif /* TARGET_PLATFORM >= 3 */
  268. #define PLAT_MHUV2_BASE PLAT_CSS_MHU_BASE
  269. /* AP<->RSS MHUs */
  270. #if TARGET_PLATFORM <= 2
  271. #define PLAT_RSE_AP_SND_MHU_BASE UL(0x2A840000)
  272. #define PLAT_RSE_AP_RCV_MHU_BASE UL(0x2A850000)
  273. #elif TARGET_PLATFORM == 3
  274. #define PLAT_RSE_AP_SND_MHU_BASE UL(0x49000000)
  275. #define PLAT_RSE_AP_RCV_MHU_BASE UL(0x49100000)
  276. #elif TARGET_PLATFORM == 4
  277. #define PLAT_RSE_AP_SND_MHU_BASE UL(0x49000000)
  278. #define PLAT_RSE_AP_RCV_MHU_BASE UL(0x49010000)
  279. #endif
  280. #define CSS_SYSTEM_PWR_DMN_LVL ARM_PWR_LVL2
  281. #define PLAT_MAX_PWR_LVL ARM_PWR_LVL1
  282. /*
  283. * Physical and virtual address space limits for MMU in AARCH64
  284. */
  285. #define PLAT_PHY_ADDR_SPACE_SIZE (1ULL << 36)
  286. #define PLAT_VIRT_ADDR_SPACE_SIZE (1ULL << 36)
  287. /* GIC related constants */
  288. #define PLAT_ARM_GICD_BASE UL(0x30000000)
  289. #define PLAT_ARM_GICC_BASE UL(0x2C000000)
  290. #define PLAT_ARM_GICR_BASE UL(0x30080000)
  291. /*
  292. * PLAT_CSS_MAX_SCP_BL2_SIZE is calculated using the current
  293. * SCP_BL2 size plus a little space for growth.
  294. */
  295. #define PLAT_CSS_MAX_SCP_BL2_SIZE 0x20000
  296. /*
  297. * PLAT_CSS_MAX_SCP_BL2U_SIZE is calculated using the current
  298. * SCP_BL2U size plus a little space for growth.
  299. */
  300. #define PLAT_CSS_MAX_SCP_BL2U_SIZE 0x20000
  301. #if TARGET_PLATFORM <= 2
  302. /* TZC Related Constants */
  303. #define PLAT_ARM_TZC_BASE UL(0x25000000)
  304. #define PLAT_ARM_TZC_FILTERS TZC_400_REGION_ATTR_FILTER_BIT(0)
  305. #define TZC400_OFFSET UL(0x1000000)
  306. #define TZC400_COUNT 4
  307. #define TZC400_BASE(n) (PLAT_ARM_TZC_BASE + \
  308. (n * TZC400_OFFSET))
  309. #define TZC_NSAID_DEFAULT U(0)
  310. #define PLAT_ARM_TZC_NS_DEV_ACCESS \
  311. (TZC_REGION_ACCESS_RDWR(TZC_NSAID_DEFAULT))
  312. /*
  313. * The first region below, TC_TZC_DRAM1_BASE (0xf9000000) to
  314. * ARM_SCP_TZC_DRAM1_END (0xffffffff) will mark the last 112 MB of DRAM as
  315. * secure. The second and third regions gives non secure access to rest of DRAM.
  316. */
  317. #define TC_TZC_REGIONS_DEF \
  318. {TC_TZC_DRAM1_BASE, ARM_SCP_TZC_DRAM1_END, \
  319. TZC_REGION_S_RDWR, PLAT_ARM_TZC_NS_DEV_ACCESS}, \
  320. {TC_NS_DRAM1_BASE, TC_NS_DRAM1_END, ARM_TZC_NS_DRAM_S_ACCESS, \
  321. PLAT_ARM_TZC_NS_DEV_ACCESS}, \
  322. {PLAT_ARM_DRAM2_BASE, PLAT_ARM_DRAM2_END, \
  323. ARM_TZC_NS_DRAM_S_ACCESS, PLAT_ARM_TZC_NS_DEV_ACCESS}
  324. #endif
  325. /* virtual address used by dynamic mem_protect for chunk_base */
  326. #define PLAT_ARM_MEM_PROTEC_VA_FRAME UL(0xc0000000)
  327. #if ARM_GPT_SUPPORT
  328. /*
  329. * This overrides the default PLAT_ARM_FIP_OFFSET_IN_GPT in board_css_def.h.
  330. * Offset of the FIP in the GPT image. BL1 component uses this option
  331. * as it does not load the partition table to get the FIP base
  332. * address. At sector 48 for TC to align with ATU page size boundaries (8KiB)
  333. * (i.e. after reserved sectors 0-47).
  334. * Offset = 48 * 512 = 0x6000
  335. */
  336. #undef PLAT_ARM_FIP_OFFSET_IN_GPT
  337. #define PLAT_ARM_FIP_OFFSET_IN_GPT 0x6000
  338. #endif /* ARM_GPT_SUPPORT */
  339. /* UART related constants */
  340. #define TC_UART0 0x2a400000
  341. #define TC_UART1 0x2a410000
  342. /*
  343. * TODO: if any more undefs are needed, it's better to consider dropping the
  344. * board_css_def.h include above
  345. */
  346. #undef PLAT_ARM_BOOT_UART_BASE
  347. #undef PLAT_ARM_RUN_UART_BASE
  348. #undef PLAT_ARM_CRASH_UART_BASE
  349. #undef PLAT_ARM_BOOT_UART_CLK_IN_HZ
  350. #undef PLAT_ARM_RUN_UART_CLK_IN_HZ
  351. #if TARGET_FLAVOUR_FVP
  352. #define PLAT_ARM_BOOT_UART_BASE TC_UART1
  353. #define TC_UARTCLK 7372800
  354. #else /* TARGET_FLAVOUR_FPGA */
  355. #define PLAT_ARM_BOOT_UART_BASE TC_UART0
  356. #if TARGET_PLATFORM <= 2
  357. #define TC_UARTCLK 5000000
  358. #elif TARGET_PLATFORM >= 3
  359. #define TC_UARTCLK 3750000
  360. #endif /* TARGET_PLATFORM >= 3 */
  361. #undef ARM_CONSOLE_BAUDRATE
  362. #define ARM_CONSOLE_BAUDRATE 38400
  363. #endif /* TARGET_FLAVOUR_FPGA */
  364. #define PLAT_ARM_RUN_UART_BASE TC_UART0
  365. #define PLAT_ARM_CRASH_UART_BASE PLAT_ARM_RUN_UART_BASE
  366. #define PLAT_ARM_BOOT_UART_CLK_IN_HZ TC_UARTCLK
  367. #define PLAT_ARM_RUN_UART_CLK_IN_HZ TC_UARTCLK
  368. #if TARGET_PLATFORM == 3
  369. #define NCI_BASE_ADDR UL(0x4F000000)
  370. #ifdef TARGET_FLAVOUR_FPGA
  371. #define MCN_ADDRESS_SPACE_SIZE 0x00120000
  372. #else
  373. #define MCN_ADDRESS_SPACE_SIZE 0x00130000
  374. #endif /* TARGET_FLAVOUR_FPGA */
  375. #define MCN_OFFSET_IN_NCI 0x00C90000
  376. #define MCN_BASE_ADDR (NCI_BASE_ADDR + MCN_OFFSET_IN_NCI)
  377. #define MCN_PMU_OFFSET 0x000C4000
  378. #define MCN_MICROARCH_OFFSET 0x000E4000
  379. #define MCN_MICROARCH_BASE_ADDR (MCN_BASE_ADDR + MCN_MICROARCH_OFFSET)
  380. #define MCN_SCR_OFFSET 0x4
  381. #define MCN_SCR_PMU_BIT 10
  382. #define MCN_INSTANCES 4
  383. #define MCN_PMU_ADDR(n) (MCN_BASE_ADDR + \
  384. (n * MCN_ADDRESS_SPACE_SIZE) + \
  385. MCN_PMU_OFFSET)
  386. #define MCN_MPAM_NS_OFFSET 0x000D0000
  387. #define MCN_MPAM_NS_BASE_ADDR (MCN_BASE_ADDR + MCN_MPAM_NS_OFFSET)
  388. #define MCN_MPAM_S_OFFSET 0x000D4000
  389. #define MCN_MPAM_S_BASE_ADDR (MCN_BASE_ADDR + MCN_MPAM_S_OFFSET)
  390. #define MPAM_SLCCFG_CTL_OFFSET 0x00003018
  391. #define SLC_RDALLOCMODE_SHIFT 8
  392. #define SLC_RDALLOCMODE_MASK (3 << SLC_RDALLOCMODE_SHIFT)
  393. #define SLC_WRALLOCMODE_SHIFT 12
  394. #define SLC_WRALLOCMODE_MASK (3 << SLC_WRALLOCMODE_SHIFT)
  395. #define SLC_DONT_ALLOC 0
  396. #define SLC_ALWAYS_ALLOC 1
  397. #define SLC_ALLOC_BUS_SIGNAL_ATTR 2
  398. #define MCN_CONFIG_OFFSET 0x204
  399. #define MCN_CONFIG_ADDR (MCN_BASE_ADDR + MCN_CONFIG_OFFSET)
  400. #define MCN_CONFIG_SLC_PRESENT_BIT 3
  401. /*
  402. * TC3 CPUs have the same definitions for:
  403. * CORTEX_{A520|A725|X925}_CPUECTLR_EL1
  404. * CORTEX_{A520|A725|X925}_CPUECTLR_EL1_EXTLLC_BIT
  405. * Define the common macros for easier using.
  406. */
  407. #define CPUECTLR_EL1 CORTEX_A520_CPUECTLR_EL1
  408. #define CPUECTLR_EL1_EXTLLC_BIT CORTEX_A520_CPUECTLR_EL1_EXTLLC_BIT
  409. #endif /* TARGET_PLATFORM == 3 */
  410. #define CPUACTLR_CLUSTERPMUEN (ULL(1) << 12)
  411. #endif /* PLATFORM_DEF_H */