public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] OMAP3: PM: Fix for MPU power domain MEM BANK position
@ 2009-11-26 11:14 Thara Gopinath
  2009-12-03 12:38 ` Paul Walmsley
  0 siblings, 1 reply; 10+ messages in thread
From: Thara Gopinath @ 2009-11-26 11:14 UTC (permalink / raw)
  To: linux-omap; +Cc: Thara Gopinath, Kevin Hilman

MPU power domain bank 0 bits are displayed in position of bank 1
in PWRSTS and PREPWRSTS registers. So read them from correct
position

Signed-off-by: Thara Gopinath <thara@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/powerdomain.c             |    6 ++++++
 arch/arm/mach-omap2/powerdomains34xx.h        |    1 +
 arch/arm/plat-omap/include/plat/powerdomain.h |    5 ++++-
 3 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index b6990e3..1af447e 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -985,6 +985,9 @@ int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
 	if (pwrdm->banks < (bank + 1))
 		return -EEXIST;
 
+	if (pwrdm->flags & PWRDM_HAS_MPU_QUIRK)
+		bank = 1;
+
 	/*
 	 * The register bit names below may not correspond to the
 	 * actual names of the bits in each powerdomain's register,
@@ -1032,6 +1035,9 @@ int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
 	if (pwrdm->banks < (bank + 1))
 		return -EEXIST;
 
+	if (pwrdm->flags & PWRDM_HAS_MPU_QUIRK)
+		bank = 1;
+
 	/*
 	 * The register bit names below may not correspond to the
 	 * actual names of the bits in each powerdomain's register,
diff --git a/arch/arm/mach-omap2/powerdomains34xx.h b/arch/arm/mach-omap2/powerdomains34xx.h
index fd09b08..588f7e0 100644
--- a/arch/arm/mach-omap2/powerdomains34xx.h
+++ b/arch/arm/mach-omap2/powerdomains34xx.h
@@ -190,6 +190,7 @@ static struct powerdomain mpu_34xx_pwrdm = {
 	.wkdep_srcs	  = mpu_34xx_wkdeps,
 	.pwrsts		  = PWRSTS_OFF_RET_ON,
 	.pwrsts_logic_ret = PWRSTS_OFF_RET,
+	.flags		  = PWRDM_HAS_MPU_QUIRK,
 	.banks		  = 1,
 	.pwrsts_mem_ret	  = {
 		[0] = PWRSTS_OFF_RET,
diff --git a/arch/arm/plat-omap/include/plat/powerdomain.h b/arch/arm/plat-omap/include/plat/powerdomain.h
index 3d45ee1..ad070a6 100644
--- a/arch/arm/plat-omap/include/plat/powerdomain.h
+++ b/arch/arm/plat-omap/include/plat/powerdomain.h
@@ -40,7 +40,10 @@
 
 /* Powerdomain flags */
 #define PWRDM_HAS_HDWR_SAR	(1 << 0) /* hardware save-and-restore support */
-
+#define PWRDM_HAS_MPU_QUIRK	(1 << 1) /* MPU pwr domain has MEM bank 0 bits
+					  * in MEM bank 1 position. This is
+					  * true for OMAP3430
+					  */
 
 /*
  * Number of memory banks that are power-controllable.	On OMAP3430, the
-- 
1.5.4.7


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* RE: [PATCH] OMAP3: PM: Fix for MPU power domain MEM BANK position
@ 2009-08-27 17:39 Aguirre Rodriguez, Sergio Alberto
  2009-08-28  7:24 ` [PATCH V2] " Thara Gopinath
  0 siblings, 1 reply; 10+ messages in thread
From: Aguirre Rodriguez, Sergio Alberto @ 2009-08-27 17:39 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org; +Cc: Gopinath, Thara

Thara,

> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Thara Gopinath
> Sent: Thursday, August 27, 2009 11:48 AM
> To: linux-omap@vger.kernel.org
> Cc: Gopinath, Thara
> Subject: [PATCH] OMAP3: PM: Fix for MPU power domain MEM BANK position
> 
> MPU power domain bank 0 bits are displayed in position of bank 1
> in PWRSTS and PREPWRSTS registers. So read them from correct
> position
> 
> Signed-off-by: Thara Gopinath <thara@ti.com>
> ---
>  arch/arm/mach-omap2/powerdomain.c |   19 +++++++++++++++++++
>  1 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-
> omap2/powerdomain.c
> index 2594cbf..6c5fee9 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -971,6 +971,16 @@ int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm,
> u8 bank)
>  		return -EEXIST;
> 
>  	/*
> +	 * In 3430, for MPU domain bank 0 status bits
> +	 * are displayed in the position of bank1 status bits
> +	 * in PWST  . So the hack. Think of a cleaner
> +	 * way of doing this
> +	 */
> +	if (cpu_is_omap34xx)

AFAIK, above should be:

	if (cpu_is_omap34xx())

Instead, which is how it's being used everywhere else in the kernel.

> +		if (!strcmp("mpu_pwrdm", pwrdm->name))
> +			bank = 1;
> +
> +	/*
>  	 * The register bit names below may not correspond to the
>  	 * actual names of the bits in each powerdomain's register,
>  	 * but the type of value returned is the same for each
> @@ -1018,6 +1028,15 @@ int pwrdm_read_prev_mem_pwrst(struct powerdomain
> *pwrdm, u8 bank)
>  		return -EEXIST;
> 
>  	/*
> +	 * In 3430, for MPU domain bank 0 status bits
> +	 * are displayed in the position of bank1 status bits
> +	 * in PREPWST  . So the hack. Think of a cleaner
> +	 * way of doing this
> +	 */
> +	if (cpu_is_omap34xx)

Same here.

Regards,
Sergio
> +		if (!strcmp("mpu_pwrdm", pwrdm->name))
> +			bank = 1;
> +	/*
>  	 * The register bit names below may not correspond to the
>  	 * actual names of the bits in each powerdomain's register,
>  	 * but the type of value returned is the same for each
> --
> 1.5.4.7
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-12-09 23:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-26 11:14 [PATCH V2] OMAP3: PM: Fix for MPU power domain MEM BANK position Thara Gopinath
2009-12-03 12:38 ` Paul Walmsley
2009-12-09 23:36   ` Kevin Hilman
  -- strict thread matches above, loose matches on Subject: below --
2009-08-27 17:39 [PATCH] " Aguirre Rodriguez, Sergio Alberto
2009-08-28  7:24 ` [PATCH V2] " Thara Gopinath
2009-09-15 16:23   ` Kevin Hilman
2009-10-14 23:21   ` Paul Walmsley
2009-10-15  9:41     ` Gopinath, Thara
2009-10-16  8:21       ` Paul Walmsley
2009-10-16 11:03         ` Gopinath, Thara
2009-11-23 14:39           ` Paul Walmsley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox