linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tero Kristo <t-kristo@ti.com>
To: linux-omap@vger.kernel.org, khilman@ti.com, paul@pwsan.com
Cc: linux-arm-kernel@lists.infradead.org,
	Santosh Shilimkar <santosh.shilimkar@ti.com>
Subject: [PATCHv2 01/19] ARM: OMAP4: PM: powerdomain: Add HWSAR flag to L3INIT
Date: Mon, 14 May 2012 13:18:32 +0300	[thread overview]
Message-ID: <1336990730-26892-2-git-send-email-t-kristo@ti.com> (raw)
In-Reply-To: <1336990730-26892-1-git-send-email-t-kristo@ti.com>

From: Santosh Shilimkar <santosh.shilimkar@ti.com>

L3INIT powerdomain has USB HOST and USB TLL modules which support
hardware save-and-restore (HW SAR) mechanism.
This patch updates the L3INIT power domain to mark them as capable
of doing H/w save and restore and provides functions to do them
explicitly.

Note: Eventually, these custom function implementation will be
abstracted and might be done in hwmod or in other layer.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/mach-omap2/powerdomain44xx.c       |   41 +++++++++++++++++++++++++++
 arch/arm/mach-omap2/powerdomains44xx_data.c |    2 +-
 2 files changed, 42 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/powerdomain44xx.c b/arch/arm/mach-omap2/powerdomain44xx.c
index ab00736..37f7e12 100644
--- a/arch/arm/mach-omap2/powerdomain44xx.c
+++ b/arch/arm/mach-omap2/powerdomain44xx.c
@@ -23,6 +23,10 @@
 #include "prm44xx.h"
 #include "prminst44xx.h"
 #include "prm-regbits-44xx.h"
+#include "cm-regbits-44xx.h"
+#include "prcm44xx.h"
+#include "cm2_44xx.h"
+#include "cminst44xx.h"
 
 static int omap4_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
 {
@@ -238,6 +242,41 @@ static int omap4_pwrdm_wait_transition(struct powerdomain *pwrdm)
 	return 0;
 }
 
