soc.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. /*
  2. * Copyright 2017-2021 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_lsch2.h"
  10. #include "soc_default_base_addr.h"
  11. #include "soc_default_helper_macros.h"
  12. /* DDR Regions Info */
  13. #define NUM_DRAM_REGIONS 3
  14. #define NXP_DRAM0_ADDR 0x80000000
  15. #define NXP_DRAM0_MAX_SIZE 0x80000000 /* 2 GB */
  16. #define NXP_DRAM1_ADDR 0x880000000
  17. #define NXP_DRAM1_MAX_SIZE 0x780000000 /* 30 GB */
  18. #define NXP_DRAM2_ADDR 0x8800000000
  19. #define NXP_DRAM2_MAX_SIZE 0x7800000000 /* 480 GB */
  20. /* DRAM0 Size defined in platform_def.h */
  21. #define NXP_DRAM0_SIZE PLAT_DEF_DRAM0_SIZE
  22. /*
  23. * P23: 23 x 23 package
  24. * A: without security
  25. * AE: with security
  26. * SVR Definition (not include major and minor rev)
  27. */
  28. #define SVR_LS1023A 0x879209
  29. #define SVR_LS1023AE 0x879208
  30. #define SVR_LS1023A_P23 0x87920B
  31. #define SVR_LS1023AE_P23 0x87920A
  32. #define SVR_LS1043A 0x879201
  33. #define SVR_LS1043AE 0x879200
  34. #define SVR_LS1043A_P23 0x879203
  35. #define SVR_LS1043AE_P23 0x879202
  36. /* Number of cores in platform */
  37. #define PLATFORM_CORE_COUNT 4
  38. #define NUMBER_OF_CLUSTERS 1
  39. #define CORES_PER_CLUSTER 4
  40. /* set to 0 if the clusters are not symmetrical */
  41. #define SYMMETRICAL_CLUSTERS 1
  42. /*
  43. * Required LS standard platform porting definitions
  44. * for CCI-400
  45. */
  46. #define NXP_CCI_CLUSTER0_SL_IFACE_IX 4
  47. /* ls1043 version info for GIC configuration */
  48. #define REV1_0 0x10
  49. #define REV1_1 0x11
  50. #define GIC_ADDR_BIT 31
  51. /* Errata */
  52. #define NXP_ERRATUM_A009663
  53. #define NXP_ERRATUM_A009942
  54. #define NUM_OF_DDRC 1
  55. /* Defines required for using XLAT tables from ARM common code */
  56. #define PLAT_PHY_ADDR_SPACE_SIZE (1ull << 40)
  57. #define PLAT_VIRT_ADDR_SPACE_SIZE (1ull << 40)
  58. /* Clock Divisors */
  59. #define NXP_PLATFORM_CLK_DIVIDER 1
  60. #define NXP_UART_CLK_DIVIDER 1
  61. /*
  62. * Set this switch to 1 if you need to keep the debug block
  63. * clocked during system power-down.
  64. */
  65. #define DEBUG_ACTIVE 0
  66. #define IPPDEXPCR_MAC1_1 0x80000000 // DEVDISR2_FMAN1_MAC1
  67. #define IPPDEXPCR_MAC1_2 0x40000000 // DEVDISR2_FMAN1_MAC2
  68. #define IPPDEXPCR_MAC1_3 0x20000000 // DEVDISR2_FMAN1_MAC3
  69. #define IPPDEXPCR_MAC1_4 0x10000000 // DEVDISR2_FMAN1_MAC4
  70. #define IPPDEXPCR_MAC1_5 0x08000000 // DEVDISR2_FMAN1_MAC5
  71. #define IPPDEXPCR_MAC1_6 0x04000000 // DEVDISR2_FMAN1_MAC6
  72. #define IPPDEXPCR_MAC1_9 0x00800000 // DEVDISR2_FMAN1_MAC9
  73. #define IPPDEXPCR_I2C1 0x00080000 // DEVDISR5_I2C_1
  74. #define IPPDEXPCR_LPUART1 0x00040000 // DEVDISR5_LPUART1
  75. #define IPPDEXPCR_FLX_TMR1 0x00020000 // DEVDISR5_FLX_TMR
  76. #define IPPDEXPCR_OCRAM1 0x00010000 // DEVDISR5_OCRAM1
  77. #define IPPDEXPCR_GPIO1 0x00000040 // DEVDISR5_GPIO
  78. #define IPPDEXPCR_FM1 0x00000008 // DEVDISR2_FMAN1
  79. #define IPPDEXPCR_MASK1 0xFC800008 // overrides for DEVDISR2
  80. #define IPPDEXPCR_MASK2 0x000F0040 // overriddes for DEVDISR5
  81. #define IPSTPCR0_VALUE 0xA000C201
  82. #define IPSTPCR1_VALUE 0x00000080
  83. #define IPSTPCR2_VALUE 0x000C0000
  84. #define IPSTPCR3_VALUE 0x38000000
  85. #if (DEBUG_ACTIVE)
  86. #define IPSTPCR4_VALUE 0x10833BFC
  87. #else
  88. #define IPSTPCR4_VALUE 0x10A33BFC
  89. #endif
  90. #define DEVDISR1_QE 0x00000001
  91. #define DEVDISR1_SEC 0x00000200
  92. #define DEVDISR1_USB1 0x00004000
  93. #define DEVDISR1_SATA 0x00008000
  94. #define DEVDISR1_USB2 0x00010000
  95. #define DEVDISR1_USB3 0x00020000
  96. #define DEVDISR1_DMA2 0x00400000
  97. #define DEVDISR1_DMA1 0x00800000
  98. #define DEVDISR1_ESDHC 0x20000000
  99. #define DEVDISR1_PBL 0x80000000
  100. #define DEVDISR2_FMAN1 0x00000080
  101. #define DEVDISR2_FMAN1_MAC9 0x00800000
  102. #define DEVDISR2_FMAN1_MAC6 0x04000000
  103. #define DEVDISR2_FMAN1_MAC5 0x08000000
  104. #define DEVDISR2_FMAN1_MAC4 0x10000000
  105. #define DEVDISR2_FMAN1_MAC3 0x20000000
  106. #define DEVDISR2_FMAN1_MAC2 0x40000000
  107. #define DEVDISR2_FMAN1_MAC1 0x80000000
  108. #define DEVDISR3_BMAN 0x00040000
  109. #define DEVDISR3_QMAN 0x00080000
  110. #define DEVDISR3_PEX3 0x20000000
  111. #define DEVDISR3_PEX2 0x40000000
  112. #define DEVDISR3_PEX1 0x80000000
  113. #define DEVDISR4_QSPI 0x08000000
  114. #define DEVDISR4_DUART2 0x10000000
  115. #define DEVDISR4_DUART1 0x20000000
  116. #define DEVDISR5_ICMMU 0x00000001
  117. #define DEVDISR5_I2C_1 0x00000002
  118. #define DEVDISR5_I2C_2 0x00000004
  119. #define DEVDISR5_I2C_3 0x00000008
  120. #define DEVDISR5_I2C_4 0x00000010
  121. #define DEVDISR5_WDG_5 0x00000020
  122. #define DEVDISR5_WDG_4 0x00000040
  123. #define DEVDISR5_WDG_3 0x00000080
  124. #define DEVDISR5_DSPI1 0x00000100
  125. #define DEVDISR5_WDG_2 0x00000200
  126. #define DEVDISR5_FLX_TMR 0x00000400
  127. #define DEVDISR5_WDG_1 0x00000800
  128. #define DEVDISR5_LPUART6 0x00001000
  129. #define DEVDISR5_LPUART5 0x00002000
  130. #define DEVDISR5_LPUART3 0x00008000
  131. #define DEVDISR5_LPUART2 0x00010000
  132. #define DEVDISR5_LPUART1 0x00020000
  133. #define DEVDISR5_DBG 0x00200000
  134. #define DEVDISR5_GPIO 0x00400000
  135. #define DEVDISR5_IFC 0x00800000
  136. #define DEVDISR5_OCRAM2 0x01000000
  137. #define DEVDISR5_OCRAM1 0x02000000
  138. #define DEVDISR5_LPUART4 0x10000000
  139. #define DEVDISR5_DDR 0x80000000
  140. #define DEVDISR5_MEM 0x80000000
  141. #define DEVDISR1_VALUE 0xA0C3C201
  142. #define DEVDISR2_VALUE 0xCC0C0080
  143. #define DEVDISR3_VALUE 0xE00C0000
  144. #define DEVDISR4_VALUE 0x38000000
  145. #if (DEBUG_ACTIVE)
  146. #define DEVDISR5_VALUE 0x10833BFC
  147. #else
  148. #define DEVDISR5_VALUE 0x10A33BFC
  149. #endif
  150. /*
  151. * PWR mgmt features supported in the soc-specific code:
  152. * value == 0x0 the soc code does not support this feature
  153. * value != 0x0 the soc code supports this feature
  154. */
  155. #define SOC_CORE_RELEASE 0x1
  156. #define SOC_CORE_RESTART 0x1
  157. #define SOC_CORE_OFF 0x1
  158. #define SOC_CORE_STANDBY 0x1
  159. #define SOC_CORE_PWR_DWN 0x1
  160. #define SOC_CLUSTER_STANDBY 0x1
  161. #define SOC_CLUSTER_PWR_DWN 0x1
  162. #define SOC_SYSTEM_STANDBY 0x1
  163. #define SOC_SYSTEM_PWR_DWN 0x1
  164. #define SOC_SYSTEM_OFF 0x1
  165. #define SOC_SYSTEM_RESET 0x1
  166. /* PSCI-specific defines */
  167. #define SYSTEM_PWR_DOMAINS 1
  168. #define PLAT_NUM_PWR_DOMAINS (PLATFORM_CORE_COUNT + \
  169. NUMBER_OF_CLUSTERS + \
  170. SYSTEM_PWR_DOMAINS)
  171. /* Power state coordination occurs at the system level */
  172. #define PLAT_PD_COORD_LVL MPIDR_AFFLVL2
  173. #define PLAT_MAX_PWR_LVL PLAT_PD_COORD_LVL
  174. /* Local power state for power domains in Run state */
  175. #define LS_LOCAL_STATE_RUN PSCI_LOCAL_STATE_RUN
  176. /* define retention state */
  177. #define PLAT_MAX_RET_STATE (PSCI_LOCAL_STATE_RUN + 1)
  178. #define LS_LOCAL_STATE_RET PLAT_MAX_RET_STATE
  179. /* define power-down state */
  180. #define PLAT_MAX_OFF_STATE (PLAT_MAX_RET_STATE + 1)
  181. #define LS_LOCAL_STATE_OFF PLAT_MAX_OFF_STATE
  182. /*
  183. * Some data must be aligned on the biggest cache line size in the platform.
  184. * This is known only to the platform as it might have a combination of
  185. * integrated and external caches.
  186. * CACHE_WRITEBACK_GRANULE is defined in soc.def
  187. */
  188. /* One cache line needed for bakery locks on ARM platforms */
  189. #define PLAT_PERCPU_BAKERY_LOCK_SIZE (1 * CACHE_WRITEBACK_GRANULE)
  190. #ifndef __ASSEMBLER__
  191. /* CCI slave interfaces */
  192. static const int cci_map[] = {
  193. NXP_CCI_CLUSTER0_SL_IFACE_IX,
  194. };
  195. void soc_init_lowlevel(void);
  196. void soc_init_percpu(void);
  197. void _soc_set_start_addr(unsigned long addr);
  198. #endif
  199. #endif /* SOC_H */