cpu-capacity.txt 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. ==========================================
  2. ARM CPUs capacity bindings
  3. ==========================================
  4. ==========================================
  5. 1 - Introduction
  6. ==========================================
  7. ARM systems may be configured to have cpus with different power/performance
  8. characteristics within the same chip. In this case, additional information has
  9. to be made available to the kernel for it to be aware of such differences and
  10. take decisions accordingly.
  11. ==========================================
  12. 2 - CPU capacity definition
  13. ==========================================
  14. CPU capacity is a number that provides the scheduler information about CPUs
  15. heterogeneity. Such heterogeneity can come from micro-architectural differences
  16. (e.g., ARM big.LITTLE systems) or maximum frequency at which CPUs can run
  17. (e.g., SMP systems with multiple frequency domains). Heterogeneity in this
  18. context is about differing performance characteristics; this binding tries to
  19. capture a first-order approximation of the relative performance of CPUs.
  20. CPU capacities are obtained by running a suitable benchmark. This binding makes
  21. no guarantees on the validity or suitability of any particular benchmark, the
  22. final capacity should, however, be:
  23. * A "single-threaded" or CPU affine benchmark
  24. * Divided by the running frequency of the CPU executing the benchmark
  25. * Not subject to dynamic frequency scaling of the CPU
  26. For the time being we however advise usage of the Dhrystone benchmark. What
  27. above thus becomes:
  28. CPU capacities are obtained by running the Dhrystone benchmark on each CPU at
  29. max frequency (with caches enabled). The obtained DMIPS score is then divided
  30. by the frequency (in MHz) at which the benchmark has been run, so that
  31. DMIPS/MHz are obtained. Such values are then normalized w.r.t. the highest
  32. score obtained in the system.
  33. ==========================================
  34. 3 - capacity-dmips-mhz
  35. ==========================================
  36. capacity-dmips-mhz is an optional cpu node [1] property: u32 value
  37. representing CPU capacity expressed in normalized DMIPS/MHz. At boot time, the
  38. maximum frequency available to the cpu is then used to calculate the capacity
  39. value internally used by the kernel.
  40. capacity-dmips-mhz property is all-or-nothing: if it is specified for a cpu
  41. node, it has to be specified for every other cpu nodes, or the system will
  42. fall back to the default capacity value for every CPU. If cpufreq is not
  43. available, final capacities are calculated by directly using capacity-dmips-
  44. mhz values (normalized w.r.t. the highest value found while parsing the DT).
  45. ===========================================
  46. 4 - Examples
  47. ===========================================
  48. Example 1 (ARM 64-bit, 6-cpu system, two clusters):
  49. capacities-dmips-mhz are scaled w.r.t. 1024 (cpu@0 and cpu@1)
  50. supposing cluster0@max-freq=1100 and custer1@max-freq=850,
  51. final capacities are 1024 for cluster0 and 446 for cluster1
  52. cpus {
  53. #address-cells = <2>;
  54. #size-cells = <0>;
  55. cpu-map {
  56. cluster0 {
  57. core0 {
  58. cpu = <&A57_0>;
  59. };
  60. core1 {
  61. cpu = <&A57_1>;
  62. };
  63. };
  64. cluster1 {
  65. core0 {
  66. cpu = <&A53_0>;
  67. };
  68. core1 {
  69. cpu = <&A53_1>;
  70. };
  71. core2 {
  72. cpu = <&A53_2>;
  73. };
  74. core3 {
  75. cpu = <&A53_3>;
  76. };
  77. };
  78. };
  79. idle-states {
  80. entry-method = "psci";
  81. CPU_SLEEP_0: cpu-sleep-0 {
  82. compatible = "arm,idle-state";
  83. arm,psci-suspend-param = <0x0010000>;
  84. local-timer-stop;
  85. entry-latency-us = <100>;
  86. exit-latency-us = <250>;
  87. min-residency-us = <150>;
  88. };
  89. CLUSTER_SLEEP_0: cluster-sleep-0 {
  90. compatible = "arm,idle-state";
  91. arm,psci-suspend-param = <0x1010000>;
  92. local-timer-stop;
  93. entry-latency-us = <800>;
  94. exit-latency-us = <700>;
  95. min-residency-us = <2500>;
  96. };
  97. };
  98. A57_0: cpu@0 {
  99. compatible = "arm,cortex-a57","arm,armv8";
  100. reg = <0x0 0x0>;
  101. device_type = "cpu";
  102. enable-method = "psci";
  103. next-level-cache = <&A57_L2>;
  104. clocks = <&scpi_dvfs 0>;
  105. cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
  106. capacity-dmips-mhz = <1024>;
  107. };
  108. A57_1: cpu@1 {
  109. compatible = "arm,cortex-a57","arm,armv8";
  110. reg = <0x0 0x1>;
  111. device_type = "cpu";
  112. enable-method = "psci";
  113. next-level-cache = <&A57_L2>;
  114. clocks = <&scpi_dvfs 0>;
  115. cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
  116. capacity-dmips-mhz = <1024>;
  117. };
  118. A53_0: cpu@100 {
  119. compatible = "arm,cortex-a53","arm,armv8";
  120. reg = <0x0 0x100>;
  121. device_type = "cpu";
  122. enable-method = "psci";
  123. next-level-cache = <&A53_L2>;
  124. clocks = <&scpi_dvfs 1>;
  125. cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
  126. capacity-dmips-mhz = <578>;
  127. };
  128. A53_1: cpu@101 {
  129. compatible = "arm,cortex-a53","arm,armv8";
  130. reg = <0x0 0x101>;
  131. device_type = "cpu";
  132. enable-method = "psci";
  133. next-level-cache = <&A53_L2>;
  134. clocks = <&scpi_dvfs 1>;
  135. cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
  136. capacity-dmips-mhz = <578>;
  137. };
  138. A53_2: cpu@102 {
  139. compatible = "arm,cortex-a53","arm,armv8";
  140. reg = <0x0 0x102>;
  141. device_type = "cpu";
  142. enable-method = "psci";
  143. next-level-cache = <&A53_L2>;
  144. clocks = <&scpi_dvfs 1>;
  145. cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
  146. capacity-dmips-mhz = <578>;
  147. };
  148. A53_3: cpu@103 {
  149. compatible = "arm,cortex-a53","arm,armv8";
  150. reg = <0x0 0x103>;
  151. device_type = "cpu";
  152. enable-method = "psci";
  153. next-level-cache = <&A53_L2>;
  154. clocks = <&scpi_dvfs 1>;
  155. cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;
  156. capacity-dmips-mhz = <578>;
  157. };
  158. A57_L2: l2-cache0 {
  159. compatible = "cache";
  160. };
  161. A53_L2: l2-cache1 {
  162. compatible = "cache";
  163. };
  164. };
  165. Example 2 (ARM 32-bit, 4-cpu system, two clusters,
  166. cpus 0,1@1GHz, cpus 2,3@500MHz):
  167. capacities-dmips-mhz are scaled w.r.t. 2 (cpu@0 and cpu@1), this means that first
  168. cpu@0 and cpu@1 are twice fast than cpu@2 and cpu@3 (at the same frequency)
  169. cpus {
  170. #address-cells = <1>;
  171. #size-cells = <0>;
  172. cpu0: cpu@0 {
  173. device_type = "cpu";
  174. compatible = "arm,cortex-a15";
  175. reg = <0>;
  176. capacity-dmips-mhz = <2>;
  177. };
  178. cpu1: cpu@1 {
  179. device_type = "cpu";
  180. compatible = "arm,cortex-a15";
  181. reg = <1>;
  182. capacity-dmips-mhz = <2>;
  183. };
  184. cpu2: cpu@2 {
  185. device_type = "cpu";
  186. compatible = "arm,cortex-a15";
  187. reg = <0x100>;
  188. capacity-dmips-mhz = <1>;
  189. };
  190. cpu3: cpu@3 {
  191. device_type = "cpu";
  192. compatible = "arm,cortex-a15";
  193. reg = <0x101>;
  194. capacity-dmips-mhz = <1>;
  195. };
  196. };
  197. ===========================================
  198. 5 - References
  199. ===========================================
  200. [1] ARM Linux Kernel documentation - CPUs bindings
  201. Documentation/devicetree/bindings/arm/cpus.txt