aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-08 17:13:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-08 17:13:04 -0400
commitcf377ad7d42c566356d79049536d9cb37499cb77 (patch)
tree266371ff3a9462dcbaa9567e20c9a34722e3b32f /arch/arm/mach-omap2
parent212fe84a6f215c39795a76517c1c02114d428681 (diff)
parentd8f0faa339b0beff6e055218e10b2982422db540 (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 Arnd Bergmann: "New and updated SoC support. Among the things new for this release are: - at91: Added support for the new SAMA5D4 SoC, following the earlier SAMA5D3 - bcm: Added support for BCM63XX family of DSL SoCs - hisi: Added support for HiP04 server-class SoC - meson: Initial support for the Amlogic Meson6 (aka 8726MX) platform - shmobile: added support for new r8a7794 (R-Car E2) automotive SoC Noteworthy changes to existing SoC support are: - imx: convert i.MX1 to device tree - omap: lots of power management work - omap: base support to enable moving to standard UART driver - shmobile: lots of progress for multiplatform support, still ongoing" * tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (171 commits) ARM: hisi: depend on ARCH_MULTI_V7 CNS3xxx: Fix debug UART. ARM: at91: fix nommu build regression ARM: meson: add basic support for MesonX SoCs ARM: meson: debug: add debug UART for earlyprintk support irq: Export handle_fasteoi_irq ARM: mediatek: Add earlyprintk support for mt6589 ARM: hisi: Fix platmcpm compilation when ARMv6 is selected ARM: debug: fix alphanumerical order on debug uarts ARM: at91: document Atmel SMART compatibles ARM: at91: add sama5d4 support to sama5_defconfig ARM: at91: dt: add device tree file for SAMA5D4ek board ARM: at91: dt: add device tree file for SAMA5D4 SoC ARM: at91: SAMA5D4 SoC detection code and low level routines ARM: at91: introduce basic SAMA5D4 support clk: at91: add a driver for the h32mx clock ARM: pxa3xx: provide specific platform_devices for all ssp ports ARM: pxa: ssp: provide platform_device_id for PXA3xx ARM: OMAP4+: Remove static iotable mappings for SRAM ARM: OMAP4+: Move SRAM data to DT ...
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/Kconfig5
-rw-r--r--arch/arm/mach-omap2/Makefile12
-rw-r--r--arch/arm/mach-omap2/common.h2
-rw-r--r--arch/arm/mach-omap2/io.c23
-rw-r--r--arch/arm/mach-omap2/omap-mpuss-lowpower.c102
-rw-r--r--arch/arm/mach-omap2/omap-secure.h1
-rw-r--r--arch/arm/mach-omap2/omap-wakeupgen.c20
-rw-r--r--arch/arm/mach-omap2/omap-wakeupgen.h1
-rw-r--r--arch/arm/mach-omap2/omap4-common.c22
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c4
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h4
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c12
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c10
-rw-r--r--arch/arm/mach-omap2/pm.h1
-rw-r--r--arch/arm/mach-omap2/pm44xx.c48
-rw-r--r--arch/arm/mach-omap2/prm3xxx.c18
-rw-r--r--arch/arm/mach-omap2/prm44xx.c90
-rw-r--r--arch/arm/mach-omap2/prminst44xx.c40
-rw-r--r--arch/arm/mach-omap2/prminst44xx.h3
-rw-r--r--arch/arm/mach-omap2/sram.c39
-rw-r--r--arch/arm/mach-omap2/sram.h7
21 files changed, 320 insertions, 144 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 08d4167cc7c5..75212c064b31 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -22,7 +22,6 @@ config ARCH_OMAP4
22 bool "TI OMAP4" 22 bool "TI OMAP4"
23 depends on ARCH_MULTI_V7 23 depends on ARCH_MULTI_V7
24 select ARCH_OMAP2PLUS 24 select ARCH_OMAP2PLUS
25 select ARCH_HAS_OPP
26 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP 25 select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
27 select ARM_CPU_SUSPEND if PM 26 select ARM_CPU_SUSPEND if PM
28 select ARM_ERRATA_720789 27 select ARM_ERRATA_720789
@@ -41,7 +40,6 @@ config SOC_OMAP5
41 bool "TI OMAP5" 40 bool "TI OMAP5"
42 depends on ARCH_MULTI_V7 41 depends on ARCH_MULTI_V7
43 select ARCH_OMAP2PLUS 42 select ARCH_OMAP2PLUS
44 select ARCH_HAS_OPP
45 select ARM_CPU_SUSPEND if PM 43 select ARM_CPU_SUSPEND if PM
46 select ARM_GIC 44 select ARM_GIC
47 select HAVE_ARM_SCU if SMP 45 select HAVE_ARM_SCU if SMP
@@ -53,14 +51,12 @@ config SOC_AM33XX
53 bool "TI AM33XX" 51 bool "TI AM33XX"
54 depends on ARCH_MULTI_V7 52 depends on ARCH_MULTI_V7
55 select ARCH_OMAP2PLUS 53 select ARCH_OMAP2PLUS
56 select ARCH_HAS_OPP
57 select ARM_CPU_SUSPEND if PM 54 select ARM_CPU_SUSPEND if PM
58 55
59config SOC_AM43XX 56config SOC_AM43XX
60 bool "TI AM43x" 57 bool "TI AM43x"
61 depends on ARCH_MULTI_V7 58 depends on ARCH_MULTI_V7
62 select ARCH_OMAP2PLUS 59 select ARCH_OMAP2PLUS
63 select ARCH_HAS_OPP
64 select ARM_GIC 60 select ARM_GIC
65 select MACH_OMAP_GENERIC 61 select MACH_OMAP_GENERIC
66 select MIGHT_HAVE_CACHE_L2X0 62 select MIGHT_HAVE_CACHE_L2X0
@@ -69,7 +65,6 @@ config SOC_DRA7XX
69 bool "TI DRA7XX" 65 bool "TI DRA7XX"
70 depends on ARCH_MULTI_V7 66 depends on ARCH_MULTI_V7
71 select ARCH_OMAP2PLUS 67 select ARCH_OMAP2PLUS
72 select ARCH_HAS_OPP
73 select ARM_CPU_SUSPEND if PM 68 select ARM_CPU_SUSPEND if PM
74 select ARM_GIC 69 select ARM_GIC
75 select HAVE_ARM_ARCH_TIMER 70 select HAVE_ARM_ARCH_TIMER
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 69bbcba8842f..d9dd99c6aa28 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -87,9 +87,10 @@ ifeq ($(CONFIG_PM),y)
87obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o 87obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o
88obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o 88obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o
89obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o 89obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o
90obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o omap-mpuss-lowpower.o 90omap-4-5-pm-common = pm44xx.o omap-mpuss-lowpower.o
91obj-$(CONFIG_SOC_OMAP5) += omap-mpuss-lowpower.o 91obj-$(CONFIG_ARCH_OMAP4) += $(omap-4-5-pm-common)
92obj-$(CONFIG_SOC_DRA7XX) += omap-mpuss-lowpower.o 92obj-$(CONFIG_SOC_OMAP5) += $(omap-4-5-pm-common)
93obj-$(CONFIG_SOC_DRA7XX) += $(omap-4-5-pm-common)
93obj-$(CONFIG_PM_DEBUG) += pm-debug.o 94obj-$(CONFIG_PM_DEBUG) += pm-debug.o
94 95
95obj-$(CONFIG_POWER_AVS_OMAP) += sr_device.o 96obj-$(CONFIG_POWER_AVS_OMAP) += sr_device.o
@@ -102,7 +103,10 @@ endif
102 103
103ifeq ($(CONFIG_CPU_IDLE),y) 104ifeq ($(CONFIG_CPU_IDLE),y)
104obj-$(CONFIG_ARCH_OMAP3) += cpuidle34xx.o 105obj-$(CONFIG_ARCH_OMAP3) += cpuidle34xx.o
105obj-$(CONFIG_ARCH_OMAP4) += cpuidle44xx.o 106omap-4-5-idle-common = cpuidle44xx.o
107obj-$(CONFIG_ARCH_OMAP4) += $(omap-4-5-idle-common)
108obj-$(CONFIG_SOC_OMAP5) += $(omap-4-5-idle-common)
109obj-$(CONFIG_SOC_DRA7XX) += $(omap-4-5-idle-common)
106endif 110endif
107 111
108# PRCM 112# PRCM
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 79664411e794..98fe235f6670 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -60,7 +60,7 @@ static inline int omap3_pm_init(void)
60} 60}
61#endif 61#endif
62 62
63#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP4) 63#if defined(CONFIG_PM) && (defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX))
64int omap4_pm_init(void); 64int omap4_pm_init(void);
65int omap4_pm_init_early(void); 65int omap4_pm_init_early(void);
66#else 66#else
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 5d0667c119f6..b8ad045bcb8d 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -231,15 +231,6 @@ static struct map_desc omap44xx_io_desc[] __initdata = {
231 .length = L4_PER_44XX_SIZE, 231 .length = L4_PER_44XX_SIZE,
232 .type = MT_DEVICE, 232 .type = MT_DEVICE,
233 }, 233 },
234#ifdef CONFIG_OMAP4_ERRATA_I688
235 {
236 .virtual = OMAP4_SRAM_VA,
237 .pfn = __phys_to_pfn(OMAP4_SRAM_PA),
238 .length = PAGE_SIZE,
239 .type = MT_MEMORY_RW_SO,
240 },
241#endif
242
243}; 234};
244#endif 235#endif
245 236
@@ -269,14 +260,6 @@ static struct map_desc omap54xx_io_desc[] __initdata = {
269 .length = L4_PER_54XX_SIZE, 260 .length = L4_PER_54XX_SIZE,
270 .type = MT_DEVICE, 261 .type = MT_DEVICE,
271 }, 262 },
272#ifdef CONFIG_OMAP4_ERRATA_I688
273 {
274 .virtual = OMAP4_SRAM_VA,
275 .pfn = __phys_to_pfn(OMAP4_SRAM_PA),
276 .length = PAGE_SIZE,
277 .type = MT_MEMORY_RW_SO,
278 },
279#endif
280}; 263};
281#endif 264#endif
282 265
@@ -667,6 +650,7 @@ void __init omap5_init_early(void)
667 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_AON_BASE), 650 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_AON_BASE),
668 OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_BASE)); 651 OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_BASE));
669 omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); 652 omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE));
653 omap4_pm_init_early();
670 omap_prm_base_init(); 654 omap_prm_base_init();
671 omap_cm_base_init(); 655 omap_cm_base_init();
672 omap44xx_prm_init(); 656 omap44xx_prm_init();
@@ -682,6 +666,8 @@ void __init omap5_init_early(void)
682void __init omap5_init_late(void) 666void __init omap5_init_late(void)
683{ 667{
684 omap_common_late_init(); 668 omap_common_late_init();
669 omap4_pm_init();
670 omap2_clk_enable_autoidle_all();
685} 671}
686#endif 672#endif
687 673
@@ -695,6 +681,7 @@ void __init dra7xx_init_early(void)
695 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(DRA7XX_CM_CORE_AON_BASE), 681 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(DRA7XX_CM_CORE_AON_BASE),
696 OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_BASE)); 682 OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_BASE));
697 omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE)); 683 omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE));
684 omap4_pm_init_early();
698 omap_prm_base_init(); 685 omap_prm_base_init();
699 omap_cm_base_init(); 686 omap_cm_base_init();
700 omap44xx_prm_init(); 687 omap44xx_prm_init();
@@ -709,6 +696,8 @@ void __init dra7xx_init_early(void)
709void __init dra7xx_init_late(void) 696void __init dra7xx_init_late(void)
710{ 697{
711 omap_common_late_init(); 698 omap_common_late_init();
699 omap4_pm_init();
700 omap2_clk_enable_autoidle_all();
712} 701}
713#endif 702#endif
714 703
diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
index e9cdacfe1923..6944ae3674e8 100644
--- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c
+++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
@@ -56,6 +56,7 @@
56#include "omap4-sar-layout.h" 56#include "omap4-sar-layout.h"
57#include "pm.h" 57#include "pm.h"
58#include "prcm_mpu44xx.h" 58#include "prcm_mpu44xx.h"
59#include "prcm_mpu54xx.h"
59#include "prminst44xx.h" 60#include "prminst44xx.h"
60#include "prcm44xx.h" 61#include "prcm44xx.h"
61#include "prm44xx.h" 62#include "prm44xx.h"
@@ -68,7 +69,6 @@ struct omap4_cpu_pm_info {
68 void __iomem *scu_sar_addr; 69 void __iomem *scu_sar_addr;
69 void __iomem *wkup_sar_addr; 70 void __iomem *wkup_sar_addr;
70 void __iomem *l2x0_sar_addr; 71 void __iomem *l2x0_sar_addr;
71 void (*secondary_startup)(void);
72}; 72};
73 73
74/** 74/**
@@ -76,6 +76,7 @@ struct omap4_cpu_pm_info {
76 * @finish_suspend: CPU suspend finisher function pointer 76 * @finish_suspend: CPU suspend finisher function pointer
77 * @resume: CPU resume function pointer 77 * @resume: CPU resume function pointer
78 * @scu_prepare: CPU Snoop Control program function pointer 78 * @scu_prepare: CPU Snoop Control program function pointer
79 * @hotplug_restart: CPU restart function pointer
79 * 80 *
80 * Structure holds functions pointer for CPU low power operations like 81 * Structure holds functions pointer for CPU low power operations like
81 * suspend, resume and scu programming. 82 * suspend, resume and scu programming.
@@ -84,11 +85,13 @@ struct cpu_pm_ops {
84 int (*finish_suspend)(unsigned long cpu_state); 85 int (*finish_suspend)(unsigned long cpu_state);
85 void (*resume)(void); 86 void (*resume)(void);
86 void (*scu_prepare)(unsigned int cpu_id, unsigned int cpu_state); 87 void (*scu_prepare)(unsigned int cpu_id, unsigned int cpu_state);
88 void (*hotplug_restart)(void);
87}; 89};
88 90
89static DEFINE_PER_CPU(struct omap4_cpu_pm_info, omap4_pm_info); 91static DEFINE_PER_CPU(struct omap4_cpu_pm_info, omap4_pm_info);
90static struct powerdomain *mpuss_pd; 92static struct powerdomain *mpuss_pd;
91static void __iomem *sar_base; 93static void __iomem *sar_base;
94static u32 cpu_context_offset;
92 95
93static int default_finish_suspend(unsigned long cpu_state) 96static int default_finish_suspend(unsigned long cpu_state)
94{ 97{
@@ -106,6 +109,7 @@ struct cpu_pm_ops omap_pm_ops = {
106 .finish_suspend = default_finish_suspend, 109 .finish_suspend = default_finish_suspend,
107 .resume = dummy_cpu_resume, 110 .resume = dummy_cpu_resume,
108 .scu_prepare = dummy_scu_prepare, 111 .scu_prepare = dummy_scu_prepare,
112 .hotplug_restart = dummy_cpu_resume,
109}; 113};
110 114
111/* 115/*
@@ -116,7 +120,8 @@ static inline void set_cpu_wakeup_addr(unsigned int cpu_id, u32 addr)
116{ 120{
117 struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id); 121 struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
118 122
119 writel_relaxed(addr, pm_info->wkup_sar_addr); 123 if (pm_info->wkup_sar_addr)
124 writel_relaxed(addr, pm_info->wkup_sar_addr);
120} 125}
121 126
122/* 127/*
@@ -141,7 +146,8 @@ static void scu_pwrst_prepare(unsigned int cpu_id, unsigned int cpu_state)
141 break; 146 break;
142 } 147 }
143 148
144 writel_relaxed(scu_pwr_st, pm_info->scu_sar_addr); 149 if (pm_info->scu_sar_addr)
150 writel_relaxed(scu_pwr_st, pm_info->scu_sar_addr);
145} 151}
146 152
147/* Helper functions for MPUSS OSWR */ 153/* Helper functions for MPUSS OSWR */
@@ -161,14 +167,14 @@ static inline void cpu_clear_prev_logic_pwrst(unsigned int cpu_id)
161 167
162 if (cpu_id) { 168 if (cpu_id) {
163 reg = omap4_prcm_mpu_read_inst_reg(OMAP4430_PRCM_MPU_CPU1_INST, 169 reg = omap4_prcm_mpu_read_inst_reg(OMAP4430_PRCM_MPU_CPU1_INST,
164 OMAP4_RM_CPU1_CPU1_CONTEXT_OFFSET); 170 cpu_context_offset);
165 omap4_prcm_mpu_write_inst_reg(reg, OMAP4430_PRCM_MPU_CPU1_INST, 171 omap4_prcm_mpu_write_inst_reg(reg, OMAP4430_PRCM_MPU_CPU1_INST,
166 OMAP4_RM_CPU1_CPU1_CONTEXT_OFFSET); 172 cpu_context_offset);
167 } else { 173 } else {
168 reg = omap4_prcm_mpu_read_inst_reg(OMAP4430_PRCM_MPU_CPU0_INST, 174 reg = omap4_prcm_mpu_read_inst_reg(OMAP4430_PRCM_MPU_CPU0_INST,
169 OMAP4_RM_CPU0_CPU0_CONTEXT_OFFSET); 175 cpu_context_offset);
170 omap4_prcm_mpu_write_inst_reg(reg, OMAP4430_PRCM_MPU_CPU0_INST, 176 omap4_prcm_mpu_write_inst_reg(reg, OMAP4430_PRCM_MPU_CPU0_INST,
171 OMAP4_RM_CPU0_CPU0_CONTEXT_OFFSET); 177 cpu_context_offset);
172 } 178 }
173} 179}
174 180
@@ -179,7 +185,8 @@ static void l2x0_pwrst_prepare(unsigned int cpu_id, unsigned int save_state)
179{ 185{
180 struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id); 186 struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu_id);
181 187
182 writel_relaxed(save_state, pm_info->l2x0_sar_addr); 188 if (pm_info->l2x0_sar_addr)
189 writel_relaxed(save_state, pm_info->l2x0_sar_addr);
183} 190}
184 191
185/* 192/*
@@ -189,10 +196,14 @@ static void l2x0_pwrst_prepare(unsigned int cpu_id, unsigned int save_state)
189#ifdef CONFIG_CACHE_L2X0 196#ifdef CONFIG_CACHE_L2X0
190static void __init save_l2x0_context(void) 197static void __init save_l2x0_context(void)
191{ 198{
192 writel_relaxed(l2x0_saved_regs.aux_ctrl, 199 void __iomem *l2x0_base = omap4_get_l2cache_base();
193 sar_base + L2X0_AUXCTRL_OFFSET); 200
194 writel_relaxed(l2x0_saved_regs.prefetch_ctrl, 201 if (l2x0_base && sar_base) {
195 sar_base + L2X0_PREFETCH_CTRL_OFFSET); 202 writel_relaxed(l2x0_saved_regs.aux_ctrl,
203 sar_base + L2X0_AUXCTRL_OFFSET);
204 writel_relaxed(l2x0_saved_regs.prefetch_ctrl,
205 sar_base + L2X0_PREFETCH_CTRL_OFFSET);
206 }
196} 207}
197#else 208#else
198static void __init save_l2x0_context(void) 209static void __init save_l2x0_context(void)
@@ -231,6 +242,10 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
231 save_state = 1; 242 save_state = 1;
232 break; 243 break;
233 case PWRDM_POWER_RET: 244 case PWRDM_POWER_RET:
245 if (IS_PM44XX_ERRATUM(PM_OMAP4_CPU_OSWR_DISABLE)) {
246 save_state = 0;
247 break;
248 }
234 default: 249 default:
235 /* 250 /*
236 * CPUx CSWR is invalid hardware state. Also CPUx OSWR 251 * CPUx CSWR is invalid hardware state. Also CPUx OSWR
@@ -307,7 +322,7 @@ int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state)
307 322
308 pwrdm_clear_all_prev_pwrst(pm_info->pwrdm); 323 pwrdm_clear_all_prev_pwrst(pm_info->pwrdm);
309 pwrdm_set_next_pwrst(pm_info->pwrdm, power_state); 324 pwrdm_set_next_pwrst(pm_info->pwrdm, power_state);
310 set_cpu_wakeup_addr(cpu, virt_to_phys(pm_info->secondary_startup)); 325 set_cpu_wakeup_addr(cpu, virt_to_phys(omap_pm_ops.hotplug_restart));
311 omap_pm_ops.scu_prepare(cpu, power_state); 326 omap_pm_ops.scu_prepare(cpu, power_state);
312 327
313 /* 328 /*
@@ -323,6 +338,21 @@ int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state)
323 338
324 339
325/* 340/*
341 * Enable Mercury Fast HG retention mode by default.
342 */
343static void enable_mercury_retention_mode(void)
344{
345 u32 reg;
346
347 reg = omap4_prcm_mpu_read_inst_reg(OMAP54XX_PRCM_MPU_DEVICE_INST,
348 OMAP54XX_PRCM_MPU_PRM_PSCON_COUNT_OFFSET);
349 /* Enable HG_EN, HG_RAMPUP = fast mode */
350 reg |= BIT(24) | BIT(25);
351 omap4_prcm_mpu_write_inst_reg(reg, OMAP54XX_PRCM_MPU_DEVICE_INST,
352 OMAP54XX_PRCM_MPU_PRM_PSCON_COUNT_OFFSET);
353}
354
355/*
326 * Initialise OMAP4 MPUSS 356 * Initialise OMAP4 MPUSS
327 */ 357 */
328int __init omap4_mpuss_init(void) 358int __init omap4_mpuss_init(void)
@@ -334,13 +364,17 @@ int __init omap4_mpuss_init(void)
334 return -ENODEV; 364 return -ENODEV;
335 } 365 }
336 366
337 sar_base = omap4_get_sar_ram_base(); 367 if (cpu_is_omap44xx())
368 sar_base = omap4_get_sar_ram_base();
338 369
339 /* Initilaise per CPU PM information */ 370 /* Initilaise per CPU PM information */
340 pm_info = &per_cpu(omap4_pm_info, 0x0); 371 pm_info = &per_cpu(omap4_pm_info, 0x0);
341 pm_info->scu_sar_addr = sar_base + SCU_OFFSET0; 372 if (sar_base) {
342 pm_info->wkup_sar_addr = sar_base + CPU0_WAKEUP_NS_PA_ADDR_OFFSET; 373 pm_info->scu_sar_addr = sar_base + SCU_OFFSET0;
343 pm_info->l2x0_sar_addr = sar_base + L2X0_SAVE_OFFSET0; 374 pm_info->wkup_sar_addr = sar_base +
375 CPU0_WAKEUP_NS_PA_ADDR_OFFSET;
376 pm_info->l2x0_sar_addr = sar_base + L2X0_SAVE_OFFSET0;
377 }
344 pm_info->pwrdm = pwrdm_lookup("cpu0_pwrdm"); 378 pm_info->pwrdm = pwrdm_lookup("cpu0_pwrdm");
345 if (!pm_info->pwrdm) { 379 if (!pm_info->pwrdm) {
346 pr_err("Lookup failed for CPU0 pwrdm\n"); 380 pr_err("Lookup failed for CPU0 pwrdm\n");
@@ -355,13 +389,12 @@ int __init omap4_mpuss_init(void)
355 pwrdm_set_next_pwrst(pm_info->pwrdm, PWRDM_POWER_ON); 389 pwrdm_set_next_pwrst(pm_info->pwrdm, PWRDM_POWER_ON);
356 390
357 pm_info = &per_cpu(omap4_pm_info, 0x1); 391 pm_info = &per_cpu(omap4_pm_info, 0x1);
358 pm_info->scu_sar_addr = sar_base + SCU_OFFSET1; 392 if (sar_base) {
359 pm_info->wkup_sar_addr = sar_base + CPU1_WAKEUP_NS_PA_ADDR_OFFSET; 393 pm_info->scu_sar_addr = sar_base + SCU_OFFSET1;
360 pm_info->l2x0_sar_addr = sar_base + L2X0_SAVE_OFFSET1; 394 pm_info->wkup_sar_addr = sar_base +
361 if (cpu_is_omap446x()) 395 CPU1_WAKEUP_NS_PA_ADDR_OFFSET;
362 pm_info->secondary_startup = omap4460_secondary_startup; 396 pm_info->l2x0_sar_addr = sar_base + L2X0_SAVE_OFFSET1;
363 else 397 }
364 pm_info->secondary_startup = omap4_secondary_startup;
365 398
366 pm_info->pwrdm = pwrdm_lookup("cpu1_pwrdm"); 399 pm_info->pwrdm = pwrdm_lookup("cpu1_pwrdm");
367 if (!pm_info->pwrdm) { 400 if (!pm_info->pwrdm) {
@@ -384,20 +417,27 @@ int __init omap4_mpuss_init(void)
384 pwrdm_clear_all_prev_pwrst(mpuss_pd); 417 pwrdm_clear_all_prev_pwrst(mpuss_pd);
385 mpuss_clear_prev_logic_pwrst(); 418 mpuss_clear_prev_logic_pwrst();
386 419
387 /* Save device type on scratchpad for low level code to use */ 420 if (sar_base) {
388 if (omap_type() != OMAP2_DEVICE_TYPE_GP) 421 /* Save device type on scratchpad for low level code to use */
389 writel_relaxed(1, sar_base + OMAP_TYPE_OFFSET); 422 writel_relaxed((omap_type() != OMAP2_DEVICE_TYPE_GP) ? 1 : 0,
390 else 423 sar_base + OMAP_TYPE_OFFSET);
391 writel_relaxed(0, sar_base + OMAP_TYPE_OFFSET); 424 save_l2x0_context();
392 425 }
393 save_l2x0_context();
394 426
395 if (cpu_is_omap44xx()) { 427 if (cpu_is_omap44xx()) {
396 omap_pm_ops.finish_suspend = omap4_finish_suspend; 428 omap_pm_ops.finish_suspend = omap4_finish_suspend;
397 omap_pm_ops.resume = omap4_cpu_resume; 429 omap_pm_ops.resume = omap4_cpu_resume;
398 omap_pm_ops.scu_prepare = scu_pwrst_prepare; 430 omap_pm_ops.scu_prepare = scu_pwrst_prepare;
431 omap_pm_ops.hotplug_restart = omap4_secondary_startup;
432 cpu_context_offset = OMAP4_RM_CPU0_CPU0_CONTEXT_OFFSET;
433 } else if (soc_is_omap54xx() || soc_is_dra7xx()) {
434 cpu_context_offset = OMAP54XX_RM_CPU0_CPU0_CONTEXT_OFFSET;
435 enable_mercury_retention_mode();
399 } 436 }
400 437
438 if (cpu_is_omap446x())
439 omap_pm_ops.hotplug_restart = omap4460_secondary_startup;
440
401 return 0; 441 return 0;
402} 442}
403 443
diff --git a/arch/arm/mach-omap2/omap-secure.h b/arch/arm/mach-omap2/omap-secure.h
index 3e97c6c8ecf1..dec2b05d184b 100644
--- a/arch/arm/mach-omap2/omap-secure.h
+++ b/arch/arm/mach-omap2/omap-secure.h
@@ -45,6 +45,7 @@
45#define OMAP4_MON_L2X0_PREFETCH_INDEX 0x113 45#define OMAP4_MON_L2X0_PREFETCH_INDEX 0x113
46 46
47#define OMAP5_DRA7_MON_SET_CNTFRQ_INDEX 0x109 47#define OMAP5_DRA7_MON_SET_CNTFRQ_INDEX 0x109
48#define OMAP5_MON_AMBA_IF_INDEX 0x108
48 49
49/* Secure PPA(Primary Protected Application) APIs */ 50/* Secure PPA(Primary Protected Application) APIs */
50#define OMAP4_PPA_L2_POR_INDEX 0x23 51#define OMAP4_PPA_L2_POR_INDEX 0x23
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
index 37843a7d3639..f961c46453b9 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -32,6 +32,7 @@
32#include "soc.h" 32#include "soc.h"
33#include "omap4-sar-layout.h" 33#include "omap4-sar-layout.h"
34#include "common.h" 34#include "common.h"
35#include "pm.h"
35 36
36#define AM43XX_NR_REG_BANKS 7 37#define AM43XX_NR_REG_BANKS 7
37#define AM43XX_IRQS 224 38#define AM43XX_IRQS 224
@@ -381,7 +382,7 @@ static struct notifier_block irq_notifier_block = {
381static void __init irq_pm_init(void) 382static void __init irq_pm_init(void)
382{ 383{
383 /* FIXME: Remove this when MPU OSWR support is added */ 384 /* FIXME: Remove this when MPU OSWR support is added */
384 if (!soc_is_omap54xx()) 385 if (!IS_PM44XX_ERRATUM(PM_OMAP4_CPU_OSWR_DISABLE))
385 cpu_pm_register_notifier(&irq_notifier_block); 386 cpu_pm_register_notifier(&irq_notifier_block);
386} 387}
387#else 388#else
@@ -406,6 +407,7 @@ int __init omap_wakeupgen_init(void)
406{ 407{
407 int i; 408 int i;
408 unsigned int boot_cpu = smp_processor_id(); 409 unsigned int boot_cpu = smp_processor_id();
410 u32 val;
409 411
410 /* Not supported on OMAP4 ES1.0 silicon */ 412 /* Not supported on OMAP4 ES1.0 silicon */
411 if (omap_rev() == OMAP4430_REV_ES1_0) { 413 if (omap_rev() == OMAP4430_REV_ES1_0) {
@@ -451,6 +453,22 @@ int __init omap_wakeupgen_init(void)
451 for (i = 0; i < max_irqs; i++) 453 for (i = 0; i < max_irqs; i++)
452 irq_target_cpu[i] = boot_cpu; 454 irq_target_cpu[i] = boot_cpu;
453 455
456 /*
457 * Enables OMAP5 ES2 PM Mode using ES2_PM_MODE in AMBA_IF_MODE
458 * 0x0: ES1 behavior, CPU cores would enter and exit OFF mode together.
459 * 0x1: ES2 behavior, CPU cores are allowed to enter/exit OFF mode
460 * independently.
461 * This needs to be set one time thanks to always ON domain.
462 *
463 * We do not support ES1 behavior anymore. OMAP5 is assumed to be
464 * ES2.0, and the same is applicable for DRA7.
465 */
466 if (soc_is_omap54xx() || soc_is_dra7xx()) {
467 val = __raw_readl(wakeupgen_base + OMAP_AMBA_IF_MODE);
468 val |= BIT(5);
469 omap_smc1(OMAP5_MON_AMBA_IF_INDEX, val);
470 }
471
454 irq_hotplug_init(); 472 irq_hotplug_init();
455 irq_pm_init(); 473 irq_pm_init();
456 474
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.h b/arch/arm/mach-omap2/omap-wakeupgen.h
index b0fd16f5c391..b3c8eccfae79 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.h
+++ b/arch/arm/mach-omap2/omap-wakeupgen.h
@@ -27,6 +27,7 @@
27#define OMAP_WKG_ENB_E_1 0x420 27#define OMAP_WKG_ENB_E_1 0x420
28#define OMAP_AUX_CORE_BOOT_0 0x800 28#define OMAP_AUX_CORE_BOOT_0 0x800
29#define OMAP_AUX_CORE_BOOT_1 0x804 29#define OMAP_AUX_CORE_BOOT_1 0x804
30#define OMAP_AMBA_IF_MODE 0x80c
30#define OMAP_PTMSYNCREQ_MASK 0xc00 31#define OMAP_PTMSYNCREQ_MASK 0xc00
31#define OMAP_PTMSYNCREQ_EN 0xc04 32#define OMAP_PTMSYNCREQ_EN 0xc04
32#define OMAP_TIMESTAMPCYCLELO 0xc08 33#define OMAP_TIMESTAMPCYCLELO 0xc08
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index a0fe747634c1..16b20cedc38d 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -25,6 +25,7 @@
25#include <linux/irqchip/irq-crossbar.h> 25#include <linux/irqchip/irq-crossbar.h>
26#include <linux/of_address.h> 26#include <linux/of_address.h>
27#include <linux/reboot.h> 27#include <linux/reboot.h>
28#include <linux/genalloc.h>
28 29
29#include <asm/hardware/cache-l2x0.h> 30#include <asm/hardware/cache-l2x0.h>
30#include <asm/mach/map.h> 31#include <asm/mach/map.h>
@@ -71,6 +72,26 @@ void omap_bus_sync(void)
71} 72}
72EXPORT_SYMBOL(omap_bus_sync); 73EXPORT_SYMBOL(omap_bus_sync);
73 74
75static int __init omap4_sram_init(void)
76{
77 struct device_node *np;
78 struct gen_pool *sram_pool;
79
80 np = of_find_compatible_node(NULL, NULL, "ti,omap4-mpu");
81 if (!np)
82 pr_warn("%s:Unable to allocate sram needed to handle errata I688\n",
83 __func__);
84 sram_pool = of_get_named_gen_pool(np, "sram", 0);
85 if (!sram_pool)
86 pr_warn("%s:Unable to get sram pool needed to handle errata I688\n",
87 __func__);
88 else
89 sram_sync = (void *)gen_pool_alloc(sram_pool, PAGE_SIZE);
90
91 return 0;
92}
93omap_arch_initcall(omap4_sram_init);
94
74/* Steal one page physical memory for barrier implementation */ 95/* Steal one page physical memory for barrier implementation */
75int __init omap_barrier_reserve_memblock(void) 96int __init omap_barrier_reserve_memblock(void)
76{ 97{
@@ -91,7 +112,6 @@ void __init omap_barriers_init(void)
91 dram_io_desc[0].type = MT_MEMORY_RW_SO; 112 dram_io_desc[0].type = MT_MEMORY_RW_SO;
92 iotable_init(dram_io_desc, ARRAY_SIZE(dram_io_desc)); 113 iotable_init(dram_io_desc, ARRAY_SIZE(dram_io_desc));
93 dram_sync = (void __iomem *) dram_io_desc[0].virtual; 114 dram_sync = (void __iomem *) dram_io_desc[0].virtual;
94 sram_sync = (void __iomem *) OMAP4_SRAM_VA;
95 115
96 pr_info("OMAP4: Map 0x%08llx to 0x%08lx for dram barrier\n", 116 pr_info("OMAP4: Map 0x%08llx to 0x%08lx for dram barrier\n",
97 (long long) paddr, dram_io_desc[0].virtual); 117 (long long) paddr, dram_io_desc[0].virtual);
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index faa65833a0d4..716247ed9e0c 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2185,7 +2185,7 @@ static int _enable(struct omap_hwmod *oh)
2185 oh->mux->pads_dynamic))) { 2185 oh->mux->pads_dynamic))) {
2186 omap_hwmod_mux(oh->mux, _HWMOD_STATE_ENABLED); 2186 omap_hwmod_mux(oh->mux, _HWMOD_STATE_ENABLED);
2187 _reconfigure_io_chain(); 2187 _reconfigure_io_chain();
2188 } else if (oh->flags & HWMOD_FORCE_MSTANDBY) { 2188 } else if (oh->flags & HWMOD_RECONFIG_IO_CHAIN) {
2189 _reconfigure_io_chain(); 2189 _reconfigure_io_chain();
2190 } 2190 }
2191 2191
@@ -2293,7 +2293,7 @@ static int _idle(struct omap_hwmod *oh)
2293 if (oh->mux && oh->mux->pads_dynamic) { 2293 if (oh->mux && oh->mux->pads_dynamic) {
2294 omap_hwmod_mux(oh->mux, _HWMOD_STATE_IDLE); 2294 omap_hwmod_mux(oh->mux, _HWMOD_STATE_IDLE);
2295 _reconfigure_io_chain(); 2295 _reconfigure_io_chain();
2296 } else if (oh->flags & HWMOD_FORCE_MSTANDBY) { 2296 } else if (oh->flags & HWMOD_RECONFIG_IO_CHAIN) {
2297 _reconfigure_io_chain(); 2297 _reconfigure_io_chain();
2298 } 2298 }
2299 2299
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 0f97d635ff90..512f809a3f4d 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -514,6 +514,9 @@ struct omap_hwmod_omap4_prcm {
514 * HWMOD_SWSUP_SIDLE_ACT: omap_hwmod code should manually bring the module 514 * HWMOD_SWSUP_SIDLE_ACT: omap_hwmod code should manually bring the module
515 * out of idle, but rely on smart-idle to the put it back in idle, 515 * out of idle, but rely on smart-idle to the put it back in idle,
516 * so the wakeups are still functional (Only known case for now is UART) 516 * so the wakeups are still functional (Only known case for now is UART)
517 * HWMOD_RECONFIG_IO_CHAIN: omap_hwmod code needs to reconfigure wake-up
518 * events by calling _reconfigure_io_chain() when a device is enabled
519 * or idled.
517 */ 520 */
518#define HWMOD_SWSUP_SIDLE (1 << 0) 521#define HWMOD_SWSUP_SIDLE (1 << 0)
519#define HWMOD_SWSUP_MSTANDBY (1 << 1) 522#define HWMOD_SWSUP_MSTANDBY (1 << 1)
@@ -528,6 +531,7 @@ struct omap_hwmod_omap4_prcm {
528#define HWMOD_BLOCK_WFI (1 << 10) 531#define HWMOD_BLOCK_WFI (1 << 10)
529#define HWMOD_FORCE_MSTANDBY (1 << 11) 532#define HWMOD_FORCE_MSTANDBY (1 << 11)
530#define HWMOD_SWSUP_SIDLE_ACT (1 << 12) 533#define HWMOD_SWSUP_SIDLE_ACT (1 << 12)
534#define HWMOD_RECONFIG_IO_CHAIN (1 << 13)
531 535
532/* 536/*
533 * omap_hwmod._int_flags definitions 537 * omap_hwmod._int_flags definitions
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index e9516b454e76..2a78b093c0ce 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -490,7 +490,7 @@ static struct omap_hwmod omap3xxx_uart1_hwmod = {
490 .mpu_irqs = omap2_uart1_mpu_irqs, 490 .mpu_irqs = omap2_uart1_mpu_irqs,
491 .sdma_reqs = omap2_uart1_sdma_reqs, 491 .sdma_reqs = omap2_uart1_sdma_reqs,
492 .main_clk = "uart1_fck", 492 .main_clk = "uart1_fck",
493 .flags = DEBUG_TI81XXUART1_FLAGS | HWMOD_SWSUP_SIDLE_ACT, 493 .flags = DEBUG_TI81XXUART1_FLAGS | HWMOD_SWSUP_SIDLE,
494 .prcm = { 494 .prcm = {
495 .omap2 = { 495 .omap2 = {
496 .module_offs = CORE_MOD, 496 .module_offs = CORE_MOD,
@@ -509,7 +509,7 @@ static struct omap_hwmod omap3xxx_uart2_hwmod = {
509 .mpu_irqs = omap2_uart2_mpu_irqs, 509 .mpu_irqs = omap2_uart2_mpu_irqs,
510 .sdma_reqs = omap2_uart2_sdma_reqs, 510 .sdma_reqs = omap2_uart2_sdma_reqs,
511 .main_clk = "uart2_fck", 511 .main_clk = "uart2_fck",
512 .flags = DEBUG_TI81XXUART2_FLAGS | HWMOD_SWSUP_SIDLE_ACT, 512 .flags = DEBUG_TI81XXUART2_FLAGS | HWMOD_SWSUP_SIDLE,
513 .prcm = { 513 .prcm = {
514 .omap2 = { 514 .omap2 = {
515 .module_offs = CORE_MOD, 515 .module_offs = CORE_MOD,
@@ -529,7 +529,7 @@ static struct omap_hwmod omap3xxx_uart3_hwmod = {
529 .sdma_reqs = omap2_uart3_sdma_reqs, 529 .sdma_reqs = omap2_uart3_sdma_reqs,
530 .main_clk = "uart3_fck", 530 .main_clk = "uart3_fck",
531 .flags = DEBUG_OMAP3UART3_FLAGS | DEBUG_TI81XXUART3_FLAGS | 531 .flags = DEBUG_OMAP3UART3_FLAGS | DEBUG_TI81XXUART3_FLAGS |
532 HWMOD_SWSUP_SIDLE_ACT, 532 HWMOD_SWSUP_SIDLE,
533 .prcm = { 533 .prcm = {
534 .omap2 = { 534 .omap2 = {
535 .module_offs = OMAP3430_PER_MOD, 535 .module_offs = OMAP3430_PER_MOD,
@@ -559,7 +559,7 @@ static struct omap_hwmod omap36xx_uart4_hwmod = {
559 .mpu_irqs = uart4_mpu_irqs, 559 .mpu_irqs = uart4_mpu_irqs,
560 .sdma_reqs = uart4_sdma_reqs, 560 .sdma_reqs = uart4_sdma_reqs,
561 .main_clk = "uart4_fck", 561 .main_clk = "uart4_fck",
562 .flags = DEBUG_OMAP3UART4_FLAGS | HWMOD_SWSUP_SIDLE_ACT, 562 .flags = DEBUG_OMAP3UART4_FLAGS | HWMOD_SWSUP_SIDLE,
563 .prcm = { 563 .prcm = {
564 .omap2 = { 564 .omap2 = {
565 .module_offs = OMAP3430_PER_MOD, 565 .module_offs = OMAP3430_PER_MOD,
@@ -1730,8 +1730,8 @@ static struct omap_hwmod omap3xxx_usbhsotg_hwmod = {
1730 * Note that musb has OTG_FORCESTDBY register that controls MSTANDBY 1730 * Note that musb has OTG_FORCESTDBY register that controls MSTANDBY
1731 * signal when MIDLEMODE is set to force-idle. 1731 * signal when MIDLEMODE is set to force-idle.
1732 */ 1732 */
1733 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE 1733 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE |
1734 | HWMOD_FORCE_MSTANDBY, 1734 HWMOD_FORCE_MSTANDBY | HWMOD_RECONFIG_IO_CHAIN,
1735}; 1735};
1736 1736
1737/* usb_otg_hs */ 1737/* usb_otg_hs */
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index b3d3d30ffba0..0a5e6e053b8c 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -352,6 +352,16 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
352 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata), 352 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata),
353 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata), 353 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata),
354#endif 354#endif
355#ifdef CONFIG_SOC_OMAP5
356 OF_DEV_AUXDATA("ti,omap5-padconf", 0x4a002840, "4a002840.pinmux", &pcs_pdata),
357 OF_DEV_AUXDATA("ti,omap5-padconf", 0x4ae0c840, "4ae0c840.pinmux", &pcs_pdata),
358#endif
359#ifdef CONFIG_SOC_DRA7XX
360 OF_DEV_AUXDATA("ti,dra7-padconf", 0x4a003400, "4a003400.pinmux", &pcs_pdata),
361#endif
362#ifdef CONFIG_SOC_AM43XX
363 OF_DEV_AUXDATA("ti,am437-padconf", 0x44e10800, "44e10800.pinmux", &pcs_pdata),
364#endif
355#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) 365#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
356 OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu", 366 OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
357 &omap4_iommu_pdata), 367 &omap4_iommu_pdata),
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index e150102d6c06..425bfcd67db6 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -101,6 +101,7 @@ static inline void enable_omap3630_toggle_l2_on_restore(void) { }
101#endif /* defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) */ 101#endif /* defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) */
102 102
103#define PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD (1 << 0) 103#define PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD (1 << 0)
104#define PM_OMAP4_CPU_OSWR_DISABLE (1 << 1)
104 105
105#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP4) 106#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP4)
106extern u16 pm44xx_errata; 107extern u16 pm44xx_errata;
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index 0bfce38a744a..503097c72b82 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -37,6 +37,8 @@ struct power_state {
37 struct list_head node; 37 struct list_head node;
38}; 38};
39 39
40static u32 cpu_suspend_state = PWRDM_POWER_OFF;
41
40static LIST_HEAD(pwrst_list); 42static LIST_HEAD(pwrst_list);
41 43
42#ifdef CONFIG_SUSPEND 44#ifdef CONFIG_SUSPEND
@@ -67,7 +69,7 @@ static int omap4_pm_suspend(void)
67 * domain CSWR is not supported by hardware. 69 * domain CSWR is not supported by hardware.
68 * More details can be found in OMAP4430 TRM section 4.3.4.2. 70 * More details can be found in OMAP4430 TRM section 4.3.4.2.
69 */ 71 */
70 omap4_enter_lowpower(cpu_id, PWRDM_POWER_OFF); 72 omap4_enter_lowpower(cpu_id, cpu_suspend_state);
71 73
72 /* Restore next powerdomain state */ 74 /* Restore next powerdomain state */
73 list_for_each_entry(pwrst, &pwrst_list, node) { 75 list_for_each_entry(pwrst, &pwrst_list, node) {
@@ -113,8 +115,11 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
113 * through hotplug path and CPU0 explicitly programmed 115 * through hotplug path and CPU0 explicitly programmed
114 * further down in the code path 116 * further down in the code path
115 */ 117 */
116 if (!strncmp(pwrdm->name, "cpu", 3)) 118 if (!strncmp(pwrdm->name, "cpu", 3)) {
119 if (IS_PM44XX_ERRATUM(PM_OMAP4_CPU_OSWR_DISABLE))
120 cpu_suspend_state = PWRDM_POWER_RET;
117 return 0; 121 return 0;
122 }
118 123
119 pwrst = kmalloc(sizeof(struct power_state), GFP_ATOMIC); 124 pwrst = kmalloc(sizeof(struct power_state), GFP_ATOMIC);
120 if (!pwrst) 125 if (!pwrst)
@@ -208,6 +213,32 @@ static inline int omap4_init_static_deps(void)
208} 213}
209 214
210/** 215/**
216 * omap5_dra7_init_static_deps - Init static clkdm dependencies on OMAP5 and
217 * DRA7
218 *
219 * The dynamic dependency between MPUSS -> EMIF is broken and has
220 * not worked as expected. The hardware recommendation is to
221 * enable static dependencies for these to avoid system
222 * lock ups or random crashes.
223 */
224static inline int omap5_dra7_init_static_deps(void)
225{
226 struct clockdomain *mpuss_clkdm, *emif_clkdm;
227 int ret;
228
229 mpuss_clkdm = clkdm_lookup("mpu_clkdm");
230 emif_clkdm = clkdm_lookup("emif_clkdm");
231 if (!mpuss_clkdm || !emif_clkdm)
232 return -EINVAL;
233
234 ret = clkdm_add_wkdep(mpuss_clkdm, emif_clkdm);
235 if (ret)
236 pr_err("Failed to add MPUSS -> EMIF wakeup dependency\n");
237
238 return ret;
239}
240
241/**
211 * omap4_pm_init_early - Does early initialization necessary for OMAP4+ devices 242 * omap4_pm_init_early - Does early initialization necessary for OMAP4+ devices
212 * 243 *
213 * Initializes basic stuff for power management functionality. 244 * Initializes basic stuff for power management functionality.
@@ -217,6 +248,9 @@ int __init omap4_pm_init_early(void)
217 if (cpu_is_omap446x()) 248 if (cpu_is_omap446x())
218 pm44xx_errata |= PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD; 249 pm44xx_errata |= PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD;
219 250
251 if (soc_is_omap54xx() || soc_is_dra7xx())
252 pm44xx_errata |= PM_OMAP4_CPU_OSWR_DISABLE;
253
220 return 0; 254 return 0;
221} 255}
222 256
@@ -244,10 +278,14 @@ int __init omap4_pm_init(void)
244 goto err2; 278 goto err2;
245 } 279 }
246 280
247 if (cpu_is_omap44xx()) { 281 if (cpu_is_omap44xx())
248 ret = omap4_init_static_deps(); 282 ret = omap4_init_static_deps();
249 if (ret) 283 else if (soc_is_omap54xx() || soc_is_dra7xx())
250 goto err2; 284 ret = omap5_dra7_init_static_deps();
285
286 if (ret) {
287 pr_err("Failed to initialise static dependencies.\n");
288 goto err2;
251 } 289 }
252 290
253 ret = omap4_mpuss_init(); 291 ret = omap4_mpuss_init();
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
index 372de3edf4a5..ff08da385a2d 100644
--- a/arch/arm/mach-omap2/prm3xxx.c
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -17,6 +17,7 @@
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/irq.h> 19#include <linux/irq.h>
20#include <linux/of_irq.h>
20 21
21#include "soc.h" 22#include "soc.h"
22#include "common.h" 23#include "common.h"
@@ -673,6 +674,11 @@ int __init omap3xxx_prm_init(void)
673 return prm_register(&omap3xxx_prm_ll_data); 674 return prm_register(&omap3xxx_prm_ll_data);
674} 675}
675 676
677static struct of_device_id omap3_prm_dt_match_table[] = {
678 { .compatible = "ti,omap3-prm" },
679 { }
680};
681
676static int omap3xxx_prm_late_init(void) 682static int omap3xxx_prm_late_init(void)
677{ 683{
678 int ret; 684 int ret;
@@ -687,6 +693,18 @@ static int omap3xxx_prm_late_init(void)
687 omap3_prcm_irq_setup.reconfigure_io_chain = 693 omap3_prcm_irq_setup.reconfigure_io_chain =
688 omap3430_pre_es3_1_reconfigure_io_chain; 694 omap3430_pre_es3_1_reconfigure_io_chain;
689 695
696 if (of_have_populated_dt()) {
697 struct device_node *np;
698 int irq_num;
699
700 np = of_find_matching_node(NULL, omap3_prm_dt_match_table);
701 if (np) {
702 irq_num = of_irq_get(np, 0);
703 if (irq_num >= 0)
704 omap3_prcm_irq_setup.irq = irq_num;
705 }
706 }
707
690 omap3xxx_prm_enable_io_wakeup(); 708 omap3xxx_prm_enable_io_wakeup();
691 ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup); 709 ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup);
692 if (!ret) 710 if (!ret)
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index a7f6ea27180a..0958d070d3db 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -17,6 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/of_irq.h>
20 21
21 22
22#include "soc.h" 23#include "soc.h"
@@ -32,7 +33,6 @@
32/* Static data */ 33/* Static data */
33 34
34static const struct omap_prcm_irq omap4_prcm_irqs[] = { 35static const struct omap_prcm_irq omap4_prcm_irqs[] = {
35 OMAP_PRCM_IRQ("wkup", 0, 0),
36 OMAP_PRCM_IRQ("io", 9, 1), 36 OMAP_PRCM_IRQ("io", 9, 1),
37}; 37};
38 38
@@ -154,21 +154,36 @@ void omap4_prm_vp_clear_txdone(u8 vp_id)
154 154
155u32 omap4_prm_vcvp_read(u8 offset) 155u32 omap4_prm_vcvp_read(u8 offset)
156{ 156{
157 s32 inst = omap4_prmst_get_prm_dev_inst();
158
159 if (inst == PRM_INSTANCE_UNKNOWN)
160 return 0;
161
157 return omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, 162 return omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
158 OMAP4430_PRM_DEVICE_INST, offset); 163 inst, offset);
159} 164}
160 165
161void omap4_prm_vcvp_write(u32 val, u8 offset) 166void omap4_prm_vcvp_write(u32 val, u8 offset)
162{ 167{
168 s32 inst = omap4_prmst_get_prm_dev_inst();
169
170 if (inst == PRM_INSTANCE_UNKNOWN)
171 return;
172
163 omap4_prminst_write_inst_reg(val, OMAP4430_PRM_PARTITION, 173 omap4_prminst_write_inst_reg(val, OMAP4430_PRM_PARTITION,
164 OMAP4430_PRM_DEVICE_INST, offset); 174 inst, offset);
165} 175}
166 176
167u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset) 177u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset)
168{ 178{
179 s32 inst = omap4_prmst_get_prm_dev_inst();
180
181 if (inst == PRM_INSTANCE_UNKNOWN)
182 return 0;
183
169 return omap4_prminst_rmw_inst_reg_bits(mask, bits, 184 return omap4_prminst_rmw_inst_reg_bits(mask, bits,
170 OMAP4430_PRM_PARTITION, 185 OMAP4430_PRM_PARTITION,
171 OMAP4430_PRM_DEVICE_INST, 186 inst,
172 offset); 187 offset);
173} 188}
174 189
@@ -275,14 +290,18 @@ void omap44xx_prm_restore_irqen(u32 *saved_mask)
275void omap44xx_prm_reconfigure_io_chain(void) 290void omap44xx_prm_reconfigure_io_chain(void)
276{ 291{
277 int i = 0; 292 int i = 0;
293 s32 inst = omap4_prmst_get_prm_dev_inst();
294
295 if (inst == PRM_INSTANCE_UNKNOWN)
296 return;
278 297
279 /* Trigger WUCLKIN enable */ 298 /* Trigger WUCLKIN enable */
280 omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 299 omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK,
281 OMAP4430_WUCLK_CTRL_MASK, 300 OMAP4430_WUCLK_CTRL_MASK,
282 OMAP4430_PRM_DEVICE_INST, 301 inst,
283 OMAP4_PRM_IO_PMCTRL_OFFSET); 302 OMAP4_PRM_IO_PMCTRL_OFFSET);
284 omap_test_timeout( 303 omap_test_timeout(
285 (((omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, 304 (((omap4_prm_read_inst_reg(inst,
286 OMAP4_PRM_IO_PMCTRL_OFFSET) & 305 OMAP4_PRM_IO_PMCTRL_OFFSET) &
287 OMAP4430_WUCLK_STATUS_MASK) >> 306 OMAP4430_WUCLK_STATUS_MASK) >>
288 OMAP4430_WUCLK_STATUS_SHIFT) == 1), 307 OMAP4430_WUCLK_STATUS_SHIFT) == 1),
@@ -292,10 +311,10 @@ void omap44xx_prm_reconfigure_io_chain(void)
292 311
293 /* Trigger WUCLKIN disable */ 312 /* Trigger WUCLKIN disable */
294 omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 0x0, 313 omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 0x0,
295 OMAP4430_PRM_DEVICE_INST, 314 inst,
296 OMAP4_PRM_IO_PMCTRL_OFFSET); 315 OMAP4_PRM_IO_PMCTRL_OFFSET);
297 omap_test_timeout( 316 omap_test_timeout(
298 (((omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, 317 (((omap4_prm_read_inst_reg(inst,
299 OMAP4_PRM_IO_PMCTRL_OFFSET) & 318 OMAP4_PRM_IO_PMCTRL_OFFSET) &
300 OMAP4430_WUCLK_STATUS_MASK) >> 319 OMAP4430_WUCLK_STATUS_MASK) >>
301 OMAP4430_WUCLK_STATUS_SHIFT) == 0), 320 OMAP4430_WUCLK_STATUS_SHIFT) == 0),
@@ -316,9 +335,14 @@ void omap44xx_prm_reconfigure_io_chain(void)
316 */ 335 */
317static void __init omap44xx_prm_enable_io_wakeup(void) 336static void __init omap44xx_prm_enable_io_wakeup(void)
318{ 337{
338 s32 inst = omap4_prmst_get_prm_dev_inst();
339
340 if (inst == PRM_INSTANCE_UNKNOWN)
341 return;
342
319 omap4_prm_rmw_inst_reg_bits(OMAP4430_GLOBAL_WUEN_MASK, 343 omap4_prm_rmw_inst_reg_bits(OMAP4430_GLOBAL_WUEN_MASK,
320 OMAP4430_GLOBAL_WUEN_MASK, 344 OMAP4430_GLOBAL_WUEN_MASK,
321 OMAP4430_PRM_DEVICE_INST, 345 inst,
322 OMAP4_PRM_IO_PMCTRL_OFFSET); 346 OMAP4_PRM_IO_PMCTRL_OFFSET);
323} 347}
324 348
@@ -333,8 +357,13 @@ static u32 omap44xx_prm_read_reset_sources(void)
333 struct prm_reset_src_map *p; 357 struct prm_reset_src_map *p;
334 u32 r = 0; 358 u32 r = 0;
335 u32 v; 359 u32 v;
360 s32 inst = omap4_prmst_get_prm_dev_inst();
336 361
337 v = omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, 362 if (inst == PRM_INSTANCE_UNKNOWN)
363 return 0;
364
365
366 v = omap4_prm_read_inst_reg(inst,
338 OMAP4_RM_RSTST); 367 OMAP4_RM_RSTST);
339 368
340 p = omap44xx_prm_reset_src_map; 369 p = omap44xx_prm_reset_src_map;
@@ -664,17 +693,56 @@ static struct prm_ll_data omap44xx_prm_ll_data = {
664 693
665int __init omap44xx_prm_init(void) 694int __init omap44xx_prm_init(void)
666{ 695{
667 if (cpu_is_omap44xx()) 696 if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx())
668 prm_features |= PRM_HAS_IO_WAKEUP; 697 prm_features |= PRM_HAS_IO_WAKEUP;
669 698
670 return prm_register(&omap44xx_prm_ll_data); 699 return prm_register(&omap44xx_prm_ll_data);
671} 700}
672 701
702static struct of_device_id omap_prm_dt_match_table[] = {
703 { .compatible = "ti,omap4-prm" },
704 { .compatible = "ti,omap5-prm" },
705 { .compatible = "ti,dra7-prm" },
706 { }
707};
708
673static int omap44xx_prm_late_init(void) 709static int omap44xx_prm_late_init(void)
674{ 710{
711 struct device_node *np;
712 int irq_num;
713
675 if (!(prm_features & PRM_HAS_IO_WAKEUP)) 714 if (!(prm_features & PRM_HAS_IO_WAKEUP))
676 return 0; 715 return 0;
677 716
717 /* OMAP4+ is DT only now */
718 if (!of_have_populated_dt())
719 return 0;
720
721 np = of_find_matching_node(NULL, omap_prm_dt_match_table);
722
723 if (!np) {
724 /* Default loaded up with OMAP4 values */
725 if (!cpu_is_omap44xx())
726 return 0;
727 } else {
728 irq_num = of_irq_get(np, 0);
729 /*
730 * Already have OMAP4 IRQ num. For all other platforms, we need
731 * IRQ numbers from DT
732 */
733 if (irq_num < 0 && !cpu_is_omap44xx()) {
734 if (irq_num == -EPROBE_DEFER)
735 return irq_num;
736
737 /* Have nothing to do */
738 return 0;
739 }
740
741 /* Once OMAP4 DT is filled as well */
742 if (irq_num >= 0)
743 omap4_prcm_irq_setup.irq = irq_num;
744 }
745
678 omap44xx_prm_enable_io_wakeup(); 746 omap44xx_prm_enable_io_wakeup();
679 747
680 return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); 748 return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup);
diff --git a/arch/arm/mach-omap2/prminst44xx.c b/arch/arm/mach-omap2/prminst44xx.c
index 69f0dd08629c..225e0258d76d 100644
--- a/arch/arm/mach-omap2/prminst44xx.c
+++ b/arch/arm/mach-omap2/prminst44xx.c
@@ -31,6 +31,8 @@
31 31
32static void __iomem *_prm_bases[OMAP4_MAX_PRCM_PARTITIONS]; 32static void __iomem *_prm_bases[OMAP4_MAX_PRCM_PARTITIONS];
33 33
34static s32 prm_dev_inst = PRM_INSTANCE_UNKNOWN;
35
34/** 36/**
35 * omap_prm_base_init - Populates the prm partitions 37 * omap_prm_base_init - Populates the prm partitions
36 * 38 *
@@ -43,6 +45,24 @@ void omap_prm_base_init(void)
43 _prm_bases[OMAP4430_PRCM_MPU_PARTITION] = prcm_mpu_base; 45 _prm_bases[OMAP4430_PRCM_MPU_PARTITION] = prcm_mpu_base;
44} 46}
45 47
48s32 omap4_prmst_get_prm_dev_inst(void)
49{
50 if (prm_dev_inst != PRM_INSTANCE_UNKNOWN)
51 return prm_dev_inst;
52
53 /* This cannot be done way early at boot.. as things are not setup */
54 if (cpu_is_omap44xx())
55 prm_dev_inst = OMAP4430_PRM_DEVICE_INST;
56 else if (soc_is_omap54xx())
57 prm_dev_inst = OMAP54XX_PRM_DEVICE_INST;
58 else if (soc_is_dra7xx())
59 prm_dev_inst = DRA7XX_PRM_DEVICE_INST;
60 else if (soc_is_am43xx())
61 prm_dev_inst = AM43XX_PRM_DEVICE_INST;
62
63 return prm_dev_inst;
64}
65
46/* Read a register in a PRM instance */ 66/* Read a register in a PRM instance */
47u32 omap4_prminst_read_inst_reg(u8 part, s16 inst, u16 idx) 67u32 omap4_prminst_read_inst_reg(u8 part, s16 inst, u16 idx)
48{ 68{
@@ -169,28 +189,18 @@ int omap4_prminst_deassert_hardreset(u8 shift, u8 part, s16 inst,
169void omap4_prminst_global_warm_sw_reset(void) 189void omap4_prminst_global_warm_sw_reset(void)
170{ 190{
171 u32 v; 191 u32 v;
172 s16 dev_inst; 192 s32 inst = omap4_prmst_get_prm_dev_inst();
173 193
174 if (cpu_is_omap44xx()) 194 if (inst == PRM_INSTANCE_UNKNOWN)
175 dev_inst = OMAP4430_PRM_DEVICE_INST;
176 else if (soc_is_omap54xx())
177 dev_inst = OMAP54XX_PRM_DEVICE_INST;
178 else if (soc_is_dra7xx())
179 dev_inst = DRA7XX_PRM_DEVICE_INST;
180 else if (soc_is_am43xx())
181 dev_inst = AM43XX_PRM_DEVICE_INST;
182 else
183 return; 195 return;
184 196
185 v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, dev_inst, 197 v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, inst,
186 OMAP4_PRM_RSTCTRL_OFFSET); 198 OMAP4_PRM_RSTCTRL_OFFSET);
187 v |= OMAP4430_RST_GLOBAL_WARM_SW_MASK; 199 v |= OMAP4430_RST_GLOBAL_WARM_SW_MASK;
188 omap4_prminst_write_inst_reg(v, OMAP4430_PRM_PARTITION, 200 omap4_prminst_write_inst_reg(v, OMAP4430_PRM_PARTITION,
189 dev_inst, 201 inst, OMAP4_PRM_RSTCTRL_OFFSET);
190 OMAP4_PRM_RSTCTRL_OFFSET);
191 202
192 /* OCP barrier */ 203 /* OCP barrier */
193 v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, 204 v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
194 dev_inst, 205 inst, OMAP4_PRM_RSTCTRL_OFFSET);
195 OMAP4_PRM_RSTCTRL_OFFSET);
196} 206}
diff --git a/arch/arm/mach-omap2/prminst44xx.h b/arch/arm/mach-omap2/prminst44xx.h
index a2ede2d65481..583aa3774571 100644
--- a/arch/arm/mach-omap2/prminst44xx.h
+++ b/arch/arm/mach-omap2/prminst44xx.h
@@ -12,6 +12,9 @@
12#ifndef __ARCH_ASM_MACH_OMAP2_PRMINST44XX_H 12#ifndef __ARCH_ASM_MACH_OMAP2_PRMINST44XX_H
13#define __ARCH_ASM_MACH_OMAP2_PRMINST44XX_H 13#define __ARCH_ASM_MACH_OMAP2_PRMINST44XX_H
14 14
15#define PRM_INSTANCE_UNKNOWN -1
16extern s32 omap4_prmst_get_prm_dev_inst(void);
17
15/* 18/*
16 * In an ideal world, we would not export these low-level functions, 19 * In an ideal world, we would not export these low-level functions,
17 * but this will probably take some time to fix properly 20 * but this will probably take some time to fix properly
diff --git a/arch/arm/mach-omap2/sram.c b/arch/arm/mach-omap2/sram.c
index ddf1818af228..cd488b80ba36 100644
--- a/arch/arm/mach-omap2/sram.c
+++ b/arch/arm/mach-omap2/sram.c
@@ -32,12 +32,6 @@
32 32
33#define OMAP2_SRAM_PUB_PA (OMAP2_SRAM_PA + 0xf800) 33#define OMAP2_SRAM_PUB_PA (OMAP2_SRAM_PA + 0xf800)
34#define OMAP3_SRAM_PUB_PA (OMAP3_SRAM_PA + 0x8000) 34#define OMAP3_SRAM_PUB_PA (OMAP3_SRAM_PA + 0x8000)
35#ifdef CONFIG_OMAP4_ERRATA_I688
36#define OMAP4_SRAM_PUB_PA OMAP4_SRAM_PA
37#else
38#define OMAP4_SRAM_PUB_PA (OMAP4_SRAM_PA + 0x4000)
39#endif
40#define OMAP5_SRAM_PA 0x40300000
41 35
42#define SRAM_BOOTLOADER_SZ 0x00 36#define SRAM_BOOTLOADER_SZ 0x00
43 37
@@ -105,32 +99,14 @@ static void __init omap_detect_sram(void)
105 } else { 99 } else {
106 omap_sram_size = 0x8000; /* 32K */ 100 omap_sram_size = 0x8000; /* 32K */
107 } 101 }
108 } else if (cpu_is_omap44xx()) {
109 omap_sram_start = OMAP4_SRAM_PUB_PA;
110 omap_sram_size = 0xa000; /* 40K */
111 } else if (soc_is_omap54xx()) {
112 omap_sram_start = OMAP5_SRAM_PA;
113 omap_sram_size = SZ_128K; /* 128KB */
114 } else { 102 } else {
115 omap_sram_start = OMAP2_SRAM_PUB_PA; 103 omap_sram_start = OMAP2_SRAM_PUB_PA;
116 omap_sram_size = 0x800; /* 2K */ 104 omap_sram_size = 0x800; /* 2K */
117 } 105 }
118 } else { 106 } else {
119 if (soc_is_am33xx()) { 107 if (cpu_is_omap34xx()) {
120 omap_sram_start = AM33XX_SRAM_PA;
121 omap_sram_size = 0x10000; /* 64K */
122 } else if (soc_is_am43xx()) {
123 omap_sram_start = AM33XX_SRAM_PA;
124 omap_sram_size = SZ_256K;
125 } else if (cpu_is_omap34xx()) {
126 omap_sram_start = OMAP3_SRAM_PA; 108 omap_sram_start = OMAP3_SRAM_PA;
127 omap_sram_size = 0x10000; /* 64K */ 109 omap_sram_size = 0x10000; /* 64K */
128 } else if (cpu_is_omap44xx()) {
129 omap_sram_start = OMAP4_SRAM_PA;
130 omap_sram_size = 0xe000; /* 56K */
131 } else if (soc_is_omap54xx()) {
132 omap_sram_start = OMAP5_SRAM_PA;
133 omap_sram_size = SZ_128K; /* 128KB */
134 } else { 110 } else {
135 omap_sram_start = OMAP2_SRAM_PA; 111 omap_sram_start = OMAP2_SRAM_PA;
136 if (cpu_is_omap242x()) 112 if (cpu_is_omap242x())
@@ -148,12 +124,6 @@ static void __init omap2_map_sram(void)
148{ 124{
149 int cached = 1; 125 int cached = 1;
150 126
151#ifdef CONFIG_OMAP4_ERRATA_I688
152 if (cpu_is_omap44xx()) {
153 omap_sram_start += PAGE_SIZE;
154 omap_sram_size -= SZ_16K;
155 }
156#endif
157 if (cpu_is_omap34xx()) { 127 if (cpu_is_omap34xx()) {
158 /* 128 /*
159 * SRAM must be marked as non-cached on OMAP3 since the 129 * SRAM must be marked as non-cached on OMAP3 since the
@@ -285,11 +255,6 @@ static inline int omap34xx_sram_init(void)
285} 255}
286#endif /* CONFIG_ARCH_OMAP3 */ 256#endif /* CONFIG_ARCH_OMAP3 */
287 257
288static inline int am33xx_sram_init(void)
289{
290 return 0;
291}
292
293int __init omap_sram_init(void) 258int __init omap_sram_init(void)
294{ 259{
295 omap_detect_sram(); 260 omap_detect_sram();
@@ -299,8 +264,6 @@ int __init omap_sram_init(void)
299 omap242x_sram_init(); 264 omap242x_sram_init();
300 else if (cpu_is_omap2430()) 265 else if (cpu_is_omap2430())
301 omap243x_sram_init(); 266 omap243x_sram_init();
302 else if (soc_is_am33xx())
303 am33xx_sram_init();
304 else if (cpu_is_omap34xx()) 267 else if (cpu_is_omap34xx())
305 omap34xx_sram_init(); 268 omap34xx_sram_init();
306 269
diff --git a/arch/arm/mach-omap2/sram.h b/arch/arm/mach-omap2/sram.h
index ca7277c2a9ee..948d3edefc38 100644
--- a/arch/arm/mach-omap2/sram.h
+++ b/arch/arm/mach-omap2/sram.h
@@ -74,10 +74,3 @@ static inline void omap_push_sram_idle(void) {}
74 */ 74 */
75#define OMAP2_SRAM_PA 0x40200000 75#define OMAP2_SRAM_PA 0x40200000
76#define OMAP3_SRAM_PA 0x40200000 76#define OMAP3_SRAM_PA 0x40200000
77#ifdef CONFIG_OMAP4_ERRATA_I688
78#define OMAP4_SRAM_PA 0x40304000
79#define OMAP4_SRAM_VA 0xfe404000
80#else
81#define OMAP4_SRAM_PA 0x40300000
82#endif
83#define AM33XX_SRAM_PA 0x40300000