]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
drivers: cpuidle: initialize big.LITTLE driver through DT
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tue, 24 Jun 2014 15:20:28 +0000 (16:20 +0100)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 25 Sep 2014 08:52:21 +0000 (10:52 +0200)
With the introduction of DT based idle states, CPUidle drivers for ARM
can now initialize idle states data through properties in the device tree.

This patch adds code to the big.LITTLE CPUidle driver to dynamically
initialize idle states data through the updated device tree source file.

Cc: Chander Kashyap <k.chander@samsung.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
drivers/cpuidle/Kconfig.arm
drivers/cpuidle/cpuidle-big_little.c

index a25c262326dcdcc2e681f6f2e900de8ea59891a2..322fd1519b09fe049a731b662de2408ff37074ff 100644 (file)
@@ -38,6 +38,7 @@
                        compatible = "arm,cortex-a15";
                        reg = <0>;
                        cci-control-port = <&cci_control1>;
+                       cpu-idle-states = <&CLUSTER_SLEEP_BIG>;
                };
 
                cpu1: cpu@1 {
@@ -45,6 +46,7 @@
                        compatible = "arm,cortex-a15";
                        reg = <1>;
                        cci-control-port = <&cci_control1>;
+                       cpu-idle-states = <&CLUSTER_SLEEP_BIG>;
                };
 
                cpu2: cpu@2 {
@@ -52,6 +54,7 @@
                        compatible = "arm,cortex-a7";
                        reg = <0x100>;
                        cci-control-port = <&cci_control2>;
+                       cpu-idle-states = <&CLUSTER_SLEEP_LITTLE>;
                };
 
                cpu3: cpu@3 {
@@ -59,6 +62,7 @@
                        compatible = "arm,cortex-a7";
                        reg = <0x101>;
                        cci-control-port = <&cci_control2>;
+                       cpu-idle-states = <&CLUSTER_SLEEP_LITTLE>;
                };
 
                cpu4: cpu@4 {
                        compatible = "arm,cortex-a7";
                        reg = <0x102>;
                        cci-control-port = <&cci_control2>;
+                       cpu-idle-states = <&CLUSTER_SLEEP_LITTLE>;
+               };
+
+               idle-states {
+                       CLUSTER_SLEEP_BIG: cluster-sleep-big {
+                               compatible = "arm,idle-state";
+                               local-timer-stop;
+                               entry-latency-us = <1000>;
+                               exit-latency-us = <700>;
+                               min-residency-us = <2000>;
+                       };
+
+                       CLUSTER_SLEEP_LITTLE: cluster-sleep-little {
+                               compatible = "arm,idle-state";
+                               local-timer-stop;
+                               entry-latency-us = <1000>;
+                               exit-latency-us = <500>;
+                               min-residency-us = <2500>;
+                       };
                };
        };
 
index 38cff69ffe06bfeace68468f9f9cdca88a0dbaf5..e339c7f2c2b7939a99fcd825a3a296249afc96b2 100644 (file)
@@ -7,6 +7,7 @@ config ARM_BIG_LITTLE_CPUIDLE
        depends on MCPM
        select ARM_CPU_SUSPEND
        select CPU_IDLE_MULTIPLE_DRIVERS
+       select DT_IDLE_STATES
        help
          Select this option to enable CPU idle driver for big.LITTLE based
          ARM systems. Driver manages CPUs coordination through MCPM and
index 9342a94f417f43b474da1b326836cd14bd3f840b..fbc00a1d3c486a5e9d98f31ebecaf5149b2f3d5c 100644 (file)
@@ -24,6 +24,8 @@
 #include <asm/smp_plat.h>
 #include <asm/suspend.h>
 
+#include "dt_idle_states.h"
+
 static int bl_enter_powerdown(struct cpuidle_device *dev,
                              struct cpuidle_driver *drv, int idx);
 
@@ -73,6 +75,12 @@ static struct cpuidle_driver bl_idle_little_driver = {
        .state_count = 2,
 };
 
+static const struct of_device_id bl_idle_state_match[] __initconst = {
+       { .compatible = "arm,idle-state",
+         .data = bl_enter_powerdown },
+       { },
+};
+
 static struct cpuidle_driver bl_idle_big_driver = {
        .name = "big_idle",
        .owner = THIS_MODULE,
@@ -191,6 +199,17 @@ static int __init bl_idle_init(void)
        if (ret)
                goto out_uninit_little;
 
+       /* Start at index 1, index 0 standard WFI */
+       ret = dt_init_idle_driver(&bl_idle_big_driver, bl_idle_state_match, 1);
+       if (ret < 0)
+               goto out_uninit_big;
+
+       /* Start at index 1, index 0 standard WFI */
+       ret = dt_init_idle_driver(&bl_idle_little_driver,
+                                 bl_idle_state_match, 1);
+       if (ret < 0)
+               goto out_uninit_big;
+
        ret = cpuidle_register(&bl_idle_little_driver, NULL);
        if (ret)
                goto out_uninit_big;