From a55373b86af5464ea12c44531623c8a4fb3ae6a2 Mon Sep 17 00:00:00 2001 From: DarkBahamut Date: Wed, 27 Jun 2018 23:18:14 +0100 Subject: [PATCH 1/3] arm: exynos: Add odroid xu3/4 to cpuidle driver --- arch/arm/mach-exynos/exynos.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index 6197dbf9f48b99..c1e6d332578f9d 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -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); } From b68fdeb5e3041c4c702eb5d3b894aa1d067f7dd6 Mon Sep 17 00:00:00 2001 From: DarkBahamut Date: Wed, 27 Jun 2018 23:23:23 +0100 Subject: [PATCH 2/3] config: odroid xu3/4: Remove coupled cpuidle from config --- arch/arm/configs/odroidxu4_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/configs/odroidxu4_defconfig b/arch/arm/configs/odroidxu4_defconfig index 7f6cf5576bf5a7..97b775f0a02e4b 100644 --- a/arch/arm/configs/odroidxu4_defconfig +++ b/arch/arm/configs/odroidxu4_defconfig @@ -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 From 602850843fab1c47a12be6a47f83bb8d2381fed3 Mon Sep 17 00:00:00 2001 From: DarkBahamut Date: Wed, 27 Jun 2018 23:26:10 +0100 Subject: [PATCH 3/3] cpuidle: exynos: Setup idle state for odroid xu3/4 --- drivers/cpuidle/cpuidle-exynos.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/cpuidle/cpuidle-exynos.c b/drivers/cpuidle/cpuidle-exynos.c index 00cd129b10a461..b59cc287119991 100644 --- a/drivers/cpuidle/cpuidle-exynos.c +++ b/drivers/cpuidle/cpuidle-exynos.c @@ -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, @@ -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) {