Path: blob/master/Documentation/devicetree/bindings/cpu/cpu-capacity.txt
26307 views
==========================================1CPU capacity bindings2==========================================34==========================================51 - Introduction6==========================================78Some systems may be configured to have cpus with different power/performance9characteristics within the same chip. In this case, additional information has10to be made available to the kernel for it to be aware of such differences and11take decisions accordingly.1213==========================================142 - CPU capacity definition15==========================================1617CPU capacity is a number that provides the scheduler information about CPUs18heterogeneity. Such heterogeneity can come from micro-architectural differences19(e.g., ARM big.LITTLE systems) or maximum frequency at which CPUs can run20(e.g., SMP systems with multiple frequency domains). Heterogeneity in this21context is about differing performance characteristics; this binding tries to22capture a first-order approximation of the relative performance of CPUs.2324CPU capacities are obtained by running a suitable benchmark. This binding makes25no guarantees on the validity or suitability of any particular benchmark, the26final capacity should, however, be:2728* A "single-threaded" or CPU affine benchmark29* Divided by the running frequency of the CPU executing the benchmark30* Not subject to dynamic frequency scaling of the CPU3132For the time being we however advise usage of the Dhrystone benchmark. What33above thus becomes:3435CPU capacities are obtained by running the Dhrystone benchmark on each CPU at36max frequency (with caches enabled). The obtained DMIPS score is then divided37by the frequency (in MHz) at which the benchmark has been run, so that38DMIPS/MHz are obtained. Such values are then normalized w.r.t. the highest39score obtained in the system.4041==========================================423 - capacity-dmips-mhz43==========================================4445capacity-dmips-mhz is an optional cpu node [1] property: u32 value46representing CPU capacity expressed in normalized DMIPS/MHz. At boot time, the47maximum frequency available to the cpu is then used to calculate the capacity48value internally used by the kernel.4950capacity-dmips-mhz property is all-or-nothing: if it is specified for a cpu51node, it has to be specified for every other cpu nodes, or the system will52fall back to the default capacity value for every CPU. If cpufreq is not53available, final capacities are calculated by directly using capacity-dmips-54mhz values (normalized w.r.t. the highest value found while parsing the DT).5556===========================================574 - Examples58===========================================5960Example 1 (ARM 64-bit, 6-cpu system, two clusters):61The capacities-dmips-mhz or DMIPS/MHz values (scaled to 1024)62are 1024 and 578 for cluster0 and cluster1. Further normalization63is done by the operating system based on cluster0@max-freq=1100 and64cluster1@max-freq=850, final capacities are 1024 for cluster0 and65446 for cluster1 (578*850/1100).6667cpus {68#address-cells = <2>;69#size-cells = <0>;7071cpu-map {72cluster0 {73core0 {74cpu = <&A57_0>;75};76core1 {77cpu = <&A57_1>;78};79};8081cluster1 {82core0 {83cpu = <&A53_0>;84};85core1 {86cpu = <&A53_1>;87};88core2 {89cpu = <&A53_2>;90};91core3 {92cpu = <&A53_3>;93};94};95};9697idle-states {98entry-method = "psci";99100CPU_SLEEP_0: cpu-sleep-0 {101compatible = "arm,idle-state";102arm,psci-suspend-param = <0x0010000>;103local-timer-stop;104entry-latency-us = <100>;105exit-latency-us = <250>;106min-residency-us = <150>;107};108109CLUSTER_SLEEP_0: cluster-sleep-0 {110compatible = "arm,idle-state";111arm,psci-suspend-param = <0x1010000>;112local-timer-stop;113entry-latency-us = <800>;114exit-latency-us = <700>;115min-residency-us = <2500>;116};117};118119A57_0: cpu@0 {120compatible = "arm,cortex-a57";121reg = <0x0 0x0>;122device_type = "cpu";123enable-method = "psci";124next-level-cache = <&A57_L2>;125clocks = <&scpi_dvfs 0>;126cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;127capacity-dmips-mhz = <1024>;128};129130A57_1: cpu@1 {131compatible = "arm,cortex-a57";132reg = <0x0 0x1>;133device_type = "cpu";134enable-method = "psci";135next-level-cache = <&A57_L2>;136clocks = <&scpi_dvfs 0>;137cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;138capacity-dmips-mhz = <1024>;139};140141A53_0: cpu@100 {142compatible = "arm,cortex-a53";143reg = <0x0 0x100>;144device_type = "cpu";145enable-method = "psci";146next-level-cache = <&A53_L2>;147clocks = <&scpi_dvfs 1>;148cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;149capacity-dmips-mhz = <578>;150};151152A53_1: cpu@101 {153compatible = "arm,cortex-a53";154reg = <0x0 0x101>;155device_type = "cpu";156enable-method = "psci";157next-level-cache = <&A53_L2>;158clocks = <&scpi_dvfs 1>;159cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;160capacity-dmips-mhz = <578>;161};162163A53_2: cpu@102 {164compatible = "arm,cortex-a53";165reg = <0x0 0x102>;166device_type = "cpu";167enable-method = "psci";168next-level-cache = <&A53_L2>;169clocks = <&scpi_dvfs 1>;170cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;171capacity-dmips-mhz = <578>;172};173174A53_3: cpu@103 {175compatible = "arm,cortex-a53";176reg = <0x0 0x103>;177device_type = "cpu";178enable-method = "psci";179next-level-cache = <&A53_L2>;180clocks = <&scpi_dvfs 1>;181cpu-idle-states = <&CPU_SLEEP_0 &CLUSTER_SLEEP_0>;182capacity-dmips-mhz = <578>;183};184185A57_L2: l2-cache0 {186compatible = "cache";187};188189A53_L2: l2-cache1 {190compatible = "cache";191};192};193194Example 2 (ARM 32-bit, 4-cpu system, two clusters,195cpus 0,1@1GHz, cpus 2,3@500MHz):196capacities-dmips-mhz are scaled w.r.t. 2 (cpu@0 and cpu@1), this means that first197cpu@0 and cpu@1 are twice fast than cpu@2 and cpu@3 (at the same frequency)198199cpus {200#address-cells = <1>;201#size-cells = <0>;202203cpu0: cpu@0 {204device_type = "cpu";205compatible = "arm,cortex-a15";206reg = <0>;207capacity-dmips-mhz = <2>;208};209210cpu1: cpu@1 {211device_type = "cpu";212compatible = "arm,cortex-a15";213reg = <1>;214capacity-dmips-mhz = <2>;215};216217cpu2: cpu@2 {218device_type = "cpu";219compatible = "arm,cortex-a15";220reg = <0x100>;221capacity-dmips-mhz = <1>;222};223224cpu3: cpu@3 {225device_type = "cpu";226compatible = "arm,cortex-a15";227reg = <0x101>;228capacity-dmips-mhz = <1>;229};230};231232===========================================2335 - References234===========================================235236[1] ARM Linux Kernel documentation - CPUs bindings237Documentation/devicetree/bindings/arm/cpus.yaml238239240