fvp-defs-dynamiq.dtsi 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. /*
  2. * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef FVP_DEFS_DYNAMIQ_DTSI
  7. #define FVP_DEFS_DYNAMIQ_DTSI
  8. /* Set default topology values if not passed from platform's makefile */
  9. #ifdef FVP_CLUSTER_COUNT
  10. #define CLUSTER_COUNT FVP_CLUSTER_COUNT
  11. #else
  12. #define CLUSTER_COUNT 1
  13. #endif
  14. #ifdef FVP_MAX_CPUS_PER_CLUSTER
  15. #define CPUS_PER_CLUSTER FVP_MAX_CPUS_PER_CLUSTER
  16. #else
  17. #define CPUS_PER_CLUSTER 8
  18. #endif
  19. #define CONCAT(x, y) x##y
  20. #define CONC(x, y) CONCAT(x, y)
  21. /*
  22. * n - CPU number
  23. * r - MPID
  24. */
  25. #define CPU(n, r) \
  26. CPU##n:cpu@r## { \
  27. device_type = "cpu"; \
  28. compatible = "arm,armv8"; \
  29. reg = <0x0 0x##r>; \
  30. enable-method = "psci"; \
  31. cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>; \
  32. next-level-cache = <&L2_0>; \
  33. };
  34. #if (PE_PER_CPU == 2)
  35. #define THREAD(n) \
  36. thread##n { \
  37. cpu = <&CONC(CPU, __COUNTER__)>; \
  38. };
  39. #define CORE(n) \
  40. core##n { \
  41. THREAD(0) \
  42. THREAD(1) \
  43. };
  44. #else /* PE_PER_CPU == 1 */
  45. #define CORE(n) \
  46. core##n { \
  47. cpu = <&CPU##n>;\
  48. };
  49. #endif /* PE_PER_CORE */
  50. #if (CPUS_PER_CLUSTER == 1)
  51. #if (PE_PER_CPU == 1)
  52. #define CPUS \
  53. CPU(0, 0)
  54. #else
  55. #define CPUS \
  56. CPU(0, 0) \
  57. CPU(1, 1)
  58. #endif
  59. #define CLUSTER(n) \
  60. cluster##n { \
  61. CORE(0) \
  62. };
  63. #elif (CPUS_PER_CLUSTER == 2)
  64. #if (PE_PER_CPU == 1)
  65. #define CPUS \
  66. CPU(0, 0) \
  67. CPU(1, 100)
  68. #else
  69. #define CPUS \
  70. CPU(0, 0) \
  71. CPU(1, 1) \
  72. CPU(2, 100) \
  73. CPU(3, 101)
  74. #endif
  75. #define CLUSTER(n) \
  76. cluster##n { \
  77. CORE(0) \
  78. CORE(1) \
  79. };
  80. #elif (CPUS_PER_CLUSTER == 3)
  81. #if (PE_PER_CPU == 1)
  82. #define CPUS \
  83. CPU(0, 0) \
  84. CPU(1, 100) \
  85. CPU(2, 200)
  86. #else
  87. #define CPUS \
  88. CPU(0, 0) \
  89. CPU(1, 1) \
  90. CPU(2, 100) \
  91. CPU(3, 101) \
  92. CPU(4, 200) \
  93. CPU(5, 201)
  94. #endif
  95. #define CLUSTER(n) \
  96. cluster##n { \
  97. CORE(0) \
  98. CORE(1) \
  99. CORE(2) \
  100. };
  101. #elif (CPUS_PER_CLUSTER == 4)
  102. #if (PE_PER_CPU == 1)
  103. #define CPUS \
  104. CPU(0, 0) \
  105. CPU(1, 100) \
  106. CPU(2, 200) \
  107. CPU(3, 300)
  108. #else
  109. #define CPUS \
  110. CPU(0, 0) \
  111. CPU(1, 1) \
  112. CPU(2, 100) \
  113. CPU(3, 101) \
  114. CPU(4, 200) \
  115. CPU(5, 201) \
  116. CPU(6, 300) \
  117. CPU(7, 301)
  118. #endif
  119. #define CLUSTER(n) \
  120. cluster##n { \
  121. CORE(0) \
  122. CORE(1) \
  123. CORE(2) \
  124. CORE(3) \
  125. };
  126. #elif (CPUS_PER_CLUSTER == 5)
  127. #if (PE_PER_CPU == 1)
  128. #define CPUS \
  129. CPU(0, 0) \
  130. CPU(1, 100) \
  131. CPU(2, 200) \
  132. CPU(3, 300) \
  133. CPU(4, 400)
  134. #else
  135. #define CPUS \
  136. CPU(0, 0) \
  137. CPU(1, 1) \
  138. CPU(2, 100) \
  139. CPU(3, 101) \
  140. CPU(4, 200) \
  141. CPU(5, 201) \
  142. CPU(6, 300) \
  143. CPU(7, 301) \
  144. CPU(8, 400) \
  145. CPU(9, 401)
  146. #endif
  147. #define CLUSTER(n) \
  148. cluster##n { \
  149. CORE(0) \
  150. CORE(1) \
  151. CORE(2) \
  152. CORE(3) \
  153. CORE(4) \
  154. };
  155. #elif (CPUS_PER_CLUSTER == 6)
  156. #if (PE_PER_CPU == 1)
  157. #define CPUS \
  158. CPU(0, 0) \
  159. CPU(1, 100) \
  160. CPU(2, 200) \
  161. CPU(3, 300) \
  162. CPU(4, 400) \
  163. CPU(5, 500)
  164. #else
  165. #define CPUS \
  166. CPU(0, 0) \
  167. CPU(1, 1) \
  168. CPU(2, 100) \
  169. CPU(3, 101) \
  170. CPU(4, 200) \
  171. CPU(5, 201) \
  172. CPU(6, 300) \
  173. CPU(7, 301) \
  174. CPU(8, 400) \
  175. CPU(9, 401) \
  176. CPU(10, 500) \
  177. CPU(11, 501)
  178. #endif
  179. #define CLUSTER(n) \
  180. cluster##n { \
  181. CORE(0) \
  182. CORE(1) \
  183. CORE(2) \
  184. CORE(3) \
  185. CORE(4) \
  186. CORE(5) \
  187. };
  188. #elif (CPUS_PER_CLUSTER == 7)
  189. #if (PE_PER_CPU == 1)
  190. #define CPUS \
  191. CPU(0, 0) \
  192. CPU(1, 100) \
  193. CPU(2, 200) \
  194. CPU(3, 300) \
  195. CPU(4, 400) \
  196. CPU(5, 500) \
  197. CPU(6, 600)
  198. #else
  199. #define CPUS \
  200. CPU(0, 0) \
  201. CPU(1, 1) \
  202. CPU(2, 100) \
  203. CPU(3, 101) \
  204. CPU(4, 200) \
  205. CPU(5, 201) \
  206. CPU(6, 300) \
  207. CPU(7, 301) \
  208. CPU(8, 400) \
  209. CPU(9, 401) \
  210. CPU(10, 500) \
  211. CPU(11, 501) \
  212. CPU(12, 600) \
  213. CPU(13, 601)
  214. #endif
  215. #define CLUSTER(n) \
  216. cluster##n { \
  217. CORE(0) \
  218. CORE(1) \
  219. CORE(2) \
  220. CORE(3) \
  221. CORE(4) \
  222. CORE(5) \
  223. CORE(6) \
  224. };
  225. #else
  226. #if (PE_PER_CPU == 1)
  227. #define CPUS \
  228. CPU(0, 0) \
  229. CPU(1, 100) \
  230. CPU(2, 200) \
  231. CPU(3, 300) \
  232. CPU(4, 400) \
  233. CPU(5, 500) \
  234. CPU(6, 600) \
  235. CPU(7, 700)
  236. #else
  237. #define CPUS \
  238. CPU(0, 0) \
  239. CPU(1, 1) \
  240. CPU(2, 100) \
  241. CPU(3, 101) \
  242. CPU(4, 200) \
  243. CPU(5, 201) \
  244. CPU(6, 300) \
  245. CPU(7, 301) \
  246. CPU(8, 400) \
  247. CPU(9, 401) \
  248. CPU(10, 500) \
  249. CPU(11, 501) \
  250. CPU(12, 600) \
  251. CPU(13, 601) \
  252. CPU(14, 700) \
  253. CPU(15, 701)
  254. #endif
  255. #define CLUSTER(n) \
  256. cluster##n { \
  257. CORE(0) \
  258. CORE(1) \
  259. CORE(2) \
  260. CORE(3) \
  261. CORE(4) \
  262. CORE(5) \
  263. CORE(6) \
  264. CORE(7) \
  265. };
  266. #endif /* CPUS_PER_CLUSTER */
  267. #define CPU_MAP \
  268. cpu-map { \
  269. CLUSTER(0) \
  270. };
  271. #endif /* FVP_DEFS_DYNAMIQ_DTSI */