1 ===========================================
2 CPU topology binding description
3 ===========================================
5 ===========================================
7 ===========================================
9 In a SMP system, the hierarchy of CPUs is defined through three entities that
10 are used to describe the layout of physical CPUs in the system:
17 The bottom hierarchy level sits at core or thread level depending on whether
18 symmetric multi-threading (SMT) is supported or not.
20 For instance in a system where CPUs support SMT, "cpu" nodes represent all
21 threads existing in the system and map to the hierarchy level "thread" above.
22 In systems where SMT is not supported "cpu" nodes represent all cores present
23 in the system and map to the hierarchy level "core" above.
25 CPU topology bindings allow one to associate cpu nodes with hierarchical groups
26 corresponding to the system hierarchy; syntactically they are defined as device
29 Currently, only ARM/RISC-V intend to use this cpu topology binding but it may be
30 used for any other architecture as well.
32 The cpu nodes, as per bindings defined in [4], represent the devices that
33 correspond to physical CPUs and are to be mapped to the hierarchy levels.
35 A topology description containing phandles to cpu nodes that are not compliant
36 with bindings standardized in [4] is therefore considered invalid.
38 ===========================================
40 ===========================================
42 The ARM/RISC-V CPU topology is defined within the cpu-map node, which is a direct
43 child of the cpus node and provides a container where the actual topology
48 Usage: Optional - On SMP systems provide CPUs topology to the OS.
49 Uniprocessor systems do not require a topology
50 description and therefore should not define a
53 Description: The cpu-map node is just a container node where its
54 subnodes describe the CPU topology.
56 Node name must be "cpu-map".
58 The cpu-map node's parent node must be the cpus node.
60 The cpu-map node's child nodes can be:
62 - one or more cluster nodes or
63 - one or more socket nodes in a multi-socket system
65 Any other configuration is considered invalid.
67 The cpu-map node can only contain 4 types of child nodes:
74 whose bindings are described in paragraph 3.
76 The nodes describing the CPU topology (socket/cluster/core/thread) can
77 only be defined within the cpu-map node and every core/thread in the
78 system must be defined within the topology. Any other configuration is
79 invalid and therefore must be ignored.
81 ===========================================
82 2.1 - cpu-map child nodes naming convention
83 ===========================================
85 cpu-map child nodes must follow a naming convention where the node name
86 must be "socketN", "clusterN", "coreN", "threadN" depending on the node type
87 (ie socket/cluster/core/thread) (where N = {0, 1, ...} is the node number; nodes
88 which are siblings within a single common parent node must be given a unique and
89 sequential N value, starting from 0).
90 cpu-map child nodes which do not share a common parent node can have the same
91 name (ie same number N as other cpu-map child nodes at different device tree
92 levels) since name uniqueness will be guaranteed by the device tree hierarchy.
94 ===========================================
95 3 - socket/cluster/core/thread node bindings
96 ===========================================
98 Bindings for socket/cluster/cpu/thread nodes are defined as follows:
102 Description: must be declared within a cpu-map node, one node
103 per physical socket in the system. A system can
104 contain single or multiple physical socket.
105 The association of sockets and NUMA nodes is beyond
106 the scope of this bindings, please refer [2] for
109 This node is optional for a single socket system.
111 The socket node name must be "socketN" as described in 2.1 above.
112 A socket node can not be a leaf node.
114 A socket node's child nodes must be one or more cluster nodes.
116 Any other configuration is considered invalid.
120 Description: must be declared within a cpu-map node, one node
121 per cluster. A system can contain several layers of
122 clustering within a single physical socket and cluster
123 nodes can be contained in parent cluster nodes.
125 The cluster node name must be "clusterN" as described in 2.1 above.
126 A cluster node can not be a leaf node.
128 A cluster node's child nodes must be:
130 - one or more cluster nodes; or
131 - one or more core nodes
133 Any other configuration is considered invalid.
137 Description: must be declared in a cluster node, one node per core in
138 the cluster. If the system does not support SMT, core
139 nodes are leaf nodes, otherwise they become containers of
142 The core node name must be "coreN" as described in 2.1 above.
144 A core node must be a leaf node if SMT is not supported.
146 Properties for core nodes that are leaf nodes:
150 Value type: <phandle>
151 Definition: a phandle to the cpu node that corresponds to the
154 If a core node is not a leaf node (CPUs supporting SMT) a core node's
157 - one or more thread nodes
159 Any other configuration is considered invalid.
163 Description: must be declared in a core node, one node per thread
164 in the core if the system supports SMT. Thread nodes are
165 always leaf nodes in the device tree.
167 The thread node name must be "threadN" as described in 2.1 above.
169 A thread node must be a leaf node.
171 A thread node must contain the following property:
175 Value type: <phandle>
176 Definition: a phandle to the cpu node that corresponds to
179 ===========================================
181 ===========================================
183 Example 1 (ARM 64-bit, 16-cpu system, two clusters of clusters in a single
188 #address-cells = <2>;
278 compatible = "arm,cortex-a57";
280 enable-method = "spin-table";
281 cpu-release-addr = <0 0x20000000>;
286 compatible = "arm,cortex-a57";
288 enable-method = "spin-table";
289 cpu-release-addr = <0 0x20000000>;
294 compatible = "arm,cortex-a57";
296 enable-method = "spin-table";
297 cpu-release-addr = <0 0x20000000>;
302 compatible = "arm,cortex-a57";
304 enable-method = "spin-table";
305 cpu-release-addr = <0 0x20000000>;
310 compatible = "arm,cortex-a57";
312 enable-method = "spin-table";
313 cpu-release-addr = <0 0x20000000>;
318 compatible = "arm,cortex-a57";
320 enable-method = "spin-table";
321 cpu-release-addr = <0 0x20000000>;
326 compatible = "arm,cortex-a57";
328 enable-method = "spin-table";
329 cpu-release-addr = <0 0x20000000>;
334 compatible = "arm,cortex-a57";
336 enable-method = "spin-table";
337 cpu-release-addr = <0 0x20000000>;
340 CPU8: cpu@100000000 {
342 compatible = "arm,cortex-a57";
344 enable-method = "spin-table";
345 cpu-release-addr = <0 0x20000000>;
348 CPU9: cpu@100000001 {
350 compatible = "arm,cortex-a57";
352 enable-method = "spin-table";
353 cpu-release-addr = <0 0x20000000>;
356 CPU10: cpu@100000100 {
358 compatible = "arm,cortex-a57";
360 enable-method = "spin-table";
361 cpu-release-addr = <0 0x20000000>;
364 CPU11: cpu@100000101 {
366 compatible = "arm,cortex-a57";
368 enable-method = "spin-table";
369 cpu-release-addr = <0 0x20000000>;
372 CPU12: cpu@100010000 {
374 compatible = "arm,cortex-a57";
376 enable-method = "spin-table";
377 cpu-release-addr = <0 0x20000000>;
380 CPU13: cpu@100010001 {
382 compatible = "arm,cortex-a57";
384 enable-method = "spin-table";
385 cpu-release-addr = <0 0x20000000>;
388 CPU14: cpu@100010100 {
390 compatible = "arm,cortex-a57";
392 enable-method = "spin-table";
393 cpu-release-addr = <0 0x20000000>;
396 CPU15: cpu@100010101 {
398 compatible = "arm,cortex-a57";
400 enable-method = "spin-table";
401 cpu-release-addr = <0 0x20000000>;
405 Example 2 (ARM 32-bit, dual-cluster, 8-cpu system, no SMT):
409 #address-cells = <1>;
445 compatible = "arm,cortex-a15";
451 compatible = "arm,cortex-a15";
457 compatible = "arm,cortex-a15";
463 compatible = "arm,cortex-a15";
469 compatible = "arm,cortex-a7";
475 compatible = "arm,cortex-a7";
481 compatible = "arm,cortex-a7";
487 compatible = "arm,cortex-a7";
492 Example 3: HiFive Unleashed (RISC-V 64 bit, 4 core system)
495 #address-cells = <2>;
497 compatible = "sifive,fu540g", "sifive,fu500";
498 model = "sifive,hifive-unleashed-a00";
502 #address-cells = <1>;
525 compatible = "sifive,rocket0", "riscv";
531 compatible = "sifive,rocket0", "riscv";
536 compatible = "sifive,rocket0", "riscv";
541 compatible = "sifive,rocket0", "riscv";
546 ===============================================================================
547 [1] ARM Linux kernel documentation
548 Documentation/devicetree/bindings/arm/cpus.yaml
549 [2] Devicetree NUMA binding description
550 Documentation/devicetree/bindings/numa.txt
551 [3] RISC-V Linux kernel documentation
552 Documentation/devicetree/bindings/riscv/cpus.yaml
553 [4] https://www.devicetree.org/specifications/