@@ -48,12 +48,23 @@
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <0x900>;
+ cpu-idle-states = <&CLUSTER_SLEEP_0>;
};
cpu@901 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <0x901>;
+ cpu-idle-states = <&CLUSTER_SLEEP_0>;
+ };
+
+ idle-states {
+ CLUSTER_SLEEP_0: cluster-sleep-0 {
+ compatible = "arm,idle-state";
+ entry-latency-us = <1000>;
+ exit-latency-us = <300>;
+ min-residency-us = <100000>;
+ };
};
};
@@ -63,12 +63,23 @@
compatible = "arm,cortex-a15";
reg = <0>;
clock-frequency = <1700000000>;
+ cpu-idle-states = <&CLUSTER_SLEEP_0>;
};
cpu@1 {
device_type = "cpu";
compatible = "arm,cortex-a15";
reg = <1>;
clock-frequency = <1700000000>;
+ cpu-idle-states = <&CLUSTER_SLEEP_0>;
+ };
+
+ idle-states {
+ CLUSTER_SLEEP_0: cluster-sleep-0 {
+ compatible = "arm,idle-state";
+ entry-latency-us = <1000>;
+ exit-latency-us = <300>;
+ min-residency-us = <100000>;
+ };
};
};
@@ -55,6 +55,7 @@ config ARM_AT91_CPUIDLE
config ARM_EXYNOS_CPUIDLE
bool "Cpu Idle Driver for the Exynos processors"
depends on ARCH_EXYNOS
+ select DT_IDLE_STATES
help
Select this to enable cpuidle for Exynos processors
@@ -18,6 +18,8 @@
#include <asm/suspend.h>
#include <asm/cpuidle.h>
+#include "dt_idle_states.h"
+
static void (*exynos_enter_aftr)(void);
static int exynos_enter_lowpower(struct cpuidle_device *dev,
@@ -56,13 +58,27 @@ static struct cpuidle_driver exynos_idle_driver = {
.safe_state_index = 0,
};
+static const struct of_device_id exynos_idle_state_match[] __initconst = {
+ { .compatible = "arm,idle-state",
+ .data = exynos_enter_lowpower },
+ { },
+};
+
static int exynos_cpuidle_probe(struct platform_device *pdev)
{
int ret;
+ struct cpuidle_driver *drv = &exynos_idle_driver;
exynos_enter_aftr = (void *)(pdev->dev.platform_data);
- ret = cpuidle_register(&exynos_idle_driver, NULL);
+ /* Start at index 1, index 0 standard WFI */
+ ret = dt_init_idle_driver(drv, exynos_idle_state_match, 1);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to initialize idle states\n");
+ return ret;
+ }
+
+ ret = cpuidle_register(drv, NULL);
if (ret) {
dev_err(&pdev->dev, "failed to register cpuidle driver\n");
return ret;