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/pmu.c | |
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/pmu.c')
-rw-r--r-- | arch/arm/mach-exynos/pmu.c | 141 |
1 files changed, 123 insertions, 18 deletions
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); |