diff options
author | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2010-09-27 16:02:57 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-09-27 16:02:57 -0400 |
commit | 70ba71a25e02ef7b8796723c8615955620e465ff (patch) | |
tree | 2f438307bd74e24f26c35727800fef46bb7bf675 | |
parent | 0c3492467c99f3d0d83a48012ee6e672b016759c (diff) |
omap4: control: Add accessor api's for pad control module
On OMAP4 control pad are not addressable from control
core base. So the common omap_ctrl_read/write APIs breaks
Hence export separate APIs to manage the omap4 pad control
registers.
This APIs will work only for OMAP4
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
-rw-r--r-- | arch/arm/mach-omap2/control.c | 18 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/control.h | 4 |
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c index 99c0eb645d4d..8b3c469e7bcd 100644 --- a/arch/arm/mach-omap2/control.c +++ b/arch/arm/mach-omap2/control.c | |||
@@ -138,6 +138,7 @@ static struct omap3_control_regs control_context; | |||
138 | #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ | 138 | #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ |
139 | 139 | ||
140 | #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)) | ||
141 | 142 | ||
142 | void __init omap2_set_globals_control(struct omap_globals *omap2_globals) | 143 | void __init omap2_set_globals_control(struct omap_globals *omap2_globals) |
143 | { | 144 | { |
@@ -189,6 +190,23 @@ void omap_ctrl_writel(u32 val, u16 offset) | |||
189 | __raw_writel(val, OMAP_CTRL_REGADDR(offset)); | 190 | __raw_writel(val, OMAP_CTRL_REGADDR(offset)); |
190 | } | 191 | } |
191 | 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 | |||
192 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) | 210 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) |
193 | /* | 211 | /* |
194 | * Clears the scratchpad contents in case of cold boot- | 212 | * Clears the scratchpad contents in case of cold boot- |
diff --git a/arch/arm/plat-omap/include/plat/control.h b/arch/arm/plat-omap/include/plat/control.h index 131bf405c2f6..2916b7e9372f 100644 --- a/arch/arm/plat-omap/include/plat/control.h +++ b/arch/arm/plat-omap/include/plat/control.h | |||
@@ -354,9 +354,11 @@ extern void __iomem *omap_ctrl_base_get(void); | |||
354 | extern u8 omap_ctrl_readb(u16 offset); | 354 | extern u8 omap_ctrl_readb(u16 offset); |
355 | extern u16 omap_ctrl_readw(u16 offset); | 355 | extern u16 omap_ctrl_readw(u16 offset); |
356 | extern u32 omap_ctrl_readl(u16 offset); | 356 | extern u32 omap_ctrl_readl(u16 offset); |
357 | extern u32 omap4_ctrl_pad_readl(u16 offset); | ||
357 | extern void omap_ctrl_writeb(u8 val, u16 offset); | 358 | extern void omap_ctrl_writeb(u8 val, u16 offset); |
358 | extern void omap_ctrl_writew(u16 val, u16 offset); | 359 | extern void omap_ctrl_writew(u16 val, u16 offset); |
359 | extern void omap_ctrl_writel(u32 val, u16 offset); | 360 | extern void omap_ctrl_writel(u32 val, u16 offset); |
361 | extern void omap4_ctrl_pad_writel(u32 val, u16 offset); | ||
360 | 362 | ||
361 | extern void omap3_save_scratchpad_contents(void); | 363 | extern void omap3_save_scratchpad_contents(void); |
362 | extern void omap3_clear_scratchpad_contents(void); | 364 | extern void omap3_clear_scratchpad_contents(void); |
@@ -371,9 +373,11 @@ extern void omap3_control_restore_context(void); | |||
371 | #define omap_ctrl_readb(x) 0 | 373 | #define omap_ctrl_readb(x) 0 |
372 | #define omap_ctrl_readw(x) 0 | 374 | #define omap_ctrl_readw(x) 0 |
373 | #define omap_ctrl_readl(x) 0 | 375 | #define omap_ctrl_readl(x) 0 |
376 | #define omap4_ctrl_pad_readl(x) 0 | ||
374 | #define omap_ctrl_writeb(x, y) WARN_ON(1) | 377 | #define omap_ctrl_writeb(x, y) WARN_ON(1) |
375 | #define omap_ctrl_writew(x, y) WARN_ON(1) | 378 | #define omap_ctrl_writew(x, y) WARN_ON(1) |
376 | #define omap_ctrl_writel(x, y) WARN_ON(1) | 379 | #define omap_ctrl_writel(x, y) WARN_ON(1) |
380 | #define omap4_ctrl_pad_writel(x, y) WARN_ON(1) | ||
377 | #endif | 381 | #endif |
378 | #endif /* __ASSEMBLY__ */ | 382 | #endif /* __ASSEMBLY__ */ |
379 | 383 | ||