diff options
| -rw-r--r-- | arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts | 23 | ||||
| -rw-r--r-- | drivers/cpuidle/Kconfig.arm | 1 | ||||
| -rw-r--r-- | drivers/cpuidle/cpuidle-big_little.c | 19 |
3 files changed, 43 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts b/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts index a25c262326dc..322fd1519b09 100644 --- a/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts +++ b/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | compatible = "arm,cortex-a15"; | 38 | compatible = "arm,cortex-a15"; |
| 39 | reg = <0>; | 39 | reg = <0>; |
| 40 | cci-control-port = <&cci_control1>; | 40 | cci-control-port = <&cci_control1>; |
| 41 | cpu-idle-states = <&CLUSTER_SLEEP_BIG>; | ||
| 41 | }; | 42 | }; |
| 42 | 43 | ||
| 43 | cpu1: cpu@1 { | 44 | cpu1: cpu@1 { |
| @@ -45,6 +46,7 @@ | |||
| 45 | compatible = "arm,cortex-a15"; | 46 | compatible = "arm,cortex-a15"; |
| 46 | reg = <1>; | 47 | reg = <1>; |
| 47 | cci-control-port = <&cci_control1>; | 48 | cci-control-port = <&cci_control1>; |
| 49 | cpu-idle-states = <&CLUSTER_SLEEP_BIG>; | ||
| 48 | }; | 50 | }; |
| 49 | 51 | ||
| 50 | cpu2: cpu@2 { | 52 | cpu2: cpu@2 { |
| @@ -52,6 +54,7 @@ | |||
| 52 | compatible = "arm,cortex-a7"; | 54 | compatible = "arm,cortex-a7"; |
| 53 | reg = <0x100>; | 55 | reg = <0x100>; |
| 54 | cci-control-port = <&cci_control2>; | 56 | cci-control-port = <&cci_control2>; |
| 57 | cpu-idle-states = <&CLUSTER_SLEEP_LITTLE>; | ||
| 55 | }; | 58 | }; |
| 56 | 59 | ||
| 57 | cpu3: cpu@3 { | 60 | cpu3: cpu@3 { |
| @@ -59,6 +62,7 @@ | |||
| 59 | compatible = "arm,cortex-a7"; | 62 | compatible = "arm,cortex-a7"; |
| 60 | reg = <0x101>; | 63 | reg = <0x101>; |
| 61 | cci-control-port = <&cci_control2>; | 64 | cci-control-port = <&cci_control2>; |
| 65 | cpu-idle-states = <&CLUSTER_SLEEP_LITTLE>; | ||
| 62 | }; | 66 | }; |
| 63 | 67 | ||
| 64 | cpu4: cpu@4 { | 68 | cpu4: cpu@4 { |
| @@ -66,6 +70,25 @@ | |||
| 66 | compatible = "arm,cortex-a7"; | 70 | compatible = "arm,cortex-a7"; |
| 67 | reg = <0x102>; | 71 | reg = <0x102>; |
| 68 | cci-control-port = <&cci_control2>; | 72 | cci-control-port = <&cci_control2>; |
| 73 | cpu-idle-states = <&CLUSTER_SLEEP_LITTLE>; | ||
| 74 | }; | ||
| 75 | |||
| 76 | idle-states { | ||
| 77 | CLUSTER_SLEEP_BIG: cluster-sleep-big { | ||
| 78 | compatible = "arm,idle-state"; | ||
| 79 | local-timer-stop; | ||
| 80 | entry-latency-us = <1000>; | ||
| 81 | exit-latency-us = <700>; | ||
| 82 | min-residency-us = <2000>; | ||
| 83 | }; | ||
| 84 | |||
| 85 | CLUSTER_SLEEP_LITTLE: cluster-sleep-little { | ||
| 86 | compatible = "arm,idle-state"; | ||
| 87 | local-timer-stop; | ||
| 88 | entry-latency-us = <1000>; | ||
| 89 | exit-latency-us = <500>; | ||
| 90 | min-residency-us = <2500>; | ||
| 91 | }; | ||
| 69 | }; | 92 | }; |
| 70 | }; | 93 | }; |
| 71 | 94 | ||
diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm index 38cff69ffe06..e339c7f2c2b7 100644 --- a/drivers/cpuidle/Kconfig.arm +++ b/drivers/cpuidle/Kconfig.arm | |||
| @@ -7,6 +7,7 @@ config ARM_BIG_LITTLE_CPUIDLE | |||
| 7 | depends on MCPM | 7 | depends on MCPM |
| 8 | select ARM_CPU_SUSPEND | 8 | select ARM_CPU_SUSPEND |
| 9 | select CPU_IDLE_MULTIPLE_DRIVERS | 9 | select CPU_IDLE_MULTIPLE_DRIVERS |
| 10 | select DT_IDLE_STATES | ||
| 10 | help | 11 | help |
| 11 | Select this option to enable CPU idle driver for big.LITTLE based | 12 | Select this option to enable CPU idle driver for big.LITTLE based |
| 12 | ARM systems. Driver manages CPUs coordination through MCPM and | 13 | ARM systems. Driver manages CPUs coordination through MCPM and |
diff --git a/drivers/cpuidle/cpuidle-big_little.c b/drivers/cpuidle/cpuidle-big_little.c index 9342a94f417f..fbc00a1d3c48 100644 --- a/drivers/cpuidle/cpuidle-big_little.c +++ b/drivers/cpuidle/cpuidle-big_little.c | |||
| @@ -24,6 +24,8 @@ | |||
| 24 | #include <asm/smp_plat.h> | 24 | #include <asm/smp_plat.h> |
| 25 | #include <asm/suspend.h> | 25 | #include <asm/suspend.h> |
| 26 | 26 | ||
| 27 | #include "dt_idle_states.h" | ||
| 28 | |||
| 27 | static int bl_enter_powerdown(struct cpuidle_device *dev, | 29 | static int bl_enter_powerdown(struct cpuidle_device *dev, |
| 28 | struct cpuidle_driver *drv, int idx); | 30 | struct cpuidle_driver *drv, int idx); |
| 29 | 31 | ||
| @@ -73,6 +75,12 @@ static struct cpuidle_driver bl_idle_little_driver = { | |||
| 73 | .state_count = 2, | 75 | .state_count = 2, |
| 74 | }; | 76 | }; |
| 75 | 77 | ||
| 78 | static const struct of_device_id bl_idle_state_match[] __initconst = { | ||
| 79 | { .compatible = "arm,idle-state", | ||
| 80 | .data = bl_enter_powerdown }, | ||
| 81 | { }, | ||
| 82 | }; | ||
| 83 | |||
| 76 | static struct cpuidle_driver bl_idle_big_driver = { | 84 | static struct cpuidle_driver bl_idle_big_driver = { |
| 77 | .name = "big_idle", | 85 | .name = "big_idle", |
| 78 | .owner = THIS_MODULE, | 86 | .owner = THIS_MODULE, |
| @@ -191,6 +199,17 @@ static int __init bl_idle_init(void) | |||
| 191 | if (ret) | 199 | if (ret) |
| 192 | goto out_uninit_little; | 200 | goto out_uninit_little; |
| 193 | 201 | ||
| 202 | /* Start at index 1, index 0 standard WFI */ | ||
| 203 | ret = dt_init_idle_driver(&bl_idle_big_driver, bl_idle_state_match, 1); | ||
| 204 | if (ret < 0) | ||
| 205 | goto out_uninit_big; | ||
| 206 | |||
| 207 | /* Start at index 1, index 0 standard WFI */ | ||
| 208 | ret = dt_init_idle_driver(&bl_idle_little_driver, | ||
| 209 | bl_idle_state_match, 1); | ||
| 210 | if (ret < 0) | ||
| 211 | goto out_uninit_big; | ||
| 212 | |||
| 194 | ret = cpuidle_register(&bl_idle_little_driver, NULL); | 213 | ret = cpuidle_register(&bl_idle_little_driver, NULL); |
| 195 | if (ret) | 214 | if (ret) |
| 196 | goto out_uninit_big; | 215 | goto out_uninit_big; |
