aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-03-28 13:25:12 -0400
committerKevin Hilman <khilman@ti.com>2011-09-15 15:02:07 -0400
commit4bb73adec43bbf63d39e1c2021de0aab0c60ea34 (patch)
treedc05e399041841aaebe773c4ac37fd86e82777d2 /arch/arm/mach-omap2
parent842ec22852cf843558828e6f7a6da2bf72f341a5 (diff)
OMAP2+: PRM: add register access functions for VC/VP
On OMAP3+, the voltage controller (VC) and voltage processor (VP) are inside the PRM. Add some PRM helper functions for register access to these module registers. Thanks to Nishanth Menon for finding/fixing a sparse problem. Cc: Nishanth Menon <nm@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.c17
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.h8
-rw-r--r--arch/arm/mach-omap2/prm44xx.c22
-rw-r--r--arch/arm/mach-omap2/prm44xx.h8
4 files changed, 54 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index 58c5c878b295..f02d87f68e54 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -169,7 +169,7 @@ struct omap3_vp {
169 u32 tranxdone_status; 169 u32 tranxdone_status;
170}; 170};
171 171
172struct omap3_vp omap3_vp[] = { 172static struct omap3_vp omap3_vp[] = {
173 [OMAP3_VP_VDD_MPU_ID] = { 173 [OMAP3_VP_VDD_MPU_ID] = {
174 .tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK, 174 .tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK,
175 }, 175 },
@@ -197,3 +197,18 @@ void omap3_prm_vp_clear_txdone(u8 vp_id)
197 omap2_prm_write_mod_reg(vp->tranxdone_status, 197 omap2_prm_write_mod_reg(vp->tranxdone_status,
198 OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); 198 OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
199} 199}
200
201u32 omap3_prm_vcvp_read(u8 offset)
202{
203 return omap2_prm_read_mod_reg(OMAP3430_GR_MOD, offset);
204}
205
206void omap3_prm_vcvp_write(u32 val, u8 offset)
207{
208 omap2_prm_write_mod_reg(val, OMAP3430_GR_MOD, offset);
209}
210
211u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset)
212{
213 return omap2_prm_rmw_mod_reg_bits(mask, bits, OMAP3430_GR_MOD, offset);
214}
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-omap2/prm2xxx_3xxx.h
index 51125268632b..cef533df0861 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.h
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h
@@ -307,7 +307,15 @@ extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift);
307u32 omap3_prm_vp_check_txdone(u8 vp_id); 307u32 omap3_prm_vp_check_txdone(u8 vp_id);
308void omap3_prm_vp_clear_txdone(u8 vp_id); 308void omap3_prm_vp_clear_txdone(u8 vp_id);
309 309
310/*
311 * OMAP3 access functions for voltage controller (VC) and
312 * voltage proccessor (VP) in the PRM.
313 */
314extern u32 omap3_prm_vcvp_read(u8 offset);
315extern void omap3_prm_vcvp_write(u32 val, u8 offset);
316extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
310#endif /* CONFIG_ARCH_OMAP4 */ 317#endif /* CONFIG_ARCH_OMAP4 */
318
311#endif 319#endif
312 320
313/* 321/*
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index 390e32c53b0e..495a31a7e8a7 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -24,6 +24,8 @@
24#include "vp.h" 24#include "vp.h"
25#include "prm44xx.h" 25#include "prm44xx.h"
26#include "prm-regbits-44xx.h" 26#include "prm-regbits-44xx.h"
27#include "prcm44xx.h"
28#include "prminst44xx.h"
27 29
28/* PRM low-level functions */ 30/* PRM low-level functions */
29 31
@@ -99,3 +101,23 @@ void omap4_prm_vp_clear_txdone(u8 vp_id)
99 OMAP4430_PRM_OCP_SOCKET_INST, 101 OMAP4430_PRM_OCP_SOCKET_INST,
100 vp->irqstatus_mpu); 102 vp->irqstatus_mpu);
101}; 103};
104
105u32 omap4_prm_vcvp_read(u8 offset)
106{
107 return omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
108 OMAP4430_PRM_DEVICE_INST, offset);
109}
110
111void omap4_prm_vcvp_write(u32 val, u8 offset)
112{
113 omap4_prminst_write_inst_reg(val, OMAP4430_PRM_PARTITION,
114 OMAP4430_PRM_DEVICE_INST, offset);
115}
116
117u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset)
118{
119 return omap4_prminst_rmw_inst_reg_bits(mask, bits,
120 OMAP4430_PRM_PARTITION,
121 OMAP4430_PRM_DEVICE_INST,
122 offset);
123}
diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h
index b28c87dcbfa1..3d66ccd849d2 100644
--- a/arch/arm/mach-omap2/prm44xx.h
+++ b/arch/arm/mach-omap2/prm44xx.h
@@ -755,6 +755,14 @@ extern u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx);
755u32 omap4_prm_vp_check_txdone(u8 vp_id); 755u32 omap4_prm_vp_check_txdone(u8 vp_id);
756void omap4_prm_vp_clear_txdone(u8 vp_id); 756void omap4_prm_vp_clear_txdone(u8 vp_id);
757 757
758/*
759 * OMAP4 access functions for voltage controller (VC) and
760 * voltage proccessor (VP) in the PRM.
761 */
762extern u32 omap4_prm_vcvp_read(u8 offset);
763extern void omap4_prm_vcvp_write(u32 val, u8 offset);
764extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
765
758# endif 766# endif
759 767
760#endif 768#endif