soc.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. /*
  2. * Copyright 2022 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef SOC_H
  7. #define SOC_H
  8. /* Chassis specific defines - common across SoC's of a particular platform */
  9. #include "dcfg_lsch3.h"
  10. #include "soc_default_base_addr.h"
  11. #include "soc_default_helper_macros.h"
  12. /*
  13. * SVR Definition of LS1088A
  14. * A: without security
  15. * AE: with security
  16. * (not include major and minor rev)
  17. */
  18. #define SVR_LS1044A 0x870323
  19. #define SVR_LS1044AE 0x870322
  20. #define SVR_LS1048A 0x870321
  21. #define SVR_LS1048AE 0x870320
  22. #define SVR_LS1084A 0x870303
  23. #define SVR_LS1084AE 0x870302
  24. #define SVR_LS1088A 0x870301
  25. #define SVR_LS1088AE 0x870300
  26. #define SVR_WO_E 0xFFFFFE
  27. /* Number of cores in platform */
  28. #define NUMBER_OF_CLUSTERS 2
  29. #define CORES_PER_CLUSTER 4
  30. #define PLATFORM_CORE_COUNT (NUMBER_OF_CLUSTERS * CORES_PER_CLUSTER)
  31. /* set to 0 if the clusters are not symmetrical */
  32. #define SYMMETRICAL_CLUSTERS 1
  33. #define NUM_DRAM_REGIONS 2
  34. #define NXP_DRAM0_ADDR 0x80000000
  35. #define NXP_DRAM0_MAX_SIZE 0x80000000 /* 2 GB */
  36. #define NXP_DRAM1_ADDR 0x8080000000
  37. #define NXP_DRAM1_MAX_SIZE 0x7F80000000 /* 510 G */
  38. /* DRAM0 Size defined in platform_def.h */
  39. #define NXP_DRAM0_SIZE PLAT_DEF_DRAM0_SIZE
  40. #define NXP_POWMGTDCR 0x700123C20
  41. /* epu register offsets and values */
  42. #define EPU_EPGCR_OFFSET 0x0
  43. #define EPU_EPIMCR10_OFFSET 0x128
  44. #define EPU_EPCTR10_OFFSET 0xa28
  45. #define EPU_EPCCR10_OFFSET 0x828
  46. #ifdef EPU_EPCCR10_VAL
  47. #undef EPU_EPCCR10_VAL
  48. #endif
  49. #define EPU_EPCCR10_VAL 0xf2800000
  50. #define EPU_EPIMCR10_VAL 0xba000000
  51. #define EPU_EPCTR10_VAL 0x0
  52. #define EPU_EPGCR_VAL (1 << 31)
  53. /* pmu register offsets and values */
  54. #define PMU_PCPW20SR_OFFSET 0x830
  55. #define PMU_CLAINACTSETR_OFFSET 0x1100
  56. #define PMU_CLAINACTCLRR_OFFSET 0x1104
  57. #define PMU_CLSINACTSETR_OFFSET 0x1108
  58. #define PMU_CLSINACTCLRR_OFFSET 0x110C
  59. #define PMU_CLL2FLUSHSETR_OFFSET 0x1110
  60. #define PMU_CLSL2FLUSHCLRR_OFFSET 0x1114
  61. #define PMU_CLL2FLUSHSR_OFFSET 0x1118
  62. #define PMU_POWMGTCSR_OFFSET 0x4000
  63. #define PMU_IPPDEXPCR0_OFFSET 0x4040
  64. #define PMU_IPPDEXPCR1_OFFSET 0x4044
  65. #define PMU_IPPDEXPCR2_OFFSET 0x4048
  66. #define PMU_IPPDEXPCR3_OFFSET 0x404C
  67. #define PMU_IPPDEXPCR4_OFFSET 0x4050
  68. #define PMU_IPPDEXPCR5_OFFSET 0x4054
  69. #define PMU_IPSTPCR0_OFFSET 0x4120
  70. #define PMU_IPSTPCR1_OFFSET 0x4124
  71. #define PMU_IPSTPCR2_OFFSET 0x4128
  72. #define PMU_IPSTPCR3_OFFSET 0x412C
  73. #define PMU_IPSTPCR4_OFFSET 0x4130
  74. #define PMU_IPSTPCR5_OFFSET 0x4134
  75. #define PMU_IPSTPCR6_OFFSET 0x4138
  76. #define PMU_IPSTPACK0_OFFSET 0x4140
  77. #define PMU_IPSTPACK1_OFFSET 0x4144
  78. #define PMU_IPSTPACK2_OFFSET 0x4148
  79. #define PMU_IPSTPACK3_OFFSET 0x414C
  80. #define PMU_IPSTPACK4_OFFSET 0x4150
  81. #define PMU_IPSTPACK5_OFFSET 0x4154
  82. #define PMU_IPSTPACK6_OFFSET 0x4158
  83. #define PMU_POWMGTCSR_VAL (1 << 20)
  84. #define IPPDEXPCR0_MASK 0xFFFFFFFF
  85. #define IPPDEXPCR1_MASK 0xFFFFFFFF
  86. #define IPPDEXPCR2_MASK 0xFFFFFFFF
  87. #define IPPDEXPCR3_MASK 0xFFFFFFFF
  88. #define IPPDEXPCR4_MASK 0xFFFFFFFF
  89. #define IPPDEXPCR5_MASK 0xFFFFFFFF
  90. /* DEVDISR5_FLX_TMR */
  91. #define IPPDEXPCR_FLX_TMR 0x00004000
  92. #define DEVDISR5_FLX_TMR 0x00004000
  93. #define IPSTPCR0_VALUE 0x0041310C
  94. #define IPSTPCR1_VALUE 0x000003FF
  95. #define IPSTPCR2_VALUE 0x00013006
  96. /* Don't stop UART */
  97. #define IPSTPCR3_VALUE 0x0000033A
  98. #define IPSTPCR4_VALUE 0x00103300
  99. #define IPSTPCR5_VALUE 0x00000001
  100. #define IPSTPCR6_VALUE 0x00000000
  101. #define TZPC_BLOCK_SIZE 0x1000
  102. /* PORSR1 */
  103. #define PORSR1_RCW_MASK 0xFF800000
  104. #define PORSR1_RCW_SHIFT 23
  105. /* CFG_RCW_SRC[6:0] */
  106. #define RCW_SRC_TYPE_MASK 0x70
  107. /* RCW SRC NOR */
  108. #define NOR_16B_VAL 0x20
  109. /*
  110. * RCW SRC Serial Flash
  111. * 1. SERAIL NOR (QSPI)
  112. * 2. OTHERS (SD/MMC, SPI, I2C1)
  113. */
  114. #define RCW_SRC_SERIAL_MASK 0x7F
  115. #define QSPI_VAL 0x62
  116. #define SDHC_VAL 0x40
  117. #define EMMC_VAL 0x41
  118. /*
  119. * Required LS standard platform porting definitions
  120. * for CCN-504 - Read from RN-F node ID register
  121. */
  122. #define PLAT_CLUSTER_TO_CCN_ID_MAP 1, 9, 11, 19
  123. /* Defines required for using XLAT tables from ARM common code */
  124. #define PLAT_PHY_ADDR_SPACE_SIZE (1ULL << 40)
  125. #define PLAT_VIRT_ADDR_SPACE_SIZE (1ULL << 40)
  126. /*
  127. * Clock Divisors
  128. */
  129. #define NXP_PLATFORM_CLK_DIVIDER 1
  130. #define NXP_UART_CLK_DIVIDER 2
  131. /* dcfg register offsets and values */
  132. #define DCFG_DEVDISR1_OFFSET 0x70
  133. #define DCFG_DEVDISR2_OFFSET 0x74
  134. #define DCFG_DEVDISR3_OFFSET 0x78
  135. #define DCFG_DEVDISR5_OFFSET 0x80
  136. #define DCFG_DEVDISR6_OFFSET 0x84
  137. #define DCFG_DEVDISR1_SEC (1 << 22)
  138. #define DCFG_DEVDISR3_QBMAIN (1 << 12)
  139. #define DCFG_DEVDISR4_SPI_QSPI (1 << 4 | 1 << 5)
  140. #define DCFG_DEVDISR5_MEM (1 << 0)
  141. #define DEVDISR1_VALUE 0x0041310c
  142. #define DEVDISR2_VALUE 0x000003ff
  143. #define DEVDISR3_VALUE 0x00013006
  144. #define DEVDISR4_VALUE 0x0000033e
  145. #define DEVDISR5_VALUE 0x00103300
  146. #define DEVDISR6_VALUE 0x00000001
  147. /*
  148. * pwr mgmt features supported in the soc-specific code:
  149. * value == 0x0, the soc code does not support this feature
  150. * value != 0x0, the soc code supports this feature
  151. */
  152. #define SOC_CORE_RELEASE 0x1
  153. #define SOC_CORE_RESTART 0x1
  154. #define SOC_CORE_OFF 0x1
  155. #define SOC_CORE_STANDBY 0x1
  156. #define SOC_CORE_PWR_DWN 0x1
  157. #define SOC_CLUSTER_STANDBY 0x1
  158. #define SOC_CLUSTER_PWR_DWN 0x1
  159. #define SOC_SYSTEM_STANDBY 0x1
  160. #define SOC_SYSTEM_PWR_DWN 0x1
  161. #define SOC_SYSTEM_OFF 0x1
  162. #define SOC_SYSTEM_RESET 0x1
  163. #define SYSTEM_PWR_DOMAINS 1
  164. #define PLAT_NUM_PWR_DOMAINS (PLATFORM_CORE_COUNT + \
  165. NUMBER_OF_CLUSTERS + \
  166. SYSTEM_PWR_DOMAINS)
  167. /* Power state coordination occurs at the system level */
  168. #define PLAT_PD_COORD_LVL MPIDR_AFFLVL2
  169. #define PLAT_MAX_PWR_LVL PLAT_PD_COORD_LVL
  170. /* Local power state for power domains in Run state */
  171. #define LS_LOCAL_STATE_RUN PSCI_LOCAL_STATE_RUN
  172. /* define retention state */
  173. #define PLAT_MAX_RET_STATE (PSCI_LOCAL_STATE_RUN + 1)
  174. #define LS_LOCAL_STATE_RET PLAT_MAX_RET_STATE
  175. /* define power-down state */
  176. #define PLAT_MAX_OFF_STATE (PLAT_MAX_RET_STATE + 1)
  177. #define LS_LOCAL_STATE_OFF PLAT_MAX_OFF_STATE
  178. #ifndef __ASSEMBLER__
  179. /* CCI slave interfaces */
  180. static const int cci_map[] = {
  181. 3,
  182. 4,
  183. };
  184. void soc_init_lowlevel(void);
  185. void soc_init_percpu(void);
  186. void _soc_set_start_addr(unsigned long addr);
  187. void _set_platform_security(void);
  188. #endif
  189. #endif /* SOC_H */