aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos/pmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-exynos/pmu.c')
-rw-r--r--arch/arm/mach-exynos/pmu.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index db4dc515e416..4aacb66f7161 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -11,6 +11,7 @@
11 11
12#include <linux/io.h> 12#include <linux/io.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/bug.h>
14 15
15#include <mach/regs-clock.h> 16#include <mach/regs-clock.h>
16#include <mach/pmu.h> 17#include <mach/pmu.h>
@@ -314,10 +315,68 @@ static struct exynos_pmu_conf exynos5250_pmu_config[] = {
314 { PMU_TABLE_END,}, 315 { PMU_TABLE_END,},
315}; 316};
316 317
318void __iomem *exynos5_list_both_cnt_feed[] = {
319 EXYNOS5_ARM_CORE0_OPTION,
320 EXYNOS5_ARM_CORE1_OPTION,
321 EXYNOS5_ARM_COMMON_OPTION,
322 EXYNOS5_GSCL_OPTION,
323 EXYNOS5_ISP_OPTION,
324 EXYNOS5_MFC_OPTION,
325 EXYNOS5_G3D_OPTION,
326 EXYNOS5_DISP1_OPTION,
327 EXYNOS5_MAU_OPTION,
328 EXYNOS5_TOP_PWR_OPTION,
329 EXYNOS5_TOP_PWR_SYSMEM_OPTION,
330};
331
332void __iomem *exynos5_list_diable_wfi_wfe[] = {
333 EXYNOS5_ARM_CORE1_OPTION,
334 EXYNOS5_FSYS_ARM_OPTION,
335 EXYNOS5_ISP_ARM_OPTION,
336};
337
338static void exynos5_init_pmu(void)
339{
340 unsigned int i;
341 unsigned int tmp;
342
343 /*
344 * Enable both SC_FEEDBACK and SC_COUNTER
345 */
346 for (i = 0 ; i < ARRAY_SIZE(exynos5_list_both_cnt_feed) ; i++) {
347 tmp = __raw_readl(exynos5_list_both_cnt_feed[i]);
348 tmp |= (EXYNOS5_USE_SC_FEEDBACK |
349 EXYNOS5_USE_SC_COUNTER);
350 __raw_writel(tmp, exynos5_list_both_cnt_feed[i]);
351 }
352
353 /*
354 * SKIP_DEACTIVATE_ACEACP_IN_PWDN_BITFIELD Enable
355 * MANUAL_L2RSTDISABLE_CONTROL_BITFIELD Enable
356 */
357 tmp = __raw_readl(EXYNOS5_ARM_COMMON_OPTION);
358 tmp |= (EXYNOS5_MANUAL_L2RSTDISABLE_CONTROL |
359 EXYNOS5_SKIP_DEACTIVATE_ACEACP_IN_PWDN);
360 __raw_writel(tmp, EXYNOS5_ARM_COMMON_OPTION);
361
362 /*
363 * Disable WFI/WFE on XXX_OPTION
364 */
365 for (i = 0 ; i < ARRAY_SIZE(exynos5_list_diable_wfi_wfe) ; i++) {
366 tmp = __raw_readl(exynos5_list_diable_wfi_wfe[i]);
367 tmp &= ~(EXYNOS5_OPTION_USE_STANDBYWFE |
368 EXYNOS5_OPTION_USE_STANDBYWFI);
369 __raw_writel(tmp, exynos5_list_diable_wfi_wfe[i]);
370 }
371}
372
317void exynos_sys_powerdown_conf(enum sys_powerdown mode) 373void exynos_sys_powerdown_conf(enum sys_powerdown mode)
318{ 374{
319 unsigned int i; 375 unsigned int i;
320 376
377 if (soc_is_exynos5250())
378 exynos5_init_pmu();
379
321 for (i = 0; (exynos_pmu_config[i].reg != PMU_TABLE_END) ; i++) 380 for (i = 0; (exynos_pmu_config[i].reg != PMU_TABLE_END) ; i++)
322 __raw_writel(exynos_pmu_config[i].val[mode], 381 __raw_writel(exynos_pmu_config[i].val[mode],
323 exynos_pmu_config[i].reg); 382 exynos_pmu_config[i].reg);