Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable cpuidle driver on XU3/4 #357

Open
wants to merge 3 commits into
base: odroidxu4-4.14.y
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/arm/configs/odroidxu4_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ CONFIG_CPU_IDLE_GOV_MENU=y
# CONFIG_ARM_CPUIDLE is not set
# CONFIG_ARM_BIG_LITTLE_CPUIDLE is not set
CONFIG_ARM_EXYNOS_CPUIDLE=y
CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED=y
# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set

#
# Floating point emulation
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/mach-exynos/exynos.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ static void __init exynos_dt_machine_init(void)
(of_machine_is_compatible("samsung,exynos4412") &&
of_machine_is_compatible("samsung,trats2")) ||
of_machine_is_compatible("samsung,exynos3250") ||
of_machine_is_compatible("samsung,exynos5250"))
of_machine_is_compatible("samsung,exynos5250") ||
of_machine_is_compatible("hardkernel,odroid-xu3") ||
of_machine_is_compatible("hardkernel,odroid-xu3-lite") ||
of_machine_is_compatible("hardkernel,odroid-xu4"))
platform_device_register(&exynos_cpuidle);
}

Expand Down
24 changes: 23 additions & 1 deletion drivers/cpuidle/cpuidle-exynos.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ static int exynos_enter_lowpower(struct cpuidle_device *dev,
return new_index;
}

static struct cpuidle_driver exynos_idle_driver_5422 = {
.name = "exynos_idle",
.owner = THIS_MODULE,
.states = {
[0] = {
.enter = arm_cpuidle_simple_enter,
.exit_latency = 1,
.target_residency = 500,
.name = "WFI",
.desc = "ARM clock gating",
},
},
.state_count = 1,
};

static struct cpuidle_driver exynos_idle_driver = {
.name = "exynos_idle",
.owner = THIS_MODULE,
Expand Down Expand Up @@ -125,7 +140,14 @@ static int exynos_cpuidle_probe(struct platform_device *pdev)
} else {
exynos_enter_aftr = (void *)(pdev->dev.platform_data);

ret = cpuidle_register(&exynos_idle_driver, NULL);
if (of_machine_is_compatible("hardkernel,odroid-xu3") ||
of_machine_is_compatible("hardkernel,odroid-xu3-lite") ||
of_machine_is_compatible("hardkernel,odroid-xu4")) {

ret = cpuidle_register(&exynos_idle_driver_5422, NULL);
} else {
ret = cpuidle_register(&exynos_idle_driver, NULL);
}
}

if (ret) {
Expand Down