Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'v3.17-next/cpuidle-exynos' into v3.17-next/power-exynos

+60 -3
+3 -1
arch/arm/mach-exynos/exynos.c
··· 335 335 if (!IS_ENABLED(CONFIG_SMP)) 336 336 exynos_sysram_init(); 337 337 338 - exynos_cpuidle_init(); 338 + if (!of_machine_is_compatible("samsung,exynos5420")) 339 + exynos_cpuidle_init(); 340 + 339 341 exynos_cpufreq_init(); 340 342 341 343 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+36
arch/arm/mach-exynos/mcpm-exynos.c
··· 257 257 return -ETIMEDOUT; /* timeout */ 258 258 } 259 259 260 + static void exynos_powered_up(void) 261 + { 262 + unsigned int mpidr, cpu, cluster; 263 + 264 + mpidr = read_cpuid_mpidr(); 265 + cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); 266 + cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); 267 + 268 + arch_spin_lock(&exynos_mcpm_lock); 269 + if (cpu_use_count[cpu][cluster] == 0) 270 + cpu_use_count[cpu][cluster] = 1; 271 + arch_spin_unlock(&exynos_mcpm_lock); 272 + } 273 + 274 + static void exynos_suspend(u64 residency) 275 + { 276 + unsigned int mpidr, cpunr; 277 + 278 + exynos_power_down(); 279 + 280 + /* 281 + * Execution reaches here only if cpu did not power down. 282 + * Hence roll back the changes done in exynos_power_down function. 283 + * 284 + * CAUTION: "This function requires the stack data to be visible through 285 + * power down and can only be executed on processors like A15 and A7 286 + * that hit the cache with the C bit clear in the SCTLR register." 287 + */ 288 + mpidr = read_cpuid_mpidr(); 289 + cpunr = exynos_pmu_cpunr(mpidr); 290 + 291 + exynos_cpu_power_up(cpunr); 292 + } 293 + 260 294 static const struct mcpm_platform_ops exynos_power_ops = { 261 295 .power_up = exynos_power_up, 262 296 .power_down = exynos_power_down, 263 297 .wait_for_powerdown = exynos_wait_for_powerdown, 298 + .suspend = exynos_suspend, 299 + .powered_up = exynos_powered_up, 264 300 }; 265 301 266 302 static void __init exynos_mcpm_usage_count_init(void)
+9
arch/arm/mach-exynos/regs-pmu.h
··· 319 319 320 320 #define EXYNOS5420_SWRESET_KFC_SEL 0x3 321 321 322 + #include <asm/cputype.h> 323 + #define MAX_CPUS_IN_CLUSTER 4 324 + 325 + static inline unsigned int exynos_pmu_cpunr(unsigned int mpidr) 326 + { 327 + return ((MPIDR_AFFINITY_LEVEL(mpidr, 1) * MAX_CPUS_IN_CLUSTER) 328 + + MPIDR_AFFINITY_LEVEL(mpidr, 0)); 329 + } 330 + 322 331 #endif /* __ASM_ARCH_REGS_PMU_H */
+1 -1
drivers/cpuidle/Kconfig.arm
··· 9 9 10 10 config ARM_BIG_LITTLE_CPUIDLE 11 11 bool "Support for ARM big.LITTLE processors" 12 - depends on ARCH_VEXPRESS_TC2_PM 12 + depends on ARCH_VEXPRESS_TC2_PM || ARCH_EXYNOS 13 13 select ARM_CPU_SUSPEND 14 14 select CPU_IDLE_MULTIPLE_DRIVERS 15 15 help
+11 -1
drivers/cpuidle/cpuidle-big_little.c
··· 163 163 return 0; 164 164 } 165 165 166 + static const struct of_device_id compatible_machine_match[] = { 167 + { .compatible = "arm,vexpress,v2p-ca15_a7" }, 168 + { .compatible = "samsung,exynos5420" }, 169 + {}, 170 + }; 171 + 166 172 static int __init bl_idle_init(void) 167 173 { 168 174 int ret; 175 + struct device_node *root = of_find_node_by_path("/"); 176 + 177 + if (!root) 178 + return -ENODEV; 169 179 170 180 /* 171 181 * Initialize the driver just for a compliant set of machines 172 182 */ 173 - if (!of_machine_is_compatible("arm,vexpress,v2p-ca15_a7")) 183 + if (!of_match_node(compatible_machine_match, root)) 174 184 return -ENODEV; 175 185 /* 176 186 * For now the differentiation between little and big cores