topology.txt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. ===========================================
  2. ARM topology binding description
  3. ===========================================
  4. ===========================================
  5. 1 - Introduction
  6. ===========================================
  7. In an ARM system, the hierarchy of CPUs is defined through three entities that
  8. are used to describe the layout of physical CPUs in the system:
  9. - cluster
  10. - core
  11. - thread
  12. The cpu nodes (bindings defined in [1]) represent the devices that
  13. correspond to physical CPUs and are to be mapped to the hierarchy levels.
  14. The bottom hierarchy level sits at core or thread level depending on whether
  15. symmetric multi-threading (SMT) is supported or not.
  16. For instance in a system where CPUs support SMT, "cpu" nodes represent all
  17. threads existing in the system and map to the hierarchy level "thread" above.
  18. In systems where SMT is not supported "cpu" nodes represent all cores present
  19. in the system and map to the hierarchy level "core" above.
  20. ARM topology bindings allow one to associate cpu nodes with hierarchical groups
  21. corresponding to the system hierarchy; syntactically they are defined as device
  22. tree nodes.
  23. The remainder of this document provides the topology bindings for ARM, based
  24. on the ePAPR standard, available from:
  25. http://www.power.org/documentation/epapr-version-1-1/
  26. If not stated otherwise, whenever a reference to a cpu node phandle is made its
  27. value must point to a cpu node compliant with the cpu node bindings as
  28. documented in [1].
  29. A topology description containing phandles to cpu nodes that are not compliant
  30. with bindings standardized in [1] is therefore considered invalid.
  31. ===========================================
  32. 2 - cpu-map node
  33. ===========================================
  34. The ARM CPU topology is defined within the cpu-map node, which is a direct
  35. child of the cpus node and provides a container where the actual topology
  36. nodes are listed.
  37. - cpu-map node
  38. Usage: Optional - On ARM SMP systems provide CPUs topology to the OS.
  39. ARM uniprocessor systems do not require a topology
  40. description and therefore should not define a
  41. cpu-map node.
  42. Description: The cpu-map node is just a container node where its
  43. subnodes describe the CPU topology.
  44. Node name must be "cpu-map".
  45. The cpu-map node's parent node must be the cpus node.
  46. The cpu-map node's child nodes can be:
  47. - one or more cluster nodes
  48. Any other configuration is considered invalid.
  49. The cpu-map node can only contain three types of child nodes:
  50. - cluster node
  51. - core node
  52. - thread node
  53. whose bindings are described in paragraph 3.
  54. The nodes describing the CPU topology (cluster/core/thread) can only
  55. be defined within the cpu-map node and every core/thread in the system
  56. must be defined within the topology. Any other configuration is
  57. invalid and therefore must be ignored.
  58. ===========================================
  59. 2.1 - cpu-map child nodes naming convention
  60. ===========================================
  61. cpu-map child nodes must follow a naming convention where the node name
  62. must be "clusterN", "coreN", "threadN" depending on the node type (ie
  63. cluster/core/thread) (where N = {0, 1, ...} is the node number; nodes which
  64. are siblings within a single common parent node must be given a unique and
  65. sequential N value, starting from 0).
  66. cpu-map child nodes which do not share a common parent node can have the same
  67. name (ie same number N as other cpu-map child nodes at different device tree
  68. levels) since name uniqueness will be guaranteed by the device tree hierarchy.
  69. ===========================================
  70. 3 - cluster/core/thread node bindings
  71. ===========================================
  72. Bindings for cluster/cpu/thread nodes are defined as follows:
  73. - cluster node
  74. Description: must be declared within a cpu-map node, one node
  75. per cluster. A system can contain several layers of
  76. clustering and cluster nodes can be contained in parent
  77. cluster nodes.
  78. The cluster node name must be "clusterN" as described in 2.1 above.
  79. A cluster node can not be a leaf node.
  80. A cluster node's child nodes must be:
  81. - one or more cluster nodes; or
  82. - one or more core nodes
  83. Any other configuration is considered invalid.
  84. - core node
  85. Description: must be declared in a cluster node, one node per core in
  86. the cluster. If the system does not support SMT, core
  87. nodes are leaf nodes, otherwise they become containers of
  88. thread nodes.
  89. The core node name must be "coreN" as described in 2.1 above.
  90. A core node must be a leaf node if SMT is not supported.
  91. Properties for core nodes that are leaf nodes:
  92. - cpu
  93. Usage: required
  94. Value type: <phandle>
  95. Definition: a phandle to the cpu node that corresponds to the
  96. core node.
  97. If a core node is not a leaf node (CPUs supporting SMT) a core node's
  98. child nodes can be:
  99. - one or more thread nodes
  100. Any other configuration is considered invalid.
  101. - thread node
  102. Description: must be declared in a core node, one node per thread
  103. in the core if the system supports SMT. Thread nodes are
  104. always leaf nodes in the device tree.
  105. The thread node name must be "threadN" as described in 2.1 above.
  106. A thread node must be a leaf node.
  107. A thread node must contain the following property:
  108. - cpu
  109. Usage: required
  110. Value type: <phandle>
  111. Definition: a phandle to the cpu node that corresponds to
  112. the thread node.
  113. ===========================================
  114. 4 - Example dts
  115. ===========================================
  116. Example 1 (ARM 64-bit, 16-cpu system, two clusters of clusters):
  117. cpus {
  118. #size-cells = <0>;
  119. #address-cells = <2>;
  120. cpu-map {
  121. cluster0 {
  122. cluster0 {
  123. core0 {
  124. thread0 {
  125. cpu = <&CPU0>;
  126. };
  127. thread1 {
  128. cpu = <&CPU1>;
  129. };
  130. };
  131. core1 {
  132. thread0 {
  133. cpu = <&CPU2>;
  134. };
  135. thread1 {
  136. cpu = <&CPU3>;
  137. };
  138. };
  139. };
  140. cluster1 {
  141. core0 {
  142. thread0 {
  143. cpu = <&CPU4>;
  144. };
  145. thread1 {
  146. cpu = <&CPU5>;
  147. };
  148. };
  149. core1 {
  150. thread0 {
  151. cpu = <&CPU6>;
  152. };
  153. thread1 {
  154. cpu = <&CPU7>;
  155. };
  156. };
  157. };
  158. };
  159. cluster1 {
  160. cluster0 {
  161. core0 {
  162. thread0 {
  163. cpu = <&CPU8>;
  164. };
  165. thread1 {
  166. cpu = <&CPU9>;
  167. };
  168. };
  169. core1 {
  170. thread0 {
  171. cpu = <&CPU10>;
  172. };
  173. thread1 {
  174. cpu = <&CPU11>;
  175. };
  176. };
  177. };
  178. cluster1 {
  179. core0 {
  180. thread0 {
  181. cpu = <&CPU12>;
  182. };
  183. thread1 {
  184. cpu = <&CPU13>;
  185. };
  186. };
  187. core1 {
  188. thread0 {
  189. cpu = <&CPU14>;
  190. };
  191. thread1 {
  192. cpu = <&CPU15>;
  193. };
  194. };
  195. };
  196. };
  197. };
  198. CPU0: cpu@0 {
  199. device_type = "cpu";
  200. compatible = "arm,cortex-a57";
  201. reg = <0x0 0x0>;
  202. enable-method = "spin-table";
  203. cpu-release-addr = <0 0x20000000>;
  204. };
  205. CPU1: cpu@1 {
  206. device_type = "cpu";
  207. compatible = "arm,cortex-a57";
  208. reg = <0x0 0x1>;
  209. enable-method = "spin-table";
  210. cpu-release-addr = <0 0x20000000>;
  211. };
  212. CPU2: cpu@100 {
  213. device_type = "cpu";
  214. compatible = "arm,cortex-a57";
  215. reg = <0x0 0x100>;
  216. enable-method = "spin-table";
  217. cpu-release-addr = <0 0x20000000>;
  218. };
  219. CPU3: cpu@101 {
  220. device_type = "cpu";
  221. compatible = "arm,cortex-a57";
  222. reg = <0x0 0x101>;
  223. enable-method = "spin-table";
  224. cpu-release-addr = <0 0x20000000>;
  225. };
  226. CPU4: cpu@10000 {
  227. device_type = "cpu";
  228. compatible = "arm,cortex-a57";
  229. reg = <0x0 0x10000>;
  230. enable-method = "spin-table";
  231. cpu-release-addr = <0 0x20000000>;
  232. };
  233. CPU5: cpu@10001 {
  234. device_type = "cpu";
  235. compatible = "arm,cortex-a57";
  236. reg = <0x0 0x10001>;
  237. enable-method = "spin-table";
  238. cpu-release-addr = <0 0x20000000>;
  239. };
  240. CPU6: cpu@10100 {
  241. device_type = "cpu";
  242. compatible = "arm,cortex-a57";
  243. reg = <0x0 0x10100>;
  244. enable-method = "spin-table";
  245. cpu-release-addr = <0 0x20000000>;
  246. };
  247. CPU7: cpu@10101 {
  248. device_type = "cpu";
  249. compatible = "arm,cortex-a57";
  250. reg = <0x0 0x10101>;
  251. enable-method = "spin-table";
  252. cpu-release-addr = <0 0x20000000>;
  253. };
  254. CPU8: cpu@100000000 {
  255. device_type = "cpu";
  256. compatible = "arm,cortex-a57";
  257. reg = <0x1 0x0>;
  258. enable-method = "spin-table";
  259. cpu-release-addr = <0 0x20000000>;
  260. };
  261. CPU9: cpu@100000001 {
  262. device_type = "cpu";
  263. compatible = "arm,cortex-a57";
  264. reg = <0x1 0x1>;
  265. enable-method = "spin-table";
  266. cpu-release-addr = <0 0x20000000>;
  267. };
  268. CPU10: cpu@100000100 {
  269. device_type = "cpu";
  270. compatible = "arm,cortex-a57";
  271. reg = <0x1 0x100>;
  272. enable-method = "spin-table";
  273. cpu-release-addr = <0 0x20000000>;
  274. };
  275. CPU11: cpu@100000101 {
  276. device_type = "cpu";
  277. compatible = "arm,cortex-a57";
  278. reg = <0x1 0x101>;
  279. enable-method = "spin-table";
  280. cpu-release-addr = <0 0x20000000>;
  281. };
  282. CPU12: cpu@100010000 {
  283. device_type = "cpu";
  284. compatible = "arm,cortex-a57";
  285. reg = <0x1 0x10000>;
  286. enable-method = "spin-table";
  287. cpu-release-addr = <0 0x20000000>;
  288. };
  289. CPU13: cpu@100010001 {
  290. device_type = "cpu";
  291. compatible = "arm,cortex-a57";
  292. reg = <0x1 0x10001>;
  293. enable-method = "spin-table";
  294. cpu-release-addr = <0 0x20000000>;
  295. };
  296. CPU14: cpu@100010100 {
  297. device_type = "cpu";
  298. compatible = "arm,cortex-a57";
  299. reg = <0x1 0x10100>;
  300. enable-method = "spin-table";
  301. cpu-release-addr = <0 0x20000000>;
  302. };
  303. CPU15: cpu@100010101 {
  304. device_type = "cpu";
  305. compatible = "arm,cortex-a57";
  306. reg = <0x1 0x10101>;
  307. enable-method = "spin-table";
  308. cpu-release-addr = <0 0x20000000>;
  309. };
  310. };
  311. Example 2 (ARM 32-bit, dual-cluster, 8-cpu system, no SMT):
  312. cpus {
  313. #size-cells = <0>;
  314. #address-cells = <1>;
  315. cpu-map {
  316. cluster0 {
  317. core0 {
  318. cpu = <&CPU0>;
  319. };
  320. core1 {
  321. cpu = <&CPU1>;
  322. };
  323. core2 {
  324. cpu = <&CPU2>;
  325. };
  326. core3 {
  327. cpu = <&CPU3>;
  328. };
  329. };
  330. cluster1 {
  331. core0 {
  332. cpu = <&CPU4>;
  333. };
  334. core1 {
  335. cpu = <&CPU5>;
  336. };
  337. core2 {
  338. cpu = <&CPU6>;
  339. };
  340. core3 {
  341. cpu = <&CPU7>;
  342. };
  343. };
  344. };
  345. CPU0: cpu@0 {
  346. device_type = "cpu";
  347. compatible = "arm,cortex-a15";
  348. reg = <0x0>;
  349. };
  350. CPU1: cpu@1 {
  351. device_type = "cpu";
  352. compatible = "arm,cortex-a15";
  353. reg = <0x1>;
  354. };
  355. CPU2: cpu@2 {
  356. device_type = "cpu";
  357. compatible = "arm,cortex-a15";
  358. reg = <0x2>;
  359. };
  360. CPU3: cpu@3 {
  361. device_type = "cpu";
  362. compatible = "arm,cortex-a15";
  363. reg = <0x3>;
  364. };
  365. CPU4: cpu@100 {
  366. device_type = "cpu";
  367. compatible = "arm,cortex-a7";
  368. reg = <0x100>;
  369. };
  370. CPU5: cpu@101 {
  371. device_type = "cpu";
  372. compatible = "arm,cortex-a7";
  373. reg = <0x101>;
  374. };
  375. CPU6: cpu@102 {
  376. device_type = "cpu";
  377. compatible = "arm,cortex-a7";
  378. reg = <0x102>;
  379. };
  380. CPU7: cpu@103 {
  381. device_type = "cpu";
  382. compatible = "arm,cortex-a7";
  383. reg = <0x103>;
  384. };
  385. };
  386. ===============================================================================
  387. [1] ARM Linux kernel documentation
  388. Documentation/devicetree/bindings/arm/cpus.txt