aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2014-02-22 14:14:49 -0500
committerJason Cooper <jason@lakedaemon.net>2014-02-22 15:41:53 -0500
commitd364eecf7ac632ec8db6cbee2c2ddee48c488b98 (patch)
treedf04d0f0d883c3c4a3527cd44d0f1f56ce53344c
parent7f28fd6ebebb70eb2412f2775f2a19e3834601f6 (diff)
ARM: kirkwood: ioremap memory control register
To allow removal of the global map of registers, make the pm code ioremap the registers it needs. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Tested-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
-rw-r--r--arch/arm/mach-kirkwood/include/mach/bridge-regs.h1
-rw-r--r--arch/arm/mach-kirkwood/pm.c9
2 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
index 2bd12fde1781..6e5077e2ec26 100644
--- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
+++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
@@ -80,5 +80,6 @@
80#define CGC_RESERVED (0x6 << 21) 80#define CGC_RESERVED (0x6 << 21)
81 81
82#define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118) 82#define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118)
83#define MEMORY_PM_CTRL_PHYS (BRIDGE_PHYS_BASE + 0x118)
83 84
84#endif 85#endif
diff --git a/arch/arm/mach-kirkwood/pm.c b/arch/arm/mach-kirkwood/pm.c
index c6ab8d9303a5..8e5e0329d04c 100644
--- a/arch/arm/mach-kirkwood/pm.c
+++ b/arch/arm/mach-kirkwood/pm.c
@@ -21,15 +21,16 @@
21#include "common.h" 21#include "common.h"
22 22
23static void __iomem *ddr_operation_base; 23static void __iomem *ddr_operation_base;
24static void __iomem *memory_pm_ctrl;
24 25
25static void kirkwood_low_power(void) 26static void kirkwood_low_power(void)
26{ 27{
27 u32 mem_pm_ctrl; 28 u32 mem_pm_ctrl;
28 29
29 mem_pm_ctrl = readl(MEMORY_PM_CTRL); 30 mem_pm_ctrl = readl(memory_pm_ctrl);
30 31
31 /* Set peripherals to low-power mode */ 32 /* Set peripherals to low-power mode */
32 writel_relaxed(~0, MEMORY_PM_CTRL); 33 writel_relaxed(~0, memory_pm_ctrl);
33 34
34 /* Set DDR in self-refresh */ 35 /* Set DDR in self-refresh */
35 writel_relaxed(0x7, ddr_operation_base); 36 writel_relaxed(0x7, ddr_operation_base);
@@ -41,7 +42,7 @@ static void kirkwood_low_power(void)
41 */ 42 */
42 cpu_do_idle(); 43 cpu_do_idle();
43 44
44 writel_relaxed(mem_pm_ctrl, MEMORY_PM_CTRL); 45 writel_relaxed(mem_pm_ctrl, memory_pm_ctrl);
45} 46}
46 47
47static int kirkwood_suspend_enter(suspend_state_t state) 48static int kirkwood_suspend_enter(suspend_state_t state)
@@ -69,5 +70,7 @@ static const struct platform_suspend_ops kirkwood_suspend_ops = {
69void __init kirkwood_pm_init(void) 70void __init kirkwood_pm_init(void)
70{ 71{
71 ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4); 72 ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4);
73 memory_pm_ctrl = ioremap(MEMORY_PM_CTRL_PHYS, 4);
74
72 suspend_set_ops(&kirkwood_suspend_ops); 75 suspend_set_ops(&kirkwood_suspend_ops);
73} 76}