aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2015-01-29 16:53:47 -0500
committerOlof Johansson <olof@lixom.net>2015-01-29 16:53:47 -0500
commitff6a8168d2e57cf36c10b8add6ae5773c02babdc (patch)
tree1872d835fb5180b0f8690e550d66645c6a9fcea3
parent436d3b13fc1962639ec558a1a98ad96b62d4b82b (diff)
parenta4f582f5c5fe3e8eaef7ce637c894619bdee650e (diff)
Merge tag 'samsung-update' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/soc
Merge "Samsung mach updates for v3.20" from Kukjin Kim: - add exynos3250 Supsend to RAM support - recognize MFC v8 devices for exynos5422/5800 - print CPU id/rev during kernel boot * tag 'samsung-update' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung: ARM: EXYNOS: Add exynos3250 suspend-to-ram support ARM: EXYNOS: Recognize Samsung MFC v8 devices ARM: SAMSUNG: print CPU id on probe Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--arch/arm/mach-exynos/exynos.c1
-rw-r--r--arch/arm/mach-exynos/regs-pmu.h3
-rw-r--r--arch/arm/mach-exynos/suspend.c77
-rw-r--r--arch/arm/plat-samsung/cpu.c4
4 files changed, 85 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index c13d0837fa8c..b343a1a626d5 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -282,6 +282,7 @@ static void __init exynos_reserve(void)
282 "samsung,mfc-v5", 282 "samsung,mfc-v5",
283 "samsung,mfc-v6", 283 "samsung,mfc-v6",
284 "samsung,mfc-v7", 284 "samsung,mfc-v7",
285 "samsung,mfc-v8",
285 }; 286 };
286 287
287 for (i = 0; i < ARRAY_SIZE(mfc_mem); i++) 288 for (i = 0; i < ARRAY_SIZE(mfc_mem); i++)
diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h
index b5f4406fc1b5..eb461e1c325a 100644
--- a/arch/arm/mach-exynos/regs-pmu.h
+++ b/arch/arm/mach-exynos/regs-pmu.h
@@ -160,12 +160,14 @@
160#define EXYNOS5_L2RSTDISABLE_VALUE BIT(3) 160#define EXYNOS5_L2RSTDISABLE_VALUE BIT(3)
161 161
162#define S5P_PAD_RET_MAUDIO_OPTION 0x3028 162#define S5P_PAD_RET_MAUDIO_OPTION 0x3028
163#define S5P_PAD_RET_MMC2_OPTION 0x30c8
163#define S5P_PAD_RET_GPIO_OPTION 0x3108 164#define S5P_PAD_RET_GPIO_OPTION 0x3108
164#define S5P_PAD_RET_UART_OPTION 0x3128 165#define S5P_PAD_RET_UART_OPTION 0x3128
165#define S5P_PAD_RET_MMCA_OPTION 0x3148 166#define S5P_PAD_RET_MMCA_OPTION 0x3148
166#define S5P_PAD_RET_MMCB_OPTION 0x3168 167#define S5P_PAD_RET_MMCB_OPTION 0x3168
167#define S5P_PAD_RET_EBIA_OPTION 0x3188 168#define S5P_PAD_RET_EBIA_OPTION 0x3188
168#define S5P_PAD_RET_EBIB_OPTION 0x31A8 169#define S5P_PAD_RET_EBIB_OPTION 0x31A8
170#define S5P_PAD_RET_SPI_OPTION 0x31c8
169 171
170#define S5P_PS_HOLD_CONTROL 0x330C 172#define S5P_PS_HOLD_CONTROL 0x330C
171#define S5P_PS_HOLD_EN (1 << 31) 173#define S5P_PS_HOLD_EN (1 << 31)
@@ -326,6 +328,7 @@
326 (EXYNOS3_ARM_CORE0_OPTION + ((_nr) * 0x80)) 328 (EXYNOS3_ARM_CORE0_OPTION + ((_nr) * 0x80))
327 329
328#define EXYNOS3_ARM_COMMON_OPTION 0x2408 330#define EXYNOS3_ARM_COMMON_OPTION 0x2408
331#define EXYNOS3_ARM_L2_OPTION 0x2608
329#define EXYNOS3_TOP_PWR_OPTION 0x2C48 332#define EXYNOS3_TOP_PWR_OPTION 0x2C48
330#define EXYNOS3_CORE_TOP_PWR_OPTION 0x2CA8 333#define EXYNOS3_CORE_TOP_PWR_OPTION 0x2CA8
331#define EXYNOS3_XUSBXTI_DURATION 0x341C 334#define EXYNOS3_XUSBXTI_DURATION 0x341C
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
index f8e7dcd17055..d6feef31b468 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -91,6 +91,12 @@ static unsigned int exynos_pmu_spare3;
91 91
92static u32 exynos_irqwake_intmask = 0xffffffff; 92static u32 exynos_irqwake_intmask = 0xffffffff;
93 93
94static const struct exynos_wkup_irq exynos3250_wkup_irq[] = {
95 { 73, BIT(1) }, /* RTC alarm */
96 { 74, BIT(2) }, /* RTC tick */
97 { /* sentinel */ },
98};
99
94static const struct exynos_wkup_irq exynos4_wkup_irq[] = { 100static const struct exynos_wkup_irq exynos4_wkup_irq[] = {
95 { 76, BIT(1) }, /* RTC alarm */ 101 { 76, BIT(1) }, /* RTC alarm */
96 { 77, BIT(2) }, /* RTC tick */ 102 { 77, BIT(2) }, /* RTC tick */
@@ -114,6 +120,19 @@ unsigned int exynos_release_ret_regs[] = {
114 REG_TABLE_END, 120 REG_TABLE_END,
115}; 121};
116 122
123unsigned int exynos3250_release_ret_regs[] = {
124 S5P_PAD_RET_MAUDIO_OPTION,
125 S5P_PAD_RET_GPIO_OPTION,
126 S5P_PAD_RET_UART_OPTION,
127 S5P_PAD_RET_MMCA_OPTION,
128 S5P_PAD_RET_MMCB_OPTION,
129 S5P_PAD_RET_EBIA_OPTION,
130 S5P_PAD_RET_EBIB_OPTION,
131 S5P_PAD_RET_MMC2_OPTION,
132 S5P_PAD_RET_SPI_OPTION,
133 REG_TABLE_END,
134};
135
117unsigned int exynos5420_release_ret_regs[] = { 136unsigned int exynos5420_release_ret_regs[] = {
118 EXYNOS_PAD_RET_DRAM_OPTION, 137 EXYNOS_PAD_RET_DRAM_OPTION,
119 EXYNOS_PAD_RET_MAUDIO_OPTION, 138 EXYNOS_PAD_RET_MAUDIO_OPTION,
@@ -173,6 +192,12 @@ static int exynos_cpu_suspend(unsigned long arg)
173 return exynos_cpu_do_idle(); 192 return exynos_cpu_do_idle();
174} 193}
175 194
195static int exynos3250_cpu_suspend(unsigned long arg)
196{
197 flush_cache_all();
198 return exynos_cpu_do_idle();
199}
200
176static int exynos5420_cpu_suspend(unsigned long arg) 201static int exynos5420_cpu_suspend(unsigned long arg)
177{ 202{
178 /* MCPM works with HW CPU identifiers */ 203 /* MCPM works with HW CPU identifiers */
@@ -230,6 +255,23 @@ static void exynos_pm_prepare(void)
230 pmu_raw_writel(virt_to_phys(exynos_cpu_resume), S5P_INFORM0); 255 pmu_raw_writel(virt_to_phys(exynos_cpu_resume), S5P_INFORM0);
231} 256}
232 257
258static void exynos3250_pm_prepare(void)
259{
260 unsigned int tmp;
261
262 /* Set wake-up mask registers */
263 exynos_pm_set_wakeup_mask();
264
265 tmp = pmu_raw_readl(EXYNOS3_ARM_L2_OPTION);
266 tmp &= ~EXYNOS5_OPTION_USE_RETENTION;
267 pmu_raw_writel(tmp, EXYNOS3_ARM_L2_OPTION);
268
269 exynos_pm_enter_sleep_mode();
270
271 /* ensure at least INFORM0 has the resume address */
272 pmu_raw_writel(virt_to_phys(exynos_cpu_resume), S5P_INFORM0);
273}
274
233static void exynos5420_pm_prepare(void) 275static void exynos5420_pm_prepare(void)
234{ 276{
235 unsigned int tmp; 277 unsigned int tmp;
@@ -344,6 +386,28 @@ early_wakeup:
344 pmu_raw_writel(0x0, S5P_INFORM1); 386 pmu_raw_writel(0x0, S5P_INFORM1);
345} 387}
346 388
389static void exynos3250_pm_resume(void)
390{
391 u32 cpuid = read_cpuid_part();
392
393 if (exynos_pm_central_resume())
394 goto early_wakeup;
395
396 /* For release retention */
397 exynos_pm_release_retention();
398
399 pmu_raw_writel(S5P_USE_STANDBY_WFI_ALL, S5P_CENTRAL_SEQ_OPTION);
400
401 if (call_firmware_op(resume) == -ENOSYS
402 && cpuid == ARM_CPU_PART_CORTEX_A9)
403 exynos_cpu_restore_register();
404
405early_wakeup:
406
407 /* Clear SLEEP mode set in INFORM1 */
408 pmu_raw_writel(0x0, S5P_INFORM1);
409}
410
347static void exynos5420_prepare_pm_resume(void) 411static void exynos5420_prepare_pm_resume(void)
348{ 412{
349 if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM)) 413 if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM))
@@ -483,6 +547,16 @@ static const struct platform_suspend_ops exynos_suspend_ops = {
483 .valid = suspend_valid_only_mem, 547 .valid = suspend_valid_only_mem,
484}; 548};
485 549
550static const struct exynos_pm_data exynos3250_pm_data = {
551 .wkup_irq = exynos3250_wkup_irq,
552 .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)),
553 .release_ret_regs = exynos3250_release_ret_regs,
554 .pm_suspend = exynos_pm_suspend,
555 .pm_resume = exynos3250_pm_resume,
556 .pm_prepare = exynos3250_pm_prepare,
557 .cpu_suspend = exynos3250_cpu_suspend,
558};
559
486static const struct exynos_pm_data exynos4_pm_data = { 560static const struct exynos_pm_data exynos4_pm_data = {
487 .wkup_irq = exynos4_wkup_irq, 561 .wkup_irq = exynos4_wkup_irq,
488 .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)), 562 .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)),
@@ -518,6 +592,9 @@ static struct exynos_pm_data exynos5420_pm_data = {
518 592
519static struct of_device_id exynos_pmu_of_device_ids[] = { 593static struct of_device_id exynos_pmu_of_device_ids[] = {
520 { 594 {
595 .compatible = "samsung,exynos3250-pmu",
596 .data = &exynos3250_pm_data,
597 }, {
521 .compatible = "samsung,exynos4210-pmu", 598 .compatible = "samsung,exynos4210-pmu",
522 .data = &exynos4_pm_data, 599 .data = &exynos4_pm_data,
523 }, { 600 }, {
diff --git a/arch/arm/plat-samsung/cpu.c b/arch/arm/plat-samsung/cpu.c
index 360618ee39e5..71333bb61013 100644
--- a/arch/arm/plat-samsung/cpu.c
+++ b/arch/arm/plat-samsung/cpu.c
@@ -40,10 +40,14 @@ void __init s3c64xx_init_cpu(void)
40 } 40 }
41 41
42 samsung_cpu_rev = 0; 42 samsung_cpu_rev = 0;
43
44 pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id);
43} 45}
44 46
45void __init s5p_init_cpu(void __iomem *cpuid_addr) 47void __init s5p_init_cpu(void __iomem *cpuid_addr)
46{ 48{
47 samsung_cpu_id = __raw_readl(cpuid_addr); 49 samsung_cpu_id = __raw_readl(cpuid_addr);
48 samsung_cpu_rev = samsung_cpu_id & 0xFF; 50 samsung_cpu_rev = samsung_cpu_id & 0xFF;
51
52 pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id);
49} 53}