platform_def.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * Copyright 2021-2024 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef PLATFORM_DEF_H
  7. #define PLATFORM_DEF_H
  8. #include <lib/utils_def.h>
  9. #define PLATFORM_LINKER_FORMAT "elf64-littleaarch64"
  10. #define PLATFORM_LINKER_ARCH aarch64
  11. #define PLATFORM_STACK_SIZE 0x400
  12. #define CACHE_WRITEBACK_GRANULE 64
  13. #define PLAT_PRIMARY_CPU 0x0
  14. #define PLATFORM_MAX_CPU_PER_CLUSTER 2
  15. #define PLATFORM_CLUSTER_COUNT 1
  16. #define PLATFORM_CORE_COUNT 2
  17. #define PLATFORM_CLUSTER0_CORE_COUNT 2
  18. #define PLATFORM_CLUSTER1_CORE_COUNT 0
  19. #define IMX_PWR_LVL0 MPIDR_AFFLVL0
  20. #define IMX_PWR_LVL1 MPIDR_AFFLVL1
  21. #define IMX_PWR_LVL2 MPIDR_AFFLVL2
  22. #define PWR_DOMAIN_AT_MAX_LVL U(1)
  23. #define PLAT_MAX_PWR_LVL U(2)
  24. #define PLAT_SLEEP_RET_STATE U(1)
  25. #define PLAT_DEEP_SLEEP_RET_STATE U(2)
  26. #define PLAT_MAX_RET_STATE U(3)
  27. #define PLAT_POWER_DOWN_OFF_STATE U(4)
  28. #define PLAT_DEEP_POWER_DOWN_STATE U(5)
  29. #define PLAT_MAX_OFF_STATE U(6)
  30. #define BL31_BASE 0x20040000
  31. #define BL31_LIMIT 0x20070000
  32. #define PLAT_VIRT_ADDR_SPACE_SIZE (1ull << 32)
  33. #define PLAT_PHY_ADDR_SPACE_SIZE (1ull << 32)
  34. #ifdef SPD_trusty
  35. #define MAX_XLAT_TABLES 11
  36. #define MAX_MMAP_REGIONS 12
  37. #else
  38. #define MAX_XLAT_TABLES 10
  39. #define MAX_MMAP_REGIONS 11
  40. #endif
  41. #define PLAT_GICD_BASE U(0x2d400000)
  42. #define PLAT_GICR_BASE U(0x2d440000)
  43. #define DEVICE0_BASE U(0x20000000)
  44. #define DEVICE0_SIZE U(0x10000000)
  45. #define DEVICE1_BASE U(0x30000000)
  46. #define DEVICE1_SIZE U(0x10000000)
  47. #define DEVICE2_BASE U(0x8ff00000)
  48. #define DEVICE2_SIZE U(0x00001000)
  49. #define IMX_LPUART4_BASE U(0x29390000)
  50. #define IMX_LPUART5_BASE U(0x293a0000)
  51. #define IMX_LPUART_BASE IMX_LPUART5_BASE
  52. #define IMX_CAAM_BASE U(0x292e0000)
  53. #define IMX_BOOT_UART_CLK_IN_HZ 24000000
  54. #define IMX_CONSOLE_BAUDRATE 115200
  55. #define IMX_CGC1_BASE U(0x292c0000)
  56. #define IMX_PCC3_BASE U(0x292d0000)
  57. #define IMX_PCC4_BASE U(0x29800000)
  58. #define IMX_SIM2_BASE U(0x2da50000)
  59. #define IMX_CGC2_BASE U(0x2da60000)
  60. #define IMX_PCC5_BASE U(0x2da70000)
  61. #define IMX_MU0B_BASE U(0x29220000)
  62. #define IMX_CMC1_BASE U(0x29240000)
  63. #define IMX_WUU1_BASE U(0x29260000)
  64. #define IMX_SIM1_BASE U(0x29290000)
  65. #define IMX_GPIOD_BASE U(0x2e200000)
  66. #define IMX_GPIOE_BASE U(0x2d000000)
  67. #define IMX_GPIOF_BASE U(0x2d010000)
  68. #define IMX_WDOG3_BASE U(0x292a0000)
  69. #define IMX_TPM5_BASE U(0x29340000)
  70. #define SRAM0_BASE U(0x2201F000)
  71. #define IOMUXC_PTD_PCR_BASE U(0x298c0000)
  72. #define IOMUXC_PTE_PCR_BASE U(0x298c0080)
  73. #define IOMUXC_PTF_PCR_BASE U(0x298c0100)
  74. #define IOMUXC_PSMI_BASE0 U(0x298c0800)
  75. #define IOMUXC_PSMI_BASE1 U(0x298c0838)
  76. #define IOMUXC_PSMI_BASE2 U(0x298c0954)
  77. #define IOMUXC_PSMI_BASE3 U(0x298c0994)
  78. #define IOMUXC_PSMI_BASE4 U(0x298c0a58)
  79. #define IMX_ROM_ENTRY U(0x1000)
  80. #define COUNTER_FREQUENCY 1000000
  81. #define PLAT_NS_IMAGE_OFFSET 0x80200000
  82. #define BL31_NOBITS_BASE 0x20058000
  83. #define BL31_NOBITS_LIMIT 0x2006d000
  84. #define BL31_RWDATA_BASE 0x2006d000
  85. #define BL31_RWDATA_LIMIT 0x20070000
  86. #define BL32_FDT_OVERLAY_ADDR 0x9d000000
  87. #ifdef SPD_trusty
  88. #define IMX_TRUSTY_STACK_SIZE 0x100
  89. #endif
  90. /* system memory map define */
  91. #define DEVICE0_MAP MAP_REGION_FLAT(DEVICE0_BASE, DEVICE0_SIZE, MT_DEVICE | MT_RW)
  92. #define DEVICE1_MAP MAP_REGION_FLAT(DEVICE1_BASE, DEVICE1_SIZE, MT_DEVICE | MT_RW)
  93. /* Map partial DRAM space for DRAM low-power mode control */
  94. #define DEVICE2_MAP MAP_REGION_FLAT(DEVICE2_BASE, DEVICE2_SIZE, MT_DEVICE | MT_RW)
  95. /* MU and FSB */
  96. #define ELE_MAP MAP_REGION_FLAT(0x27010000, 0x20000, MT_DEVICE | MT_RW | MT_NS)
  97. #define SEC_SIM_MAP MAP_REGION_FLAT(0x2802B000, 0x1000, MT_DEVICE | MT_RW | MT_NS) /* SEC SIM */
  98. /* For SCMI shared memory region */
  99. #define SRAM0_MAP MAP_REGION_FLAT(SRAM0_BASE, 0x1000, MT_RW | MT_DEVICE)
  100. #endif /* PLATFORM_DEF_H */