aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 12:27:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 12:27:54 -0500
commit878ba61aa98cbb97a513757800e77613f856a029 (patch)
treec03b8373cdb7163f81141a867c9cda1a9f71e73e /arch/arm/mach-exynos
parentea7531ac4a9d0b39edce43472147dc41cc2b7a34 (diff)
parentdf1a66812535e04bfd960e15d5be4893853b6730 (diff)
Merge tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC platform changes from Olof Johansson: "New and updated SoC support. Also included are some cleanups where the platform maintainers hadn't separated cleanups from new developent in separate branches. Some of the larger things worth pointing out: - A large set of changes from Alexandre Belloni and Nicolas Ferre preparing at91 platforms for multiplatform and cleaning up quite a bit in the process. - Removal of CSR's "Marco" SoC platform that never made it out to the market. We love seeing these since it means the vendor published support before product was out, which is exactly what we want! New platforms this release are: - Conexant Digicolor (CX92755 SoC) - Hisilicon HiP01 SoC - CSR/sirf Atlas7 SoC - ST STiH418 SoC - Common code changes for Nvidia Tegra132 (64-bit SoC) We're seeing more and more platforms having a harder time labelling changes as cleanups vs new development -- which is a good sign that we've come quite far on the cleanup effort. So over time we might start combining the cleanup and new-development branches more" * tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (124 commits) ARM: at91/trivial: unify functions and machine names ARM: at91: remove at91_dt_initialize and machine init_early() ARM: at91: change board files into SoC files ARM: at91: remove at91_boot_soc ARM: at91: move alternative initial mapping to board-dt-sama5.c ARM: at91: merge all SOC_AT91SAM9xxx ARM: at91: at91rm9200: set idle and restart from rm9200_dt_device_init() ARM: digicolor: select syscon and timer ARM: zynq: Simplify SLCR initialization ARM: zynq: PM: Fixed simple typo. ARM: zynq: Setup default gpio number for Xilinx Zynq ARM: digicolor: add low level debug support ARM: initial support for Conexant Digicolor CX92755 SoC ARM: OMAP2+: Add dm816x hwmod support ARM: OMAP2+: Add clock domain support for dm816x ARM: OMAP2+: Add board-generic.c entry for ti81xx ARM: at91: pm: remove warning to remove SOC_AT91SAM9263 usage ARM: at91: remove unused mach/system_rev.h ARM: at91: stop using HAVE_AT91_DBGUx ARM: at91: fix ordering of SRAM and PM initialization ...
Diffstat (limited to 'arch/arm/mach-exynos')
-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
3 files changed, 81 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 2c844393cc4b..78eca99b98d1 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -247,6 +247,7 @@ static void __init exynos_reserve(void)
247 "samsung,mfc-v5", 247 "samsung,mfc-v5",
248 "samsung,mfc-v6", 248 "samsung,mfc-v6",
249 "samsung,mfc-v7", 249 "samsung,mfc-v7",
250 "samsung,mfc-v8",
250 }; 251 };
251 252
252 for (i = 0; i < ARRAY_SIZE(mfc_mem); i++) 253 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 342797b9bf3b..82e6b6fba23f 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -86,6 +86,12 @@ static unsigned int exynos_pmu_spare3;
86 86
87static u32 exynos_irqwake_intmask = 0xffffffff; 87static u32 exynos_irqwake_intmask = 0xffffffff;
88 88
89static const struct exynos_wkup_irq exynos3250_wkup_irq[] = {
90 { 73, BIT(1) }, /* RTC alarm */
91 { 74, BIT(2) }, /* RTC tick */
92 { /* sentinel */ },
93};
94
89static const struct exynos_wkup_irq exynos4_wkup_irq[] = { 95static const struct exynos_wkup_irq exynos4_wkup_irq[] = {
90 { 76, BIT(1) }, /* RTC alarm */ 96 { 76, BIT(1) }, /* RTC alarm */
91 { 77, BIT(2) }, /* RTC tick */ 97 { 77, BIT(2) }, /* RTC tick */
@@ -109,6 +115,19 @@ unsigned int exynos_release_ret_regs[] = {
109 REG_TABLE_END, 115 REG_TABLE_END,
110}; 116};
111 117
118unsigned int exynos3250_release_ret_regs[] = {
119 S5P_PAD_RET_MAUDIO_OPTION,
120 S5P_PAD_RET_GPIO_OPTION,
121 S5P_PAD_RET_UART_OPTION,
122 S5P_PAD_RET_MMCA_OPTION,
123 S5P_PAD_RET_MMCB_OPTION,
124 S5P_PAD_RET_EBIA_OPTION,
125 S5P_PAD_RET_EBIB_OPTION,
126 S5P_PAD_RET_MMC2_OPTION,
127 S5P_PAD_RET_SPI_OPTION,
128 REG_TABLE_END,
129};
130
112unsigned int exynos5420_release_ret_regs[] = { 131unsigned int exynos5420_release_ret_regs[] = {
113 EXYNOS_PAD_RET_DRAM_OPTION, 132 EXYNOS_PAD_RET_DRAM_OPTION,
114 EXYNOS_PAD_RET_MAUDIO_OPTION, 133 EXYNOS_PAD_RET_MAUDIO_OPTION,
@@ -168,6 +187,12 @@ static int exynos_cpu_suspend(unsigned long arg)
168 return exynos_cpu_do_idle(); 187 return exynos_cpu_do_idle();
169} 188}
170 189
190static int exynos3250_cpu_suspend(unsigned long arg)
191{
192 flush_cache_all();
193 return exynos_cpu_do_idle();
194}
195
171static int exynos5420_cpu_suspend(unsigned long arg) 196static int exynos5420_cpu_suspend(unsigned long arg)
172{ 197{
173 /* MCPM works with HW CPU identifiers */ 198 /* MCPM works with HW CPU identifiers */
@@ -225,6 +250,23 @@ static void exynos_pm_prepare(void)
225 pmu_raw_writel(virt_to_phys(exynos_cpu_resume), S5P_INFORM0); 250 pmu_raw_writel(virt_to_phys(exynos_cpu_resume), S5P_INFORM0);
226} 251}
227 252
253static void exynos3250_pm_prepare(void)
254{
255 unsigned int tmp;
256
257 /* Set wake-up mask registers */
258 exynos_pm_set_wakeup_mask();
259
260 tmp = pmu_raw_readl(EXYNOS3_ARM_L2_OPTION);
261 tmp &= ~EXYNOS5_OPTION_USE_RETENTION;
262 pmu_raw_writel(tmp, EXYNOS3_ARM_L2_OPTION);
263
264 exynos_pm_enter_sleep_mode();
265
266 /* ensure at least INFORM0 has the resume address */
267 pmu_raw_writel(virt_to_phys(exynos_cpu_resume), S5P_INFORM0);
268}
269
228static void exynos5420_pm_prepare(void) 270static void exynos5420_pm_prepare(void)
229{ 271{
230 unsigned int tmp; 272 unsigned int tmp;
@@ -339,6 +381,28 @@ early_wakeup:
339 pmu_raw_writel(0x0, S5P_INFORM1); 381 pmu_raw_writel(0x0, S5P_INFORM1);
340} 382}
341 383
384static void exynos3250_pm_resume(void)
385{
386 u32 cpuid = read_cpuid_part();
387
388 if (exynos_pm_central_resume())
389 goto early_wakeup;
390
391 /* For release retention */
392 exynos_pm_release_retention();
393
394 pmu_raw_writel(S5P_USE_STANDBY_WFI_ALL, S5P_CENTRAL_SEQ_OPTION);
395
396 if (call_firmware_op(resume) == -ENOSYS
397 && cpuid == ARM_CPU_PART_CORTEX_A9)
398 exynos_cpu_restore_register();
399
400early_wakeup:
401
402 /* Clear SLEEP mode set in INFORM1 */
403 pmu_raw_writel(0x0, S5P_INFORM1);
404}
405
342static void exynos5420_prepare_pm_resume(void) 406static void exynos5420_prepare_pm_resume(void)
343{ 407{
344 if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM)) 408 if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM))
@@ -478,6 +542,16 @@ static const struct platform_suspend_ops exynos_suspend_ops = {
478 .valid = suspend_valid_only_mem, 542 .valid = suspend_valid_only_mem,
479}; 543};
480 544
545static const struct exynos_pm_data exynos3250_pm_data = {
546 .wkup_irq = exynos3250_wkup_irq,
547 .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)),
548 .release_ret_regs = exynos3250_release_ret_regs,
549 .pm_suspend = exynos_pm_suspend,
550 .pm_resume = exynos3250_pm_resume,
551 .pm_prepare = exynos3250_pm_prepare,
552 .cpu_suspend = exynos3250_cpu_suspend,
553};
554
481static const struct exynos_pm_data exynos4_pm_data = { 555static const struct exynos_pm_data exynos4_pm_data = {
482 .wkup_irq = exynos4_wkup_irq, 556 .wkup_irq = exynos4_wkup_irq,
483 .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)), 557 .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)),
@@ -511,6 +585,9 @@ static struct exynos_pm_data exynos5420_pm_data = {
511 585
512static struct of_device_id exynos_pmu_of_device_ids[] = { 586static struct of_device_id exynos_pmu_of_device_ids[] = {
513 { 587 {
588 .compatible = "samsung,exynos3250-pmu",
589 .data = &exynos3250_pm_data,
590 }, {
514 .compatible = "samsung,exynos4210-pmu", 591 .compatible = "samsung,exynos4210-pmu",
515 .data = &exynos4_pm_data, 592 .data = &exynos4_pm_data,
516 }, { 593 }, {