+static int omap4_pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm)
+{
+	/*
+	 * FIXME: This should be fixed right way by moving it into HWMOD
+	 * or clock framework since sar control is moved to module level
+	 */
+	omap4_cminst_rmw_inst_reg_bits(OMAP4430_SAR_MODE_MASK,
+		1 << OMAP4430_SAR_MODE_SHIFT, OMAP4430_CM2_PARTITION,
+		OMAP4430_CM2_L3INIT_INST,
+		OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_OFFSET);
+	omap4_cminst_rmw_inst_reg_bits(OMAP4430_SAR_MODE_MASK,
+		1 << OMAP4430_SAR_MODE_SHIFT, OMAP4430_CM2_PARTITION,
+		OMAP4430_CM2_L3INIT_INST,
+		OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_OFFSET);
+	return 0;
+}
+
+static int omap4_pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
+{
+	/*
+	 * FIXME: This should be fixed right way by moving it into HWMOD
+	 * or clock framework since sar control is moved to module level
+	 */
+	omap4_cminst_rmw_inst_reg_bits(OMAP4430_SAR_MODE_MASK,
+		0 << OMAP4430_SAR_MODE_SHIFT, OMAP4430_CM2_PARTITION,
+		OMAP4430_CM2_L3INIT_INST,
+		OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_OFFSET);
+	omap4_cminst_rmw_inst_reg_bits(OMAP4430_SAR_MODE_MASK,
+		0 << OMAP4430_SAR_MODE_SHIFT, OMAP4430_CM2_PARTITION,
+		OMAP4430_CM2_L3INIT_INST,
+		OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_OFFSET);
+
+	return 0;
+}
+
 struct pwrdm_ops omap4_pwrdm_operations = {
 	.pwrdm_set_next_pwrst	= omap4_pwrdm_set_next_pwrst,
 	.pwrdm_read_next_pwrst	= omap4_pwrdm_read_next_pwrst,
@@ -255,4 +294,6 @@ struct pwrdm_ops omap4_pwrdm_operations = {
 	.pwrdm_set_mem_onst	= omap4_pwrdm_set_mem_onst,
 	.pwrdm_set_mem_retst	= omap4_pwrdm_set_mem_retst,
 	.pwrdm_wait_transition	= omap4_pwrdm_wait_transition,
+	.pwrdm_enable_hdwr_sar	= omap4_pwrdm_enable_hdwr_sar,
+	.pwrdm_disable_hdwr_sar	= omap4_pwrdm_disable_hdwr_sar,
 };
diff --git a/arch/arm/mach-omap2/powerdomains44xx_data.c b/arch/arm/mach-omap2/powerdomains44xx_data.c
index 704664c..d8701ce 100644
--- a/arch/arm/mach-omap2/powerdomains44xx_data.c
+++ b/arch/arm/mach-omap2/powerdomains44xx_data.c
@@ -276,7 +276,7 @@ static struct powerdomain l3init_44xx_pwrdm = {
 	.pwrsts_mem_on	= {
 		[0] = PWRSTS_ON,	/* l3init_bank1 */
 	},
-	.flags		  = PWRDM_HAS_LOWPOWERSTATECHANGE,
+	.flags		  = PWRDM_HAS_LOWPOWERSTATECHANGE | PWRDM_HAS_HDWR_SAR,
 };
 
 /* l4per_44xx_pwrdm: Target peripherals power domain */
-- 
1.7.4.1


  reply	other threads:[~2012-05-14 10:19 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-14 10:18 [PATCHv2 00/19] ARM: OMAP4: device off support Tero Kristo
2012-05-14 10:18 ` Tero Kristo [this message]
2012-05-16 18:27   ` [PATCHv2 01/19] ARM: OMAP4: PM: powerdomain: Add HWSAR flag to L3INIT Kevin Hilman
2012-05-14 10:18 ` [PATCHv2 02/19] ARM: OMAP4: Add SAR ROM base address Tero Kristo
2012-05-16 18:28   ` Kevin Hilman
2012-05-21  8:28     ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 03/19] ARM: OMAP4: PM: Add device-off support Tero Kristo
2012-05-16 22:36   ` Kevin Hilman
2012-05-17  7:10     ` Shilimkar, Santosh
2012-05-21  8:48     ` Tero Kristo
2012-05-21 14:05       ` Jean Pihet
2012-05-29 18:34         ` Kevin Hilman
2012-05-29 18:31       ` Kevin Hilman
2012-05-30  8:20         ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 04/19] ARM: OMAP4: PM: save/restore all DPLL settings in OFF mode Tero Kristo
2012-05-16 22:42   ` Kevin Hilman
2012-05-17  7:04     ` Shilimkar, Santosh
2012-05-17  8:52       ` Shilimkar, Santosh
2012-05-17 16:37         ` Kevin Hilman
2012-05-21  9:01           ` Tero Kristo
2012-05-29 19:46         ` Menon, Nishanth
2012-05-30 17:59           ` Kevin Hilman
2012-05-30 18:24             ` Menon, Nishanth
2012-05-30 22:09               ` Kevin Hilman
2012-05-31  2:38                 ` Shilimkar, Santosh
2012-05-21  8:58     ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 05/19] ARM: OMAP4: PM: save/restore all CM1/2 " Tero Kristo
2012-05-16 22:48   ` Kevin Hilman
2012-05-17  7:05     ` Shilimkar, Santosh
2012-05-14 10:18 ` [PATCHv2 06/19] ARM: OMAP4: PM: Add SAR backup support towards device OFF Tero Kristo
2012-05-16 22:58   ` Kevin Hilman
2012-05-17  7:02     ` Shilimkar, Santosh
2012-05-17 16:42       ` Kevin Hilman
2012-05-18  5:53         ` Shilimkar, Santosh
2012-05-21  9:07           ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 07/19] ARM: OMAP4: Auto generate SAR layout contents Tero Kristo
2012-05-14 10:18 ` [PATCHv2 08/19] ARM: OMAP4: SAR: generate overwrite data based on SAR ROM contents Tero Kristo
2012-05-14 10:18 ` [PATCHv2 09/19] ARM: OMAP4: PM: add errata support Tero Kristo
2012-05-29 20:10   ` Menon, Nishanth
2012-05-30  8:32     ` Tero Kristo
2012-05-30 14:45       ` Menon, Nishanth
2012-05-14 10:18 ` [PATCHv2 10/19] ARM: OMAP4: PM: Work-around for ROM code BUG of IVAHD/TESLA Tero Kristo
2012-05-16 23:05   ` Kevin Hilman
2012-05-16 23:07     ` Kevin Hilman
2012-05-21  9:11       ` Tero Kristo
2012-05-29 20:13         ` Kevin Hilman
2012-05-17  6:52     ` Shilimkar, Santosh
2012-05-17 16:45       ` Kevin Hilman
2012-05-18  5:55         ` Shilimkar, Santosh
2012-05-14 10:18 ` [PATCHv2 11/19] ARM: OMAP4: PM: save/restore CM L3INSTR registers when MPU hits OSWR/OFF mode Tero Kristo
2012-05-16 23:17   ` Kevin Hilman
2012-05-17  6:53     ` Shilimkar, Santosh
2012-05-14 10:18 ` [PATCHv2 12/19] ARM: OMAP4: PM: update ROM return address for OSWR and OFF Tero Kristo
2012-05-16 23:36   ` Kevin Hilman
2012-05-21  9:29     ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 13/19] ARM: OMAP4: PM: Mark the PPI and SPI interrupts as non-secure for GP Tero Kristo
2012-05-16 23:48   ` Kevin Hilman
2012-05-21  9:32     ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 14/19] ARM: OMAP4: wakeupgen: enable clocks for save_secure_all Tero Kristo
2012-05-17  0:06   ` Kevin Hilman
2012-05-21  9:38     ` Tero Kristo
2012-05-21  9:43       ` Shilimkar, Santosh
2012-05-29 20:15       ` Kevin Hilman
2012-05-29 20:48         ` Menon, Nishanth
2012-05-30  8:44           ` Tero Kristo
2012-05-30  8:33         ` Tero Kristo
2012-05-17  0:17   ` Paul Walmsley
2012-05-21  9:35     ` Tero Kristo
2012-05-21  9:39       ` Shilimkar, Santosh
2012-05-14 10:18 ` [PATCHv2 15/19] ARM: OMAP4430: PM: workaround for DDR corruption on second CS Tero Kristo
2012-05-17  0:15   ` Kevin Hilman
2012-05-17  7:12     ` Shilimkar, Santosh
2012-05-17 16:47       ` Kevin Hilman
2012-05-18  5:55         ` Shilimkar, Santosh
2012-05-14 10:18 ` [PATCHv2 16/19] TEMP: ARM: OMAP4: prevent voltage transitions Tero Kristo
2012-05-14 10:18 ` [PATCHv2 17/19] ARM: OMAP4: put cpu1 back to sleep if no wake request Tero Kristo
2012-05-17  0:31   ` Kevin Hilman
2012-05-21 10:21     ` Tero Kristo
2012-05-21 10:40       ` Shilimkar, Santosh
2012-05-29 20:17         ` Kevin Hilman
2012-05-30 15:18         ` Menon, Nishanth
2012-05-14 10:18 ` [PATCHv2 18/19] ARM: OMAP4460: wakeupgen: set GIC_CPU0 backup status flag always Tero Kristo
2012-05-17  0:33   ` Kevin Hilman
2012-05-21  9:12     ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 19/19] ARM: OMAP4: powerdomain: update mpu / core off counters during device off Tero Kristo
2012-05-30 21:08   ` Menon, Nishanth
2012-05-31  6:50     ` Tero Kristo

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=1336990730-26892-2-git-send-email-t-kristo@ti.com \
    --to=t-kristo@ti.com \
    --cc=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=santosh.shilimkar@ti.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).