morello_def.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef MORELLO_DEF_H
  7. #define MORELLO_DEF_H
  8. /* Non-secure SRAM MMU mapping */
  9. #define MORELLO_NS_SRAM_BASE UL(0x06000000)
  10. #define MORELLO_NS_SRAM_SIZE UL(0x00010000)
  11. #define MORELLO_MAP_NS_SRAM MAP_REGION_FLAT( \
  12. MORELLO_NS_SRAM_BASE, \
  13. MORELLO_NS_SRAM_SIZE, \
  14. MT_DEVICE | MT_RW | MT_SECURE)
  15. /* SDS Firmware version defines */
  16. #define MORELLO_SDS_FIRMWARE_VERSION_STRUCT_ID U(2)
  17. #define MORELLO_SDS_FIRMWARE_VERSION_OFFSET U(0)
  18. #ifdef TARGET_PLATFORM_FVP
  19. # define MORELLO_SDS_FIRMWARE_VERSION_SIZE U(8)
  20. #else
  21. # define MORELLO_SDS_FIRMWARE_VERSION_SIZE U(16)
  22. #endif
  23. /* SDS Platform information defines */
  24. #define MORELLO_SDS_PLATFORM_INFO_STRUCT_ID U(8)
  25. #define MORELLO_SDS_PLATFORM_INFO_OFFSET U(0)
  26. #ifdef TARGET_PLATFORM_FVP
  27. # define MORELLO_SDS_PLATFORM_INFO_SIZE U(8)
  28. #else
  29. # define MORELLO_SDS_PLATFORM_INFO_SIZE U(26)
  30. #endif
  31. #define MORELLO_MAX_DDR_CAPACITY U(0x1000000000)
  32. #define MORELLO_MAX_REMOTE_CHIP_COUNT U(16)
  33. #define MORELLO_SCC_SERVER_MODE U(0)
  34. #define MORELLO_SCC_CLIENT_MODE_MASK U(1)
  35. #define MORELLO_SCC_C1_TAG_CACHE_EN_MASK U(4)
  36. #define MORELLO_SCC_C2_TAG_CACHE_EN_MASK U(8)
  37. /* Base address of non-secure SRAM where Platform information will be filled */
  38. #define MORELLO_PLATFORM_INFO_BASE UL(0x06000000)
  39. /* DMC memory status registers */
  40. #define MORELLO_DMC0_MEMC_STATUS_REG UL(0x4E000000)
  41. #define MORELLO_DMC1_MEMC_STATUS_REG UL(0x4E100000)
  42. #define MORELLO_DMC_MEMC_STATUS_MASK U(7)
  43. /* DMC memory command registers */
  44. #define MORELLO_DMC0_MEMC_CMD_REG UL(0x4E000008)
  45. #define MORELLO_DMC1_MEMC_CMD_REG UL(0x4E100008)
  46. /* DMC capability control register */
  47. #define MORELLO_DMC0_CAP_CTRL_REG UL(0x4E000D00)
  48. #define MORELLO_DMC1_CAP_CTRL_REG UL(0x4E100D00)
  49. /* DMC tag cache control register */
  50. #define MORELLO_DMC0_TAG_CACHE_CTL UL(0x4E000D04)
  51. #define MORELLO_DMC1_TAG_CACHE_CTL UL(0x4E100D04)
  52. /* DMC tag cache config register */
  53. #define MORELLO_DMC0_TAG_CACHE_CFG UL(0x4E000D08)
  54. #define MORELLO_DMC1_TAG_CACHE_CFG UL(0x4E100D08)
  55. /* DMC memory access control register */
  56. #define MORELLO_DMC0_MEM_ACCESS_CTL UL(0x4E000D0C)
  57. #define MORELLO_DMC1_MEM_ACCESS_CTL UL(0x4E100D0C)
  58. #define MORELLO_DMC_MEM_ACCESS_DIS (1UL << 16)
  59. /* DMC memory address control register */
  60. #define MORELLO_DMC0_MEM_ADDR_CTL UL(0x4E000D10)
  61. #define MORELLO_DMC1_MEM_ADDR_CTL UL(0x4E100D10)
  62. /* DMC memory address control 2 register */
  63. #define MORELLO_DMC0_MEM_ADDR_CTL2 UL(0x4E000D14)
  64. #define MORELLO_DMC1_MEM_ADDR_CTL2 UL(0x4E100D14)
  65. /* DMC special control register */
  66. #define MORELLO_DMC0_SPL_CTL_REG UL(0x4E000D18)
  67. #define MORELLO_DMC1_SPL_CTL_REG UL(0x4E100D18)
  68. /* DMC ERR0CTLR0 registers */
  69. #define MORELLO_DMC0_ERR0CTLR0_REG UL(0x4E000708)
  70. #define MORELLO_DMC1_ERR0CTLR0_REG UL(0x4E100708)
  71. /* DMC ECC in ERR0CTLR0 register */
  72. #define MORELLO_DMC_ERR0CTLR0_ECC_EN U(9)
  73. /* DMC ERR2STATUS register */
  74. #define MORELLO_DMC0_ERR2STATUS_REG UL(0x4E000790)
  75. #define MORELLO_DMC1_ERR2STATUS_REG UL(0x4E100790)
  76. /* DMC memory commands */
  77. #define MORELLO_DMC_MEMC_CMD_CONFIG U(0)
  78. #define MORELLO_DMC_MEMC_CMD_READY U(3)
  79. /* SDS Platform information struct definition */
  80. #ifdef TARGET_PLATFORM_FVP
  81. /*
  82. * Platform information structure stored in SDS.
  83. * This structure holds information about platform's DDR
  84. * size
  85. * - Local DDR size in bytes, DDR memory in main board
  86. */
  87. struct morello_plat_info {
  88. uint64_t local_ddr_size;
  89. } __packed;
  90. #else
  91. /*
  92. * Platform information structure stored in SDS.
  93. * This structure holds information about platform's DDR
  94. * size which is an information about multichip setup
  95. * - Local DDR size in bytes, DDR memory in main board
  96. * - Remote DDR size in bytes, DDR memory in remote board
  97. * - remote_chip_count
  98. * - multichip mode
  99. * - scc configuration
  100. * - silicon revision
  101. */
  102. struct morello_plat_info {
  103. uint64_t local_ddr_size;
  104. uint64_t remote_ddr_size;
  105. uint8_t remote_chip_count;
  106. bool multichip_mode;
  107. uint32_t scc_config;
  108. uint32_t silicon_revision;
  109. } __packed;
  110. #endif
  111. /* SDS Firmware revision struct definition */
  112. #ifdef TARGET_PLATFORM_FVP
  113. /*
  114. * Firmware revision structure stored in SDS.
  115. * This structure holds information about firmware versions.
  116. * - SCP firmware version
  117. * - SCP firmware commit
  118. */
  119. struct morello_firmware_version {
  120. uint32_t scp_fw_ver;
  121. uint32_t scp_fw_commit;
  122. } __packed;
  123. #else
  124. /*
  125. * Firmware revision structure stored in SDS.
  126. * This structure holds information about firmware versions.
  127. * - SCP firmware version
  128. * - SCP firmware commit
  129. * - MCC firmware version
  130. * - PCC firmware version
  131. */
  132. struct morello_firmware_version {
  133. uint32_t scp_fw_ver;
  134. uint32_t scp_fw_commit;
  135. uint32_t mcc_fw_ver;
  136. uint32_t pcc_fw_ver;
  137. } __packed;
  138. #endif
  139. /* Compile time assertions to ensure the size of structures are of the required bytes */
  140. CASSERT(sizeof(struct morello_plat_info) == MORELLO_SDS_PLATFORM_INFO_SIZE,
  141. assert_invalid_plat_info_size);
  142. CASSERT(sizeof(struct morello_firmware_version) == MORELLO_SDS_FIRMWARE_VERSION_SIZE,
  143. assert_invalid_firmware_version_size);
  144. #endif /* MORELLO_DEF_H */