diff options
author | Tony Lindgren <tony@atomide.com> | 2010-09-27 16:17:13 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-09-27 16:17:13 -0400 |
commit | 91f6c90c8df1818a66d177e105d602c3da820919 (patch) | |
tree | 5cb1b01823dd676a07596f6153d2fc124c4691cb /arch/arm/mach-omap2/control.c | |
parent | 6e457bb05c348e196f67005876992ceb5eb0430a (diff) | |
parent | a3fed9bc181666df6ecfe9ce34a29d48803f2310 (diff) |
Merge branch 'omap4_and_sdrc_2.6.27' of git://git.pwsan.com/linux-2.6 into omap-for-linus
Diffstat (limited to 'arch/arm/mach-omap2/control.c')
-rw-r--r-- | arch/arm/mach-omap2/control.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c index a8d20eef2306..8b3c469e7bcd 100644 --- a/arch/arm/mach-omap2/control.c +++ b/arch/arm/mach-omap2/control.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "sdrc.h" | 25 | #include "sdrc.h" |
26 | 26 | ||
27 | static void __iomem *omap2_ctrl_base; | 27 | static void __iomem *omap2_ctrl_base; |
28 | static void __iomem *omap4_ctrl_pad_base; | ||
28 | 29 | ||
29 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) | 30 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) |
30 | struct omap3_scratchpad { | 31 | struct omap3_scratchpad { |
@@ -137,6 +138,7 @@ static struct omap3_control_regs control_context; | |||
137 | #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ | 138 | #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ |
138 | 139 | ||
139 | #define OMAP_CTRL_REGADDR(reg) (omap2_ctrl_base + (reg)) | 140 | #define OMAP_CTRL_REGADDR(reg) (omap2_ctrl_base + (reg)) |
141 | #define OMAP4_CTRL_PAD_REGADDR(reg) (omap4_ctrl_pad_base + (reg)) | ||
140 | 142 | ||
141 | void __init omap2_set_globals_control(struct omap_globals *omap2_globals) | 143 | void __init omap2_set_globals_control(struct omap_globals *omap2_globals) |
142 | { | 144 | { |
@@ -145,6 +147,12 @@ void __init omap2_set_globals_control(struct omap_globals *omap2_globals) | |||
145 | omap2_ctrl_base = ioremap(omap2_globals->ctrl, SZ_4K); | 147 | omap2_ctrl_base = ioremap(omap2_globals->ctrl, SZ_4K); |
146 | WARN_ON(!omap2_ctrl_base); | 148 | WARN_ON(!omap2_ctrl_base); |
147 | } | 149 | } |
150 | |||
151 | /* Static mapping, never released */ | ||
152 | if (omap2_globals->ctrl_pad) { | ||
153 | omap4_ctrl_pad_base = ioremap(omap2_globals->ctrl_pad, SZ_4K); | ||
154 | WARN_ON(!omap4_ctrl_pad_base); | ||
155 | } | ||
148 | } | 156 | } |
149 | 157 | ||
150 | void __iomem *omap_ctrl_base_get(void) | 158 | void __iomem *omap_ctrl_base_get(void) |
@@ -182,6 +190,23 @@ void omap_ctrl_writel(u32 val, u16 offset) | |||
182 | __raw_writel(val, OMAP_CTRL_REGADDR(offset)); | 190 | __raw_writel(val, OMAP_CTRL_REGADDR(offset)); |
183 | } | 191 | } |
184 | 192 | ||
193 | /* | ||
194 | * On OMAP4 control pad are not addressable from control | ||
195 | * core base. So the common omap_ctrl_read/write APIs breaks | ||
196 | * Hence export separate APIs to manage the omap4 pad control | ||
197 | * registers. This APIs will work only for OMAP4 | ||
198 | */ | ||
199 | |||
200 | u32 omap4_ctrl_pad_readl(u16 offset) | ||
201 | { | ||
202 | return __raw_readl(OMAP4_CTRL_PAD_REGADDR(offset)); | ||
203 | } | ||
204 | |||
205 | void omap4_ctrl_pad_writel(u32 val, u16 offset) | ||
206 | { | ||
207 | __raw_writel(val, OMAP4_CTRL_PAD_REGADDR(offset)); | ||
208 | } | ||
209 | |||
185 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) | 210 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) |
186 | /* | 211 | /* |
187 | * Clears the scratchpad contents in case of cold boot- | 212 | * Clears the scratchpad contents in case of cold boot- |