From: Kevin Hilman <khilman@ti.com>
To: linux-omap@vger.kernel.org
Subject: [PATCH/RFC 03/13] OMAP3+: PRM: add register access functions for VC/VP
Date: Fri, 1 Apr 2011 16:41:01 -0700 [thread overview]
Message-ID: <1301701271-22096-4-git-send-email-khilman@ti.com> (raw)
In-Reply-To: <1301701271-22096-1-git-send-email-khilman@ti.com>
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.
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
arch/arm/mach-omap2/prm2xxx_3xxx.c | 15 +++++++++++++++
arch/arm/mach-omap2/prm2xxx_3xxx.h | 8 ++++++++
arch/arm/mach-omap2/prm44xx.c | 22 ++++++++++++++++++++++
arch/arm/mach-omap2/prm44xx.h | 8 ++++++++
4 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index 58c5c87..3b83763 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -197,3 +197,18 @@ void omap3_prm_vp_clear_txdone(u8 vp_id)
omap2_prm_write_mod_reg(vp->tranxdone_status,
OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
}
+
+u32 omap3_prm_vcvp_read(u8 offset)
+{
+ return omap2_prm_read_mod_reg(OMAP3430_GR_MOD, offset);
+}
+
+void omap3_prm_vcvp_write(u32 val, u8 offset)
+{
+ omap2_prm_write_mod_reg(val, OMAP3430_GR_MOD, offset);
+}
+
+u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset)
+{
+ return omap2_prm_rmw_mod_reg_bits(mask, bits, OMAP3430_GR_MOD, offset);
+}
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-omap2/prm2xxx_3xxx.h
index 5112526..cef533d 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);
u32 omap3_prm_vp_check_txdone(u8 vp_id);
void omap3_prm_vp_clear_txdone(u8 vp_id);
+/*
+ * OMAP3 access functions for voltage controller (VC) and
+ * voltage proccessor (VP) in the PRM.
+ */
+extern u32 omap3_prm_vcvp_read(u8 offset);
+extern void omap3_prm_vcvp_write(u32 val, u8 offset);
+extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
#endif /* CONFIG_ARCH_OMAP4 */
+
#endif
/*
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index 3bb2f61..8a3bba3 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -24,6 +24,8 @@
#include "vp.h"
#include "prm44xx.h"
#include "prm-regbits-44xx.h"
+#include "prcm44xx.h"
+#include "prminst44xx.h"
/*
* Address offset (in bytes) between the reset control and the reset
@@ -242,3 +244,23 @@ void omap4_prm_vp_clear_txdone(u8 vp_id)
OMAP4430_PRM_OCP_SOCKET_INST,
vp->irqstatus_mpu);
};
+
+u32 omap4_prm_vcvp_read(u8 offset)
+{
+ return omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
+ OMAP4430_PRM_DEVICE_INST, offset);
+}
+
+void omap4_prm_vcvp_write(u32 val, u8 offset)
+{
+ omap4_prminst_write_inst_reg(val, OMAP4430_PRM_PARTITION,
+ OMAP4430_PRM_DEVICE_INST, offset);
+}
+
+u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset)
+{
+ return omap4_prminst_rmw_inst_reg_bits(mask, bits,
+ OMAP4430_PRM_PARTITION,
+ OMAP4430_PRM_DEVICE_INST,
+ offset);
+}
diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h
index e385366..048c8e5 100644
--- a/arch/arm/mach-omap2/prm44xx.h
+++ b/arch/arm/mach-omap2/prm44xx.h
@@ -777,6 +777,14 @@ extern void omap4_prm_global_warm_sw_reset(void);
u32 omap4_prm_vp_check_txdone(u8 vp_id);
void omap4_prm_vp_clear_txdone(u8 vp_id);
+/*
+ * OMAP4 access functions for voltage controller (VC) and
+ * voltage proccessor (VP) in the PRM.
+ */
+extern u32 omap4_prm_vcvp_read(u8 offset);
+extern void omap4_prm_vcvp_write(u32 val, u8 offset);
+extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
+
# endif
#endif
--
1.7.4
next prev parent reply other threads:[~2011-04-01 23:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-01 23:40 [PATCH/RFC 00/13] OMAP: voltage layer cleanup and restructure: part 2 Kevin Hilman
2011-04-01 23:40 ` [PATCH/RFC 01/13] OMAP3+: add PRM VP functions for checking/clearing VP TX done status Kevin Hilman
2011-04-01 23:41 ` [PATCH/RFC 02/13] OMAP3+ VP: replace transaction done check/clear with VP ops Kevin Hilman
2011-04-01 23:41 ` Kevin Hilman [this message]
2011-04-01 23:41 ` [PATCH/RFC 04/13] OMAP3+: voltage: convert to PRM register access functions Kevin Hilman
2011-04-01 23:41 ` [PATCH/RFC 05/13] OMAP3+: VC: cleanup i2c slave address configuration Kevin Hilman
2011-04-01 23:41 ` [PATCH/RFC 06/13] OMAP3+: VC: cleanup PMIC register " Kevin Hilman
2011-04-01 23:41 ` [PATCH/RFC 07/13] OMAP3+: VC bypass: use fields from VC struct instead of PMIC info Kevin Hilman
2011-04-01 23:41 ` [PATCH/RFC 08/13] OMAP3+: VC: cleanup voltage setup time configuration Kevin Hilman
2011-04-01 23:41 ` [PATCH/RFC 09/13] OMAP3+: VC: move on/onlp/ret/off command configuration into common init Kevin Hilman
2011-04-01 23:41 ` [PATCH/RFC 10/13] OMAP3+: VC: abstract out channel configuration Kevin Hilman
2011-04-01 23:41 ` [PATCH/RFC 11/13] OMAP4: PRM: VC: rename I2C configuration register: s/INSTE/MODE/ Kevin Hilman
2011-04-01 23:41 ` [PATCH/RFC 12/13] OMAP3+: voltage domain: move PMIC struct from vdd_info into struct voltagedomain Kevin Hilman
2011-04-01 23:41 ` [PATCH/RFC 13/13] OMAP3+: VC: make I2C config programmable with PMIC-specific settings Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1301701271-22096-4-git-send-email-khilman@ti.com \
--to=khilman@ti.com \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).