diff options
author | Abhilash Kesavan <a.kesavan@samsung.com> | 2014-05-15 15:23:26 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2014-05-15 15:24:51 -0400 |
commit | 096d21c6ebd01b3440d1e6063e646d9db8e31ac9 (patch) | |
tree | 0e20c38cfe275540bea9996f514c1120d9e47940 /arch | |
parent | 664ba4430156c224b184692ab1a038a467c7826c (diff) |
ARM: EXYNOS: Add generic cluster power control functions
Add generic cluster power control functions for exynos based SoCS
for cluster power up/down and to know the cluster status.
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-exynos/common.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-exynos/pm.c | 30 | ||||
-rw-r--r-- | arch/arm/mach-exynos/regs-pmu.h | 6 |
3 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index 4d815a511bc1..7876ed04b7a5 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h | |||
@@ -66,5 +66,8 @@ extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); | |||
66 | extern void exynos_cpu_power_down(int cpu); | 66 | extern void exynos_cpu_power_down(int cpu); |
67 | extern void exynos_cpu_power_up(int cpu); | 67 | extern void exynos_cpu_power_up(int cpu); |
68 | extern int exynos_cpu_power_state(int cpu); | 68 | extern int exynos_cpu_power_state(int cpu); |
69 | extern void exynos_cluster_power_down(int cluster); | ||
70 | extern void exynos_cluster_power_up(int cluster); | ||
71 | extern int exynos_cluster_power_state(int cluster); | ||
69 | 72 | ||
70 | #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ | 73 | #endif /* __ARCH_ARM_MACH_EXYNOS_COMMON_H */ |
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index cbfe23598236..3f2ae864582e 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c | |||
@@ -136,6 +136,36 @@ int exynos_cpu_power_state(int cpu) | |||
136 | S5P_CORE_LOCAL_PWR_EN); | 136 | S5P_CORE_LOCAL_PWR_EN); |
137 | } | 137 | } |
138 | 138 | ||
139 | /** | ||
140 | * exynos_cluster_power_down : power down the specified cluster | ||
141 | * @cluster : the cluster to power down | ||
142 | */ | ||
143 | void exynos_cluster_power_down(int cluster) | ||
144 | { | ||
145 | __raw_writel(0, EXYNOS_COMMON_CONFIGURATION(cluster)); | ||
146 | } | ||
147 | |||
148 | /** | ||
149 | * exynos_cluster_power_up : power up the specified cluster | ||
150 | * @cluster : the cluster to power up | ||
151 | */ | ||
152 | void exynos_cluster_power_up(int cluster) | ||
153 | { | ||
154 | __raw_writel(S5P_CORE_LOCAL_PWR_EN, | ||
155 | EXYNOS_COMMON_CONFIGURATION(cluster)); | ||
156 | } | ||
157 | |||
158 | /** | ||
159 | * exynos_cluster_power_state : returns the power state of the cluster | ||
160 | * @cluster : the cluster to retrieve the power state from | ||
161 | * | ||
162 | */ | ||
163 | int exynos_cluster_power_state(int cluster) | ||
164 | { | ||
165 | return (__raw_readl(EXYNOS_COMMON_STATUS(cluster)) & | ||
166 | S5P_CORE_LOCAL_PWR_EN); | ||
167 | } | ||
168 | |||
139 | /* For Cortex-A9 Diagnostic and Power control register */ | 169 | /* For Cortex-A9 Diagnostic and Power control register */ |
140 | static unsigned int save_arm_register[2]; | 170 | static unsigned int save_arm_register[2]; |
141 | 171 | ||
diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h index 98fb8d8715e6..f6b68a327586 100644 --- a/arch/arm/mach-exynos/regs-pmu.h +++ b/arch/arm/mach-exynos/regs-pmu.h | |||
@@ -111,6 +111,12 @@ | |||
111 | #define EXYNOS_ARM_CORE_STATUS(_nr) \ | 111 | #define EXYNOS_ARM_CORE_STATUS(_nr) \ |
112 | (EXYNOS_ARM_CORE_CONFIGURATION(_nr) + 0x4) | 112 | (EXYNOS_ARM_CORE_CONFIGURATION(_nr) + 0x4) |
113 | 113 | ||
114 | #define EXYNOS_ARM_COMMON_CONFIGURATION S5P_PMUREG(0x2500) | ||
115 | #define EXYNOS_COMMON_CONFIGURATION(_nr) \ | ||
116 | (EXYNOS_ARM_COMMON_CONFIGURATION + (0x80 * (_nr))) | ||
117 | #define EXYNOS_COMMON_STATUS(_nr) \ | ||
118 | (EXYNOS_COMMON_CONFIGURATION(_nr) + 0x4) | ||
119 | |||
114 | #define S5P_PAD_RET_MAUDIO_OPTION S5P_PMUREG(0x3028) | 120 | #define S5P_PAD_RET_MAUDIO_OPTION S5P_PMUREG(0x3028) |
115 | #define S5P_PAD_RET_GPIO_OPTION S5P_PMUREG(0x3108) | 121 | #define S5P_PAD_RET_GPIO_OPTION S5P_PMUREG(0x3108) |
116 | #define S5P_PAD_RET_UART_OPTION S5P_PMUREG(0x3128) | 122 | #define S5P_PAD_RET_UART_OPTION S5P_PMUREG(0x3128) |