diff options
Diffstat (limited to 'arch/arm/mach-omap2/prcm.c')
-rw-r--r-- | arch/arm/mach-omap2/prcm.c | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index c20137497c92..a51846e3a6fa 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c | |||
@@ -26,13 +26,14 @@ | |||
26 | #include <plat/common.h> | 26 | #include <plat/common.h> |
27 | #include <plat/prcm.h> | 27 | #include <plat/prcm.h> |
28 | #include <plat/irqs.h> | 28 | #include <plat/irqs.h> |
29 | #include <plat/control.h> | ||
30 | 29 | ||
31 | #include "clock.h" | 30 | #include "clock.h" |
32 | #include "clock2xxx.h" | 31 | #include "clock2xxx.h" |
33 | #include "cm.h" | 32 | #include "cm.h" |
34 | #include "prm.h" | 33 | #include "prm.h" |
35 | #include "prm-regbits-24xx.h" | 34 | #include "prm-regbits-24xx.h" |
35 | #include "prm-regbits-44xx.h" | ||
36 | #include "control.h" | ||
36 | 37 | ||
37 | static void __iomem *prm_base; | 38 | static void __iomem *prm_base; |
38 | static void __iomem *cm_base; | 39 | static void __iomem *cm_base; |
@@ -118,7 +119,7 @@ struct omap3_prcm_regs { | |||
118 | u32 wkup_pm_wken; | 119 | u32 wkup_pm_wken; |
119 | }; | 120 | }; |
120 | 121 | ||
121 | struct omap3_prcm_regs prcm_context; | 122 | static struct omap3_prcm_regs prcm_context; |
122 | 123 | ||
123 | u32 omap_prcm_get_reset_sources(void) | 124 | u32 omap_prcm_get_reset_sources(void) |
124 | { | 125 | { |
@@ -161,8 +162,8 @@ void omap_prcm_arch_reset(char mode, const char *cmd) | |||
161 | prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, prcm_offs, | 162 | prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, prcm_offs, |
162 | OMAP2_RM_RSTCTRL); | 163 | OMAP2_RM_RSTCTRL); |
163 | if (cpu_is_omap44xx()) | 164 | if (cpu_is_omap44xx()) |
164 | prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, prcm_offs, | 165 | prm_set_mod_reg_bits(OMAP4430_RST_GLOBAL_WARM_SW_MASK, |
165 | OMAP4_RM_RSTCTRL); | 166 | prcm_offs, OMAP4_RM_RSTCTRL); |
166 | } | 167 | } |
167 | 168 | ||
168 | static inline u32 __omap_prcm_read(void __iomem *base, s16 module, u16 reg) | 169 | static inline u32 __omap_prcm_read(void __iomem *base, s16 module, u16 reg) |
@@ -215,6 +216,30 @@ u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask) | |||
215 | return v; | 216 | return v; |
216 | } | 217 | } |
217 | 218 | ||
219 | /* Read a PRM register, AND it, and shift the result down to bit 0 */ | ||
220 | u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask) | ||
221 | { | ||
222 | u32 v; | ||
223 | |||
224 | v = __raw_readl(reg); | ||
225 | v &= mask; | ||
226 | v >>= __ffs(mask); | ||
227 | |||
228 | return v; | ||
229 | } | ||
230 | |||
231 | /* Read-modify-write a register in a PRM module. Caller must lock */ | ||
232 | u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg) | ||
233 | { | ||
234 | u32 v; | ||
235 | |||
236 | v = __raw_readl(reg); | ||
237 | v &= ~mask; | ||
238 | v |= bits; | ||
239 | __raw_writel(v, reg); | ||
240 | |||
241 | return v; | ||
242 | } | ||
218 | /* Read a register in a CM module */ | 243 | /* Read a register in a CM module */ |
219 | u32 cm_read_mod_reg(s16 module, u16 idx) | 244 | u32 cm_read_mod_reg(s16 module, u16 idx) |
220 | { | 245 | { |