aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/control.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-25 16:46:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-25 16:46:56 -0400
commit7b6181e06841f5ad15c4ff708b967b4db65a64de (patch)
treebdfcf5b74b692f76581156e452d268b64c795200 /arch/arm/mach-omap2/control.c
parent72e58063d63c5f0a7bf65312f1e3a5ed9bb5c2ff (diff)
parentbc487fb341af05120bccb9f59ce76302391dcc77 (diff)
Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
* 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (163 commits) omap: complete removal of machine_desc.io_pg_offst and .phys_io omap: UART: fix wakeup registers for OMAP24xx UART2 omap: Fix spotty MMC voltages ASoC: OMAP4: MCPDM: Remove unnecessary include of plat/control.h serial: omap-serial: fix signess error OMAP3: DMA: Errata i541: sDMA FIFO draining does not finish omap: dma: Fix buffering disable bit setting for omap24xx omap: serial: Fix the boot-up crash/reboot without CONFIG_PM OMAP3: PM: fix scratchpad memory accesses for off-mode omap4: pandaboard: enable the ehci port on pandaboard omap4: pandaboard: Fix the init if CONFIG_MMC_OMAP_HS is not set omap4: pandaboard: remove unused hsmmc definition OMAP: McBSP: Remove null omap44xx ops comment OMAP: McBSP: Swap CLKS source definition OMAP: McBSP: Fix CLKR and FSR signal muxing OMAP2+: clock: reduce the amount of standard debugging while disabling unused clocks OMAP: control: move plat-omap/control.h to mach-omap2/control.h OMAP: split plat-omap/common.c OMAP: McBSP: implement functional clock switching via clock framework OMAP: McBSP: implement McBSP CLKR and FSR signal muxing via mach-omap2/mcbsp.c ... Fixed up trivial conflicts in arch/arm/mach-omap2/ {board-zoom-peripherals.c,devices.c} as per Tony
Diffstat (limited to 'arch/arm/mach-omap2/control.c')
-rw-r--r--arch/arm/mach-omap2/control.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index a8d20eef2306..1fa3294b6048 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -16,15 +16,18 @@
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18#include <plat/common.h> 18#include <plat/common.h>
19#include <plat/control.h>
20#include <plat/sdrc.h> 19#include <plat/sdrc.h>
20
21#include "cm-regbits-34xx.h" 21#include "cm-regbits-34xx.h"
22#include "prm-regbits-34xx.h" 22#include "prm-regbits-34xx.h"
23#include "cm.h" 23#include "cm.h"
24#include "prm.h" 24#include "prm.h"
25#include "sdrc.h" 25#include "sdrc.h"
26#include "pm.h"
27#include "control.h"
26 28
27static void __iomem *omap2_ctrl_base; 29static void __iomem *omap2_ctrl_base;
30static void __iomem *omap4_ctrl_pad_base;
28 31
29#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) 32#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
30struct omap3_scratchpad { 33struct omap3_scratchpad {
@@ -137,6 +140,7 @@ static struct omap3_control_regs control_context;
137#endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ 140#endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */
138 141
139#define OMAP_CTRL_REGADDR(reg) (omap2_ctrl_base + (reg)) 142#define OMAP_CTRL_REGADDR(reg) (omap2_ctrl_base + (reg))
143#define OMAP4_CTRL_PAD_REGADDR(reg) (omap4_ctrl_pad_base + (reg))
140 144
141void __init omap2_set_globals_control(struct omap_globals *omap2_globals) 145void __init omap2_set_globals_control(struct omap_globals *omap2_globals)
142{ 146{
@@ -145,6 +149,12 @@ void __init omap2_set_globals_control(struct omap_globals *omap2_globals)
145 omap2_ctrl_base = ioremap(omap2_globals->ctrl, SZ_4K); 149 omap2_ctrl_base = ioremap(omap2_globals->ctrl, SZ_4K);
146 WARN_ON(!omap2_ctrl_base); 150 WARN_ON(!omap2_ctrl_base);
147 } 151 }
152
153 /* Static mapping, never released */
154 if (omap2_globals->ctrl_pad) {
155 omap4_ctrl_pad_base = ioremap(omap2_globals->ctrl_pad, SZ_4K);
156 WARN_ON(!omap4_ctrl_pad_base);
157 }
148} 158}
149 159
150void __iomem *omap_ctrl_base_get(void) 160void __iomem *omap_ctrl_base_get(void)
@@ -182,6 +192,23 @@ void omap_ctrl_writel(u32 val, u16 offset)
182 __raw_writel(val, OMAP_CTRL_REGADDR(offset)); 192 __raw_writel(val, OMAP_CTRL_REGADDR(offset));
183} 193}
184 194
195/*
196 * On OMAP4 control pad are not addressable from control
197 * core base. So the common omap_ctrl_read/write APIs breaks
198 * Hence export separate APIs to manage the omap4 pad control
199 * registers. This APIs will work only for OMAP4
200 */
201
202u32 omap4_ctrl_pad_readl(u16 offset)
203{
204 return __raw_readl(OMAP4_CTRL_PAD_REGADDR(offset));
205}
206
207void omap4_ctrl_pad_writel(u32 val, u16 offset)
208{
209 __raw_writel(val, OMAP4_CTRL_PAD_REGADDR(offset));
210}
211
185#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) 212#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
186/* 213/*
187 * Clears the scratchpad contents in case of cold boot- 214 * Clears the scratchpad contents in case of cold boot-
@@ -190,7 +217,7 @@ void omap_ctrl_writel(u32 val, u16 offset)
190void omap3_clear_scratchpad_contents(void) 217void omap3_clear_scratchpad_contents(void)
191{ 218{
192 u32 max_offset = OMAP343X_SCRATCHPAD_ROM_OFFSET; 219 u32 max_offset = OMAP343X_SCRATCHPAD_ROM_OFFSET;
193 u32 *v_addr; 220 void __iomem *v_addr;
194 u32 offset = 0; 221 u32 offset = 0;
195 v_addr = OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD_ROM); 222 v_addr = OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD_ROM);
196 if (prm_read_mod_reg(OMAP3430_GR_MOD, OMAP3_PRM_RSTST_OFFSET) & 223 if (prm_read_mod_reg(OMAP3430_GR_MOD, OMAP3_PRM_RSTST_OFFSET) &
@@ -206,7 +233,7 @@ void omap3_clear_scratchpad_contents(void)
206/* Populate the scratchpad structure with restore structure */ 233/* Populate the scratchpad structure with restore structure */
207void omap3_save_scratchpad_contents(void) 234void omap3_save_scratchpad_contents(void)
208{ 235{
209 void * __iomem scratchpad_address; 236 void __iomem *scratchpad_address;
210 u32 arm_context_addr; 237 u32 arm_context_addr;
211 struct omap3_scratchpad scratchpad_contents; 238 struct omap3_scratchpad scratchpad_contents;
212 struct omap3_scratchpad_prcm_block prcm_block_contents; 239 struct omap3_scratchpad_prcm_block prcm_block_contents;