diff options
author | Jongpill Lee <boyko.lee@samsung.com> | 2012-02-16 19:51:31 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2012-05-19 14:13:17 -0400 |
commit | 7d44d2ba1abc1bc3c74c8d52e4b6b7be1dbe94b8 (patch) | |
tree | dc1ffdfb5385fe85a35975bc0c4a85874622038a /arch/arm/mach-exynos | |
parent | c9347101d8a18ce5d356ac2def6d688fcba85b9b (diff) |
ARM: EXYNOS: Add PMU table for EXYNOS5250
This patch adds pmu table setting feature for EXYNOS5250.
Signed-off-by: Jongpill Lee <boyko.lee@samsung.com>
[kgene.kim@samsung.com: re-worked on top of v3.4-rc7]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-exynos')
-rw-r--r-- | arch/arm/mach-exynos/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/cpuidle.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/include/mach/pmu.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-exynos/include/mach/regs-pmu.h | 141 | ||||
-rw-r--r-- | arch/arm/mach-exynos/pm.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-exynos/pmu.c | 141 |
6 files changed, 265 insertions, 27 deletions
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile index 440a637c76f1..9b58024f7d43 100644 --- a/arch/arm/mach-exynos/Makefile +++ b/arch/arm/mach-exynos/Makefile | |||
@@ -22,7 +22,7 @@ obj-$(CONFIG_PM) += pm.o | |||
22 | obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o | 22 | obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o |
23 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o | 23 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o |
24 | 24 | ||
25 | obj-$(CONFIG_ARCH_EXYNOS4) += pmu.o | 25 | obj-$(CONFIG_ARCH_EXYNOS) += pmu.o |
26 | 26 | ||
27 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | 27 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o |
28 | 28 | ||
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index 33ab4e7558af..63d26a70ff8a 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c | |||
@@ -113,7 +113,7 @@ static int exynos4_enter_core0_aftr(struct cpuidle_device *dev, | |||
113 | exynos4_set_wakeupmask(); | 113 | exynos4_set_wakeupmask(); |
114 | 114 | ||
115 | /* Set value of power down register for aftr mode */ | 115 | /* Set value of power down register for aftr mode */ |
116 | exynos4_sys_powerdown_conf(SYS_AFTR); | 116 | exynos_sys_powerdown_conf(SYS_AFTR); |
117 | 117 | ||
118 | __raw_writel(virt_to_phys(s3c_cpu_resume), REG_DIRECTGO_ADDR); | 118 | __raw_writel(virt_to_phys(s3c_cpu_resume), REG_DIRECTGO_ADDR); |
119 | __raw_writel(S5P_CHECK_AFTR, REG_DIRECTGO_FLAG); | 119 | __raw_writel(S5P_CHECK_AFTR, REG_DIRECTGO_FLAG); |
diff --git a/arch/arm/mach-exynos/include/mach/pmu.h b/arch/arm/mach-exynos/include/mach/pmu.h index e76b7faba66b..7c27c2d4bf44 100644 --- a/arch/arm/mach-exynos/include/mach/pmu.h +++ b/arch/arm/mach-exynos/include/mach/pmu.h | |||
@@ -23,12 +23,12 @@ enum sys_powerdown { | |||
23 | }; | 23 | }; |
24 | 24 | ||
25 | extern unsigned long l2x0_regs_phys; | 25 | extern unsigned long l2x0_regs_phys; |
26 | struct exynos4_pmu_conf { | 26 | struct exynos_pmu_conf { |
27 | void __iomem *reg; | 27 | void __iomem *reg; |
28 | unsigned int val[NUM_SYS_POWERDOWN]; | 28 | unsigned int val[NUM_SYS_POWERDOWN]; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | extern void exynos4_sys_powerdown_conf(enum sys_powerdown mode); | 31 | extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); |
32 | extern void s3c_cpu_resume(void); | 32 | extern void s3c_cpu_resume(void); |
33 | 33 | ||
34 | #endif /* __ASM_ARCH_PMU_H */ | 34 | #endif /* __ASM_ARCH_PMU_H */ |
diff --git a/arch/arm/mach-exynos/include/mach/regs-pmu.h b/arch/arm/mach-exynos/include/mach/regs-pmu.h index 606b19907f99..505e8687b12f 100644 --- a/arch/arm/mach-exynos/include/mach/regs-pmu.h +++ b/arch/arm/mach-exynos/include/mach/regs-pmu.h | |||
@@ -1,9 +1,8 @@ | |||
1 | /* linux/arch/arm/mach-exynos4/include/mach/regs-pmu.h | 1 | /* |
2 | * | 2 | * Copyright (c) 2010-2012 Samsung Electronics Co., Ltd. |
3 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com | 3 | * http://www.samsung.com |
5 | * | 4 | * |
6 | * EXYNOS4 - Power management unit definition | 5 | * EXYNOS - Power management unit definition |
7 | * | 6 | * |
8 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
@@ -226,4 +225,138 @@ | |||
226 | #define S5P_DIS_IRQ_CORE3 S5P_PMUREG(0x1034) | 225 | #define S5P_DIS_IRQ_CORE3 S5P_PMUREG(0x1034) |
227 | #define S5P_DIS_IRQ_CENTRAL3 S5P_PMUREG(0x1038) | 226 | #define S5P_DIS_IRQ_CENTRAL3 S5P_PMUREG(0x1038) |
228 | 227 | ||
228 | /* For EXYNOS5 */ | ||
229 | |||
230 | #define EXYNOS5_USB_CFG S5P_PMUREG(0x0230) | ||
231 | |||
232 | #define EXYNOS5_ARM_CORE0_SYS_PWR_REG S5P_PMUREG(0x1000) | ||
233 | #define EXYNOS5_DIS_IRQ_ARM_CORE0_LOCAL_SYS_PWR_REG S5P_PMUREG(0x1004) | ||
234 | #define EXYNOS5_DIS_IRQ_ARM_CORE0_CENTRAL_SYS_PWR_REG S5P_PMUREG(0x1008) | ||
235 | #define EXYNOS5_ARM_CORE1_SYS_PWR_REG S5P_PMUREG(0x1010) | ||
236 | #define EXYNOS5_DIS_IRQ_ARM_CORE1_LOCAL_SYS_PWR_REG S5P_PMUREG(0x1014) | ||
237 | #define EXYNOS5_DIS_IRQ_ARM_CORE1_CENTRAL_SYS_PWR_REG S5P_PMUREG(0x1018) | ||
238 | #define EXYNOS5_FSYS_ARM_SYS_PWR_REG S5P_PMUREG(0x1040) | ||
239 | #define EXYNOS5_DIS_IRQ_FSYS_ARM_CENTRAL_SYS_PWR_REG S5P_PMUREG(0x1048) | ||
240 | #define EXYNOS5_ISP_ARM_SYS_PWR_REG S5P_PMUREG(0x1050) | ||
241 | #define EXYNOS5_DIS_IRQ_ISP_ARM_LOCAL_SYS_PWR_REG S5P_PMUREG(0x1054) | ||
242 | #define EXYNOS5_DIS_IRQ_ISP_ARM_CENTRAL_SYS_PWR_REG S5P_PMUREG(0x1058) | ||
243 | #define EXYNOS5_ARM_COMMON_SYS_PWR_REG S5P_PMUREG(0x1080) | ||
244 | #define EXYNOS5_ARM_L2_SYS_PWR_REG S5P_PMUREG(0x10C0) | ||
245 | #define EXYNOS5_CMU_ACLKSTOP_SYS_PWR_REG S5P_PMUREG(0x1100) | ||
246 | #define EXYNOS5_CMU_SCLKSTOP_SYS_PWR_REG S5P_PMUREG(0x1104) | ||
247 | #define EXYNOS5_CMU_RESET_SYS_PWR_REG S5P_PMUREG(0x110C) | ||
248 | #define EXYNOS5_CMU_ACLKSTOP_SYSMEM_SYS_PWR_REG S5P_PMUREG(0x1120) | ||
249 | #define EXYNOS5_CMU_SCLKSTOP_SYSMEM_SYS_PWR_REG S5P_PMUREG(0x1124) | ||
250 | #define EXYNOS5_CMU_RESET_SYSMEM_SYS_PWR_REG S5P_PMUREG(0x112C) | ||
251 | #define EXYNOS5_DRAM_FREQ_DOWN_SYS_PWR_REG S5P_PMUREG(0x1130) | ||
252 | #define EXYNOS5_DDRPHY_DLLOFF_SYS_PWR_REG S5P_PMUREG(0x1134) | ||
253 | #define EXYNOS5_DDRPHY_DLLLOCK_SYS_PWR_REG S5P_PMUREG(0x1138) | ||
254 | #define EXYNOS5_APLL_SYSCLK_SYS_PWR_REG S5P_PMUREG(0x1140) | ||
255 | #define EXYNOS5_MPLL_SYSCLK_SYS_PWR_REG S5P_PMUREG(0x1144) | ||
256 | #define EXYNOS5_VPLL_SYSCLK_SYS_PWR_REG S5P_PMUREG(0x1148) | ||
257 | #define EXYNOS5_EPLL_SYSCLK_SYS_PWR_REG S5P_PMUREG(0x114C) | ||
258 | #define EXYNOS5_BPLL_SYSCLK_SYS_PWR_REG S5P_PMUREG(0x1150) | ||
259 | #define EXYNOS5_CPLL_SYSCLK_SYS_PWR_REG S5P_PMUREG(0x1154) | ||
260 | #define EXYNOS5_MPLLUSER_SYSCLK_SYS_PWR_REG S5P_PMUREG(0x1164) | ||
261 | #define EXYNOS5_BPLLUSER_SYSCLK_SYS_PWR_REG S5P_PMUREG(0x1170) | ||
262 | #define EXYNOS5_TOP_BUS_SYS_PWR_REG S5P_PMUREG(0x1180) | ||
263 | #define EXYNOS5_TOP_RETENTION_SYS_PWR_REG S5P_PMUREG(0x1184) | ||
264 | #define EXYNOS5_TOP_PWR_SYS_PWR_REG S5P_PMUREG(0x1188) | ||
265 | #define EXYNOS5_TOP_BUS_SYSMEM_SYS_PWR_REG S5P_PMUREG(0x1190) | ||
266 | #define EXYNOS5_TOP_RETENTION_SYSMEM_SYS_PWR_REG S5P_PMUREG(0x1194) | ||
267 | #define EXYNOS5_TOP_PWR_SYSMEM_SYS_PWR_REG S5P_PMUREG(0x1198) | ||
268 | #define EXYNOS5_LOGIC_RESET_SYS_PWR_REG S5P_PMUREG(0x11A0) | ||
269 | #define EXYNOS5_OSCCLK_GATE_SYS_PWR_REG S5P_PMUREG(0x11A4) | ||
270 | #define EXYNOS5_LOGIC_RESET_SYSMEM_SYS_PWR_REG S5P_PMUREG(0x11B0) | ||
271 | #define EXYNOS5_OSCCLK_GATE_SYSMEM_SYS_PWR_REG S5P_PMUREG(0x11B4) | ||
272 | #define EXYNOS5_USBOTG_MEM_SYS_PWR_REG S5P_PMUREG(0x11C0) | ||
273 | #define EXYNOS5_G2D_MEM_SYS_PWR_REG S5P_PMUREG(0x11C8) | ||
274 | #define EXYNOS5_USBDRD_MEM_SYS_PWR_REG S5P_PMUREG(0x11CC) | ||
275 | #define EXYNOS5_SDMMC_MEM_SYS_PWR_REG S5P_PMUREG(0x11D0) | ||
276 | #define EXYNOS5_CSSYS_MEM_SYS_PWR_REG S5P_PMUREG(0x11D4) | ||
277 | #define EXYNOS5_SECSS_MEM_SYS_PWR_REG S5P_PMUREG(0x11D8) | ||
278 | #define EXYNOS5_ROTATOR_MEM_SYS_PWR_REG S5P_PMUREG(0x11DC) | ||
279 | #define EXYNOS5_INTRAM_MEM_SYS_PWR_REG S5P_PMUREG(0x11E0) | ||
280 | #define EXYNOS5_INTROM_MEM_SYS_PWR_REG S5P_PMUREG(0x11E4) | ||
281 | #define EXYNOS5_JPEG_MEM_SYS_PWR_REG S5P_PMUREG(0x11E8) | ||
282 | #define EXYNOS5_HSI_MEM_SYS_PWR_REG S5P_PMUREG(0x11EC) | ||
283 | #define EXYNOS5_MCUIOP_MEM_SYS_PWR_REG S5P_PMUREG(0x11F4) | ||
284 | #define EXYNOS5_SATA_MEM_SYS_PWR_REG S5P_PMUREG(0x11FC) | ||
285 | #define EXYNOS5_PAD_RETENTION_DRAM_SYS_PWR_REG S5P_PMUREG(0x1200) | ||
286 | #define EXYNOS5_PAD_RETENTION_MAU_SYS_PWR_REG S5P_PMUREG(0x1204) | ||
287 | #define EXYNOS5_PAD_RETENTION_EFNAND_SYS_PWR_REG S5P_PMUREG(0x1208) | ||
288 | #define EXYNOS5_PAD_RETENTION_GPIO_SYS_PWR_REG S5P_PMUREG(0x1220) | ||
289 | #define EXYNOS5_PAD_RETENTION_UART_SYS_PWR_REG S5P_PMUREG(0x1224) | ||
290 | #define EXYNOS5_PAD_RETENTION_MMCA_SYS_PWR_REG S5P_PMUREG(0x1228) | ||
291 | #define EXYNOS5_PAD_RETENTION_MMCB_SYS_PWR_REG S5P_PMUREG(0x122C) | ||
292 | #define EXYNOS5_PAD_RETENTION_EBIA_SYS_PWR_REG S5P_PMUREG(0x1230) | ||
293 | #define EXYNOS5_PAD_RETENTION_EBIB_SYS_PWR_REG S5P_PMUREG(0x1234) | ||
294 | #define EXYNOS5_PAD_RETENTION_SPI_SYS_PWR_REG S5P_PMUREG(0x1238) | ||
295 | #define EXYNOS5_PAD_RETENTION_GPIO_SYSMEM_SYS_PWR_REG S5P_PMUREG(0x123C) | ||
296 | #define EXYNOS5_PAD_ISOLATION_SYS_PWR_REG S5P_PMUREG(0x1240) | ||
297 | #define EXYNOS5_PAD_ISOLATION_SYSMEM_SYS_PWR_REG S5P_PMUREG(0x1250) | ||
298 | #define EXYNOS5_PAD_ALV_SEL_SYS_PWR_REG S5P_PMUREG(0x1260) | ||
299 | #define EXYNOS5_XUSBXTI_SYS_PWR_REG S5P_PMUREG(0x1280) | ||
300 | #define EXYNOS5_XXTI_SYS_PWR_REG S5P_PMUREG(0x1284) | ||
301 | #define EXYNOS5_EXT_REGULATOR_SYS_PWR_REG S5P_PMUREG(0x12C0) | ||
302 | #define EXYNOS5_GPIO_MODE_SYS_PWR_REG S5P_PMUREG(0x1300) | ||
303 | #define EXYNOS5_GPIO_MODE_SYSMEM_SYS_PWR_REG S5P_PMUREG(0x1320) | ||
304 | #define EXYNOS5_GPIO_MODE_MAU_SYS_PWR_REG S5P_PMUREG(0x1340) | ||
305 | #define EXYNOS5_TOP_ASB_RESET_SYS_PWR_REG S5P_PMUREG(0x1344) | ||
306 | #define EXYNOS5_TOP_ASB_ISOLATION_SYS_PWR_REG S5P_PMUREG(0x1348) | ||
307 | #define EXYNOS5_GSCL_SYS_PWR_REG S5P_PMUREG(0x1400) | ||
308 | #define EXYNOS5_ISP_SYS_PWR_REG S5P_PMUREG(0x1404) | ||
309 | #define EXYNOS5_MFC_SYS_PWR_REG S5P_PMUREG(0x1408) | ||
310 | #define EXYNOS5_G3D_SYS_PWR_REG S5P_PMUREG(0x140C) | ||
311 | #define EXYNOS5_DISP1_SYS_PWR_REG S5P_PMUREG(0x1414) | ||
312 | #define EXYNOS5_MAU_SYS_PWR_REG S5P_PMUREG(0x1418) | ||
313 | #define EXYNOS5_CMU_CLKSTOP_GSCL_SYS_PWR_REG S5P_PMUREG(0x1480) | ||
314 | #define EXYNOS5_CMU_CLKSTOP_ISP_SYS_PWR_REG S5P_PMUREG(0x1484) | ||
315 | #define EXYNOS5_CMU_CLKSTOP_MFC_SYS_PWR_REG S5P_PMUREG(0x1488) | ||
316 | #define EXYNOS5_CMU_CLKSTOP_G3D_SYS_PWR_REG S5P_PMUREG(0x148C) | ||
317 | #define EXYNOS5_CMU_CLKSTOP_DISP1_SYS_PWR_REG S5P_PMUREG(0x1494) | ||
318 | #define EXYNOS5_CMU_CLKSTOP_MAU_SYS_PWR_REG S5P_PMUREG(0x1498) | ||
319 | #define EXYNOS5_CMU_SYSCLK_GSCL_SYS_PWR_REG S5P_PMUREG(0x14C0) | ||
320 | #define EXYNOS5_CMU_SYSCLK_ISP_SYS_PWR_REG S5P_PMUREG(0x14C4) | ||
321 | #define EXYNOS5_CMU_SYSCLK_MFC_SYS_PWR_REG S5P_PMUREG(0x14C8) | ||
322 | #define EXYNOS5_CMU_SYSCLK_G3D_SYS_PWR_REG S5P_PMUREG(0x14CC) | ||
323 | #define EXYNOS5_CMU_SYSCLK_DISP1_SYS_PWR_REG S5P_PMUREG(0x14D4) | ||
324 | #define EXYNOS5_CMU_SYSCLK_MAU_SYS_PWR_REG S5P_PMUREG(0x14D8) | ||
325 | #define EXYNOS5_CMU_RESET_GSCL_SYS_PWR_REG S5P_PMUREG(0x1580) | ||
326 | #define EXYNOS5_CMU_RESET_ISP_SYS_PWR_REG S5P_PMUREG(0x1584) | ||
327 | #define EXYNOS5_CMU_RESET_MFC_SYS_PWR_REG S5P_PMUREG(0x1588) | ||
328 | #define EXYNOS5_CMU_RESET_G3D_SYS_PWR_REG S5P_PMUREG(0x158C) | ||
329 | #define EXYNOS5_CMU_RESET_DISP1_SYS_PWR_REG S5P_PMUREG(0x1594) | ||
330 | #define EXYNOS5_CMU_RESET_MAU_SYS_PWR_REG S5P_PMUREG(0x1598) | ||
331 | |||
332 | #define EXYNOS5_ARM_CORE0_OPTION S5P_PMUREG(0x2008) | ||
333 | #define EXYNOS5_ARM_CORE1_OPTION S5P_PMUREG(0x2088) | ||
334 | #define EXYNOS5_FSYS_ARM_OPTION S5P_PMUREG(0x2208) | ||
335 | #define EXYNOS5_ISP_ARM_OPTION S5P_PMUREG(0x2288) | ||
336 | #define EXYNOS5_ARM_COMMON_OPTION S5P_PMUREG(0x2408) | ||
337 | #define EXYNOS5_TOP_PWR_OPTION S5P_PMUREG(0x2C48) | ||
338 | #define EXYNOS5_TOP_PWR_SYSMEM_OPTION S5P_PMUREG(0x2CC8) | ||
339 | #define EXYNOS5_JPEG_MEM_OPTION S5P_PMUREG(0x2F48) | ||
340 | #define EXYNOS5_GSCL_STATUS S5P_PMUREG(0x4004) | ||
341 | #define EXYNOS5_ISP_STATUS S5P_PMUREG(0x4024) | ||
342 | #define EXYNOS5_GSCL_OPTION S5P_PMUREG(0x4008) | ||
343 | #define EXYNOS5_ISP_OPTION S5P_PMUREG(0x4028) | ||
344 | #define EXYNOS5_MFC_OPTION S5P_PMUREG(0x4048) | ||
345 | #define EXYNOS5_G3D_CONFIGURATION S5P_PMUREG(0x4060) | ||
346 | #define EXYNOS5_G3D_STATUS S5P_PMUREG(0x4064) | ||
347 | #define EXYNOS5_G3D_OPTION S5P_PMUREG(0x4068) | ||
348 | #define EXYNOS5_DISP1_OPTION S5P_PMUREG(0x40A8) | ||
349 | #define EXYNOS5_MAU_OPTION S5P_PMUREG(0x40C8) | ||
350 | |||
351 | #define EXYNOS5_USE_SC_FEEDBACK (1 << 1) | ||
352 | #define EXYNOS5_USE_SC_COUNTER (1 << 0) | ||
353 | |||
354 | #define EXYNOS5_MANUAL_L2RSTDISABLE_CONTROL (1 << 2) | ||
355 | #define EXYNOS5_SKIP_DEACTIVATE_ACEACP_IN_PWDN (1 << 7) | ||
356 | |||
357 | #define EXYNOS5_OPTION_USE_STANDBYWFE (1 << 24) | ||
358 | #define EXYNOS5_OPTION_USE_STANDBYWFI (1 << 16) | ||
359 | |||
360 | #define EXYNOS5_OPTION_USE_RETENTION (1 << 4) | ||
361 | |||
229 | #endif /* __ASM_ARCH_REGS_PMU_H */ | 362 | #endif /* __ASM_ARCH_REGS_PMU_H */ |
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index 2abc44da8aa0..6aa3b47cee1c 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c | |||
@@ -98,7 +98,7 @@ static void exynos_pm_prepare(void) | |||
98 | 98 | ||
99 | /* Set value of power down register for sleep mode */ | 99 | /* Set value of power down register for sleep mode */ |
100 | 100 | ||
101 | exynos4_sys_powerdown_conf(SYS_SLEEP); | 101 | exynos_sys_powerdown_conf(SYS_SLEEP); |
102 | __raw_writel(S5P_CHECK_SLEEP, S5P_INFORM1); | 102 | __raw_writel(S5P_CHECK_SLEEP, S5P_INFORM1); |
103 | 103 | ||
104 | /* ensure at least INFORM0 has the resume address */ | 104 | /* ensure at least INFORM0 has the resume address */ |
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c index 77c6815eebee..db4dc515e416 100644 --- a/arch/arm/mach-exynos/pmu.c +++ b/arch/arm/mach-exynos/pmu.c | |||
@@ -1,9 +1,8 @@ | |||
1 | /* linux/arch/arm/mach-exynos4/pmu.c | 1 | /* |
2 | * | 2 | * Copyright (c) 2011-2012 Samsung Electronics Co., Ltd. |
3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | 3 | * http://www.samsung.com/ |
5 | * | 4 | * |
6 | * EXYNOS4210 - CPU PMU(Power Management Unit) support | 5 | * EXYNOS - CPU PMU(Power Management Unit) support |
7 | * | 6 | * |
8 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
@@ -16,9 +15,9 @@ | |||
16 | #include <mach/regs-clock.h> | 15 | #include <mach/regs-clock.h> |
17 | #include <mach/pmu.h> | 16 | #include <mach/pmu.h> |
18 | 17 | ||
19 | static struct exynos4_pmu_conf *exynos4_pmu_config; | 18 | static struct exynos_pmu_conf *exynos_pmu_config; |
20 | 19 | ||
21 | static struct exynos4_pmu_conf exynos4210_pmu_config[] = { | 20 | static struct exynos_pmu_conf exynos4210_pmu_config[] = { |
22 | /* { .reg = address, .val = { AFTR, LPA, SLEEP } */ | 21 | /* { .reg = address, .val = { AFTR, LPA, SLEEP } */ |
23 | { S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } }, | 22 | { S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } }, |
24 | { S5P_DIS_IRQ_CORE0, { 0x0, 0x0, 0x0 } }, | 23 | { S5P_DIS_IRQ_CORE0, { 0x0, 0x0, 0x0 } }, |
@@ -94,7 +93,7 @@ static struct exynos4_pmu_conf exynos4210_pmu_config[] = { | |||
94 | { PMU_TABLE_END,}, | 93 | { PMU_TABLE_END,}, |
95 | }; | 94 | }; |
96 | 95 | ||
97 | static struct exynos4_pmu_conf exynos4x12_pmu_config[] = { | 96 | static struct exynos_pmu_conf exynos4x12_pmu_config[] = { |
98 | { S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } }, | 97 | { S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } }, |
99 | { S5P_DIS_IRQ_CORE0, { 0x0, 0x0, 0x0 } }, | 98 | { S5P_DIS_IRQ_CORE0, { 0x0, 0x0, 0x0 } }, |
100 | { S5P_DIS_IRQ_CENTRAL0, { 0x0, 0x0, 0x0 } }, | 99 | { S5P_DIS_IRQ_CENTRAL0, { 0x0, 0x0, 0x0 } }, |
@@ -202,7 +201,7 @@ static struct exynos4_pmu_conf exynos4x12_pmu_config[] = { | |||
202 | { PMU_TABLE_END,}, | 201 | { PMU_TABLE_END,}, |
203 | }; | 202 | }; |
204 | 203 | ||
205 | static struct exynos4_pmu_conf exynos4412_pmu_config[] = { | 204 | static struct exynos_pmu_conf exynos4412_pmu_config[] = { |
206 | { S5P_ARM_CORE2_LOWPWR, { 0x0, 0x0, 0x2 } }, | 205 | { S5P_ARM_CORE2_LOWPWR, { 0x0, 0x0, 0x2 } }, |
207 | { S5P_DIS_IRQ_CORE2, { 0x0, 0x0, 0x0 } }, | 206 | { S5P_DIS_IRQ_CORE2, { 0x0, 0x0, 0x0 } }, |
208 | { S5P_DIS_IRQ_CENTRAL2, { 0x0, 0x0, 0x0 } }, | 207 | { S5P_DIS_IRQ_CENTRAL2, { 0x0, 0x0, 0x0 } }, |
@@ -212,13 +211,116 @@ static struct exynos4_pmu_conf exynos4412_pmu_config[] = { | |||
212 | { PMU_TABLE_END,}, | 211 | { PMU_TABLE_END,}, |
213 | }; | 212 | }; |
214 | 213 | ||
215 | void exynos4_sys_powerdown_conf(enum sys_powerdown mode) | 214 | static struct exynos_pmu_conf exynos5250_pmu_config[] = { |
215 | /* { .reg = address, .val = { AFTR, LPA, SLEEP } */ | ||
216 | { EXYNOS5_ARM_CORE0_SYS_PWR_REG, { 0x0, 0x0, 0x2} }, | ||
217 | { EXYNOS5_DIS_IRQ_ARM_CORE0_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} }, | ||
218 | { EXYNOS5_DIS_IRQ_ARM_CORE0_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} }, | ||
219 | { EXYNOS5_ARM_CORE1_SYS_PWR_REG, { 0x0, 0x0, 0x2} }, | ||
220 | { EXYNOS5_DIS_IRQ_ARM_CORE1_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} }, | ||
221 | { EXYNOS5_DIS_IRQ_ARM_CORE1_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} }, | ||
222 | { EXYNOS5_FSYS_ARM_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
223 | { EXYNOS5_DIS_IRQ_FSYS_ARM_CENTRAL_SYS_PWR_REG, { 0x1, 0x1, 0x1} }, | ||
224 | { EXYNOS5_ISP_ARM_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
225 | { EXYNOS5_DIS_IRQ_ISP_ARM_LOCAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} }, | ||
226 | { EXYNOS5_DIS_IRQ_ISP_ARM_CENTRAL_SYS_PWR_REG, { 0x0, 0x0, 0x0} }, | ||
227 | { EXYNOS5_ARM_COMMON_SYS_PWR_REG, { 0x0, 0x0, 0x2} }, | ||
228 | { EXYNOS5_ARM_L2_SYS_PWR_REG, { 0x3, 0x3, 0x3} }, | ||
229 | { EXYNOS5_CMU_ACLKSTOP_SYS_PWR_REG, { 0x1, 0x0, 0x1} }, | ||
230 | { EXYNOS5_CMU_SCLKSTOP_SYS_PWR_REG, { 0x1, 0x0, 0x1} }, | ||
231 | { EXYNOS5_CMU_RESET_SYS_PWR_REG, { 0x1, 0x1, 0x0} }, | ||
232 | { EXYNOS5_CMU_ACLKSTOP_SYSMEM_SYS_PWR_REG, { 0x1, 0x0, 0x1} }, | ||
233 | { EXYNOS5_CMU_SCLKSTOP_SYSMEM_SYS_PWR_REG, { 0x1, 0x0, 0x1} }, | ||
234 | { EXYNOS5_CMU_RESET_SYSMEM_SYS_PWR_REG, { 0x1, 0x1, 0x0} }, | ||
235 | { EXYNOS5_DRAM_FREQ_DOWN_SYS_PWR_REG, { 0x1, 0x1, 0x1} }, | ||
236 | { EXYNOS5_DDRPHY_DLLOFF_SYS_PWR_REG, { 0x1, 0x1, 0x1} }, | ||
237 | { EXYNOS5_DDRPHY_DLLLOCK_SYS_PWR_REG, { 0x1, 0x1, 0x1} }, | ||
238 | { EXYNOS5_APLL_SYSCLK_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
239 | { EXYNOS5_MPLL_SYSCLK_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
240 | { EXYNOS5_VPLL_SYSCLK_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
241 | { EXYNOS5_EPLL_SYSCLK_SYS_PWR_REG, { 0x1, 0x1, 0x0} }, | ||
242 | { EXYNOS5_BPLL_SYSCLK_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
243 | { EXYNOS5_CPLL_SYSCLK_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
244 | { EXYNOS5_MPLLUSER_SYSCLK_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
245 | { EXYNOS5_BPLLUSER_SYSCLK_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
246 | { EXYNOS5_TOP_BUS_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
247 | { EXYNOS5_TOP_RETENTION_SYS_PWR_REG, { 0x1, 0x0, 0x1} }, | ||
248 | { EXYNOS5_TOP_PWR_SYS_PWR_REG, { 0x3, 0x0, 0x3} }, | ||
249 | { EXYNOS5_TOP_BUS_SYSMEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
250 | { EXYNOS5_TOP_RETENTION_SYSMEM_SYS_PWR_REG, { 0x1, 0x0, 0x1} }, | ||
251 | { EXYNOS5_TOP_PWR_SYSMEM_SYS_PWR_REG, { 0x3, 0x0, 0x3} }, | ||
252 | { EXYNOS5_LOGIC_RESET_SYS_PWR_REG, { 0x1, 0x1, 0x0} }, | ||
253 | { EXYNOS5_OSCCLK_GATE_SYS_PWR_REG, { 0x1, 0x0, 0x1} }, | ||
254 | { EXYNOS5_LOGIC_RESET_SYSMEM_SYS_PWR_REG, { 0x1, 0x1, 0x0} }, | ||
255 | { EXYNOS5_OSCCLK_GATE_SYSMEM_SYS_PWR_REG, { 0x1, 0x0, 0x1} }, | ||
256 | { EXYNOS5_USBOTG_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
257 | { EXYNOS5_G2D_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
258 | { EXYNOS5_USBDRD_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
259 | { EXYNOS5_SDMMC_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
260 | { EXYNOS5_CSSYS_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
261 | { EXYNOS5_SECSS_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
262 | { EXYNOS5_ROTATOR_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
263 | { EXYNOS5_INTRAM_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
264 | { EXYNOS5_INTROM_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
265 | { EXYNOS5_JPEG_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
266 | { EXYNOS5_HSI_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
267 | { EXYNOS5_MCUIOP_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
268 | { EXYNOS5_SATA_MEM_SYS_PWR_REG, { 0x3, 0x0, 0x0} }, | ||
269 | { EXYNOS5_PAD_RETENTION_DRAM_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
270 | { EXYNOS5_PAD_RETENTION_MAU_SYS_PWR_REG, { 0x1, 0x1, 0x0} }, | ||
271 | { EXYNOS5_PAD_RETENTION_GPIO_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
272 | { EXYNOS5_PAD_RETENTION_UART_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
273 | { EXYNOS5_PAD_RETENTION_MMCA_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
274 | { EXYNOS5_PAD_RETENTION_MMCB_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
275 | { EXYNOS5_PAD_RETENTION_EBIA_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
276 | { EXYNOS5_PAD_RETENTION_EBIB_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
277 | { EXYNOS5_PAD_RETENTION_SPI_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
278 | { EXYNOS5_PAD_RETENTION_GPIO_SYSMEM_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
279 | { EXYNOS5_PAD_ISOLATION_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
280 | { EXYNOS5_PAD_ISOLATION_SYSMEM_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
281 | { EXYNOS5_PAD_ALV_SEL_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
282 | { EXYNOS5_XUSBXTI_SYS_PWR_REG, { 0x1, 0x1, 0x1} }, | ||
283 | { EXYNOS5_XXTI_SYS_PWR_REG, { 0x1, 0x1, 0x0} }, | ||
284 | { EXYNOS5_EXT_REGULATOR_SYS_PWR_REG, { 0x1, 0x1, 0x0} }, | ||
285 | { EXYNOS5_GPIO_MODE_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
286 | { EXYNOS5_GPIO_MODE_SYSMEM_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
287 | { EXYNOS5_GPIO_MODE_MAU_SYS_PWR_REG, { 0x1, 0x1, 0x0} }, | ||
288 | { EXYNOS5_TOP_ASB_RESET_SYS_PWR_REG, { 0x1, 0x1, 0x1} }, | ||
289 | { EXYNOS5_TOP_ASB_ISOLATION_SYS_PWR_REG, { 0x1, 0x0, 0x1} }, | ||
290 | { EXYNOS5_GSCL_SYS_PWR_REG, { 0x7, 0x0, 0x0} }, | ||
291 | { EXYNOS5_ISP_SYS_PWR_REG, { 0x7, 0x0, 0x0} }, | ||
292 | { EXYNOS5_MFC_SYS_PWR_REG, { 0x7, 0x0, 0x0} }, | ||
293 | { EXYNOS5_G3D_SYS_PWR_REG, { 0x7, 0x0, 0x0} }, | ||
294 | { EXYNOS5_DISP1_SYS_PWR_REG, { 0x7, 0x0, 0x0} }, | ||
295 | { EXYNOS5_MAU_SYS_PWR_REG, { 0x7, 0x7, 0x0} }, | ||
296 | { EXYNOS5_CMU_CLKSTOP_GSCL_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
297 | { EXYNOS5_CMU_CLKSTOP_ISP_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
298 | { EXYNOS5_CMU_CLKSTOP_MFC_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
299 | { EXYNOS5_CMU_CLKSTOP_G3D_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
300 | { EXYNOS5_CMU_CLKSTOP_DISP1_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
301 | { EXYNOS5_CMU_CLKSTOP_MAU_SYS_PWR_REG, { 0x1, 0x1, 0x0} }, | ||
302 | { EXYNOS5_CMU_SYSCLK_GSCL_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
303 | { EXYNOS5_CMU_SYSCLK_ISP_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
304 | { EXYNOS5_CMU_SYSCLK_MFC_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
305 | { EXYNOS5_CMU_SYSCLK_G3D_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
306 | { EXYNOS5_CMU_SYSCLK_DISP1_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
307 | { EXYNOS5_CMU_SYSCLK_MAU_SYS_PWR_REG, { 0x1, 0x1, 0x0} }, | ||
308 | { EXYNOS5_CMU_RESET_GSCL_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
309 | { EXYNOS5_CMU_RESET_ISP_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
310 | { EXYNOS5_CMU_RESET_MFC_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
311 | { EXYNOS5_CMU_RESET_G3D_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
312 | { EXYNOS5_CMU_RESET_DISP1_SYS_PWR_REG, { 0x1, 0x0, 0x0} }, | ||
313 | { EXYNOS5_CMU_RESET_MAU_SYS_PWR_REG, { 0x1, 0x1, 0x0} }, | ||
314 | { PMU_TABLE_END,}, | ||
315 | }; | ||
316 | |||
317 | void exynos_sys_powerdown_conf(enum sys_powerdown mode) | ||
216 | { | 318 | { |
217 | unsigned int i; | 319 | unsigned int i; |
218 | 320 | ||
219 | for (i = 0; (exynos4_pmu_config[i].reg != PMU_TABLE_END) ; i++) | 321 | for (i = 0; (exynos_pmu_config[i].reg != PMU_TABLE_END) ; i++) |
220 | __raw_writel(exynos4_pmu_config[i].val[mode], | 322 | __raw_writel(exynos_pmu_config[i].val[mode], |
221 | exynos4_pmu_config[i].reg); | 323 | exynos_pmu_config[i].reg); |
222 | 324 | ||
223 | if (soc_is_exynos4412()) { | 325 | if (soc_is_exynos4412()) { |
224 | for (i = 0; exynos4412_pmu_config[i].reg != PMU_TABLE_END ; i++) | 326 | for (i = 0; exynos4412_pmu_config[i].reg != PMU_TABLE_END ; i++) |
@@ -227,20 +329,23 @@ void exynos4_sys_powerdown_conf(enum sys_powerdown mode) | |||
227 | } | 329 | } |
228 | } | 330 | } |
229 | 331 | ||
230 | static int __init exynos4_pmu_init(void) | 332 | static int __init exynos_pmu_init(void) |
231 | { | 333 | { |
232 | exynos4_pmu_config = exynos4210_pmu_config; | 334 | exynos_pmu_config = exynos4210_pmu_config; |
233 | 335 | ||
234 | if (soc_is_exynos4210()) { | 336 | if (soc_is_exynos4210()) { |
235 | exynos4_pmu_config = exynos4210_pmu_config; | 337 | exynos_pmu_config = exynos4210_pmu_config; |
236 | pr_info("EXYNOS4210 PMU Initialize\n"); | 338 | pr_info("EXYNOS4210 PMU Initialize\n"); |
237 | } else if (soc_is_exynos4212() || soc_is_exynos4412()) { | 339 | } else if (soc_is_exynos4212() || soc_is_exynos4412()) { |
238 | exynos4_pmu_config = exynos4x12_pmu_config; | 340 | exynos_pmu_config = exynos4x12_pmu_config; |
239 | pr_info("EXYNOS4x12 PMU Initialize\n"); | 341 | pr_info("EXYNOS4x12 PMU Initialize\n"); |
342 | } else if (soc_is_exynos5250()) { | ||
343 | exynos_pmu_config = exynos5250_pmu_config; | ||
344 | pr_info("EXYNOS5250 PMU Initialize\n"); | ||
240 | } else { | 345 | } else { |
241 | pr_info("EXYNOS4: PMU not supported\n"); | 346 | pr_info("EXYNOS: PMU not supported\n"); |
242 | } | 347 | } |
243 | 348 | ||
244 | return 0; | 349 | return 0; |
245 | } | 350 | } |
246 | arch_initcall(exynos4_pmu_init); | 351 | arch_initcall(exynos_pmu_init); |