aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/prm2xxx_3xxx.c
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2010-12-21 17:30:55 -0500
committerPaul Walmsley <paul@pwsan.com>2010-12-21 22:01:55 -0500
commit59fb659b065f52fcc2deed293cfbfc58f890376c (patch)
tree17d41be36262ed960fb30df41acf80602ade6726 /arch/arm/mach-omap2/prm2xxx_3xxx.c
parentcdb54c4457d68994da7c2e16907adfbfc130060d (diff)
OMAP2/3: PRCM: split OMAP2/3-specific PRCM code into OMAP2/3-specific files
In preparation for adding OMAP4-specific PRCM accessor/mutator functions, split the existing OMAP2/3 PRCM code into OMAP2/3-specific files. Most of what was in mach-omap2/{cm,prm}.{c,h} has now been moved into mach-omap2/{cm,prm}2xxx_3xxx.{c,h}, since it was OMAP2xxx/3xxx-specific. This process also requires the #includes in each of these files to be changed to reference the new file name. As part of doing so, add some comments into plat-omap/sram.c and plat-omap/mcbsp.c, which use "sideways includes", to indicate that these users of the PRM/CM includes should not be doing so. Thanks to Felipe Contreras <felipe.contreras@gmail.com> for comments on this patch. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Jarkko Nikula <jhnikula@gmail.com> Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Omar Ramirez Luna <omar.ramirez@ti.com> Acked-by: Omar Ramirez Luna <omar.ramirez@ti.com> Cc: Felipe Contreras <felipe.contreras@gmail.com> Acked-by: Felipe Contreras <felipe.contreras@gmail.com> Cc: Greg Kroah-Hartman <greg@kroah.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Rajendra Nayak <rnayak@ti.com> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/prm2xxx_3xxx.c')
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.c51
1 files changed, 49 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index 421771eee450..064b52a3e202 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -12,18 +12,65 @@
12 */ 12 */
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/delay.h>
16#include <linux/errno.h> 15#include <linux/errno.h>
17#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/io.h>
18 18
19#include <plat/common.h> 19#include <plat/common.h>
20#include <plat/cpu.h> 20#include <plat/cpu.h>
21#include <plat/prcm.h> 21#include <plat/prcm.h>
22 22
23#include "prm.h" 23#include "prm2xxx_3xxx.h"
24#include "cm2xxx_3xxx.h"
24#include "prm-regbits-24xx.h" 25#include "prm-regbits-24xx.h"
25#include "prm-regbits-34xx.h" 26#include "prm-regbits-34xx.h"
26 27
28u32 prm_read_mod_reg(s16 module, u16 idx)
29{
30 return __raw_readl(prm_base + module + idx);
31}
32
33void prm_write_mod_reg(u32 val, s16 module, u16 idx)
34{
35 __raw_writel(val, prm_base + module + idx);
36}
37
38/* Read-modify-write a register in a PRM module. Caller must lock */
39u32 prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
40{
41 u32 v;
42
43 v = prm_read_mod_reg(module, idx);
44 v &= ~mask;
45 v |= bits;
46 prm_write_mod_reg(v, module, idx);
47
48 return v;
49}
50
51/* Read a PRM register, AND it, and shift the result down to bit 0 */
52u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask)
53{
54 u32 v;
55
56 v = prm_read_mod_reg(domain, idx);
57 v &= mask;
58 v >>= __ffs(mask);
59
60 return v;
61}
62
63u32 prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
64{
65 return prm_rmw_mod_reg_bits(bits, bits, module, idx);
66}
67
68u32 prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
69{
70 return prm_rmw_mod_reg_bits(bits, 0x0, module, idx);
71}
72
73
27/** 74/**
28 * omap2_prm_is_hardreset_asserted - read the HW reset line state of 75 * omap2_prm_is_hardreset_asserted - read the HW reset line state of
29 * submodules contained in the hwmod module 76 * submodules contained in the hwmod module