From: Rajendra Nayak <rnayak@ti.com>
To: b-cousson@ti.com, paul@pwsan.com
Cc: linux-omap@vger.kernel.org, tony@atomide.com,
linux-arm-kernel@lists.infradead.org,
Rajendra Nayak <rnayak@ti.com>
Subject: [PATCH 1/3] ARM: OMAP: hmwod: Add support for per hwmod/module context lost count
Date: Thu, 3 Nov 2011 16:24:23 +0530 [thread overview]
Message-ID: <1320317665-6381-2-git-send-email-rnayak@ti.com> (raw)
In-Reply-To: <1320317665-6381-1-git-send-email-rnayak@ti.com>
OMAP4 has module specific context lost registers which
makes it now possible to have module level context loss
count, instead of relying on the powerdomain level context
count.
Add 2 private hwmod api's to update/clear the hwmod/module specific
context lost counters/register.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/omap_hwmod.c | 26 ++++++++++++++++++++++++++
arch/arm/plat-omap/include/plat/omap_hwmod.h | 2 ++
2 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index d713807..d7f9dd1 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1426,6 +1426,32 @@ static int _reset(struct omap_hwmod *oh)
return ret;
}
+static void _update_context_lost(struct omap_hwmod *oh)
+{
+ if (oh->prcm.omap4.context_offs)
+ if (omap4_prminst_read_inst_reg(
+ oh->clkdm->pwrdm.ptr->prcm_partition,
+ oh->clkdm->pwrdm.ptr->prcm_offs,
+ oh->prcm.omap4.context_offs))
+ oh->prcm.omap4.context_lost_counter++;
+}
+
+static void _clear_context_lost(struct omap_hwmod *oh)
+{
+ u32 context_reg;
+
+ if (oh->prcm.omap4.context_offs) {
+ context_reg = omap4_prminst_read_inst_reg(
+ oh->clkdm->pwrdm.ptr->prcm_partition,
+ oh->clkdm->pwrdm.ptr->prcm_offs,
+ oh->prcm.omap4.context_offs);
+ omap4_prminst_write_inst_reg(context_reg,
+ oh->clkdm->pwrdm.ptr->prcm_partition,
+ oh->clkdm->pwrdm.ptr->prcm_offs,
+ oh->prcm.omap4.context_offs);
+ }
+}
+
/**
* _enable - enable an omap_hwmod
* @oh: struct omap_hwmod *
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 5419f1a..540e424 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -363,12 +363,14 @@ struct omap_hwmod_omap2_prcm {
* struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data
* @clkctrl_reg: PRCM address of the clock control register
* @rstctrl_reg: address of the XXX_RSTCTRL register located in the PRM
+ * context_lost_counter: Count of module level context lost
* @submodule_wkdep_bit: bit shift of the WKDEP range
*/
struct omap_hwmod_omap4_prcm {
u16 clkctrl_offs;
u16 rstctrl_offs;
u16 context_offs;
+ unsigned context_lost_counter;
u8 submodule_wkdep_bit;
u8 modulemode;
};
--
1.7.1
next prev parent reply other threads:[~2011-11-03 10:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-03 10:54 [PATCH 0/3] Support omap_pm_get_dev_context_loss_count() for OMAP4 Rajendra Nayak
2011-11-03 10:54 ` Rajendra Nayak [this message]
2011-11-03 10:54 ` [PATCH 2/3] ARM: OMAP: hwmod: Update/Clear module specific context lost counters Rajendra Nayak
2011-11-03 10:54 ` [PATCH 3/3] ARM: OMAP: hwmod: Look for hwmod/module level context lost count if supported Rajendra Nayak
2011-11-29 18:10 ` Cousson, Benoit
2011-12-02 4:46 ` Rajendra Nayak
2011-12-16 11:16 ` Paul Walmsley
2011-12-16 11:23 ` Paul Walmsley
2011-12-16 12:21 ` Rajendra Nayak
2011-12-16 12:38 ` Paul Walmsley
2011-12-16 12:17 ` Rajendra Nayak
2011-12-16 12:38 ` Paul Walmsley
2011-12-16 12:41 ` Rajendra Nayak
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=1320317665-6381-2-git-send-email-rnayak@ti.com \
--to=rnayak@ti.com \
--cc=b-cousson@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=tony@atomide.com \
/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).