diff mbox

[1/3] omap: sram: fix is_sram_locked check

Message ID 1278745713-31255-2-git-send-email-vikram.pandita@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

vikram pandita July 10, 2010, 7:08 a.m. UTC
For OMAP24xx/34xx/44xx: omap_type() returns the correct type:
 OMAP2_DEVICE_TYPE_TEST
 OMAP2_DEVICE_TYPE_EMU
 OMAP2_DEVICE_TYPE_SEC
 OMAP2_DEVICE_TYPE_GP
 OMAP2_DEVICE_TYPE_BAD

In current implementation there are two problems:
Problem 1:
For 34xx, the current if check will never return true.

Problem 2:
For 24xx the correct type check should be with omap_type() function
Verified by checking the TRM 24xx for CONTROL_STATUS register bits

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
---
 arch/arm/plat-omap/sram.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

Comments

Santosh Shilimkar July 10, 2010, 7:27 a.m. UTC | #1
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Pandita, Vikram
> Sent: Saturday, July 10, 2010 12:39 PM
> To: linux-omap@vger.kernel.org
> Cc: Pandita, Vikram
> Subject: [PATCH 1/3] omap: sram: fix is_sram_locked check
> 
> For OMAP24xx/34xx/44xx: omap_type() returns the correct type:
>  OMAP2_DEVICE_TYPE_TEST
>  OMAP2_DEVICE_TYPE_EMU
>  OMAP2_DEVICE_TYPE_SEC
>  OMAP2_DEVICE_TYPE_GP
>  OMAP2_DEVICE_TYPE_BAD
> 
> In current implementation there are two problems:
> Problem 1:
> For 34xx, the current if check will never return true.
> 
> Problem 2:
> For 24xx the correct type check should be with omap_type() function
> Verified by checking the TRM 24xx for CONTROL_STATUS register bits
> 
> Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
> ---
>  arch/arm/plat-omap/sram.c |    7 +------
>  1 files changed, 1 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
> index 226b2e8..2eb5a27 100644
> --- a/arch/arm/plat-omap/sram.c
> +++ b/arch/arm/plat-omap/sram.c
> @@ -93,16 +93,11 @@ extern unsigned long omapfb_reserve_sram(unsigned long
> sram_pstart,
>   */
>  static int is_sram_locked(void)
>  {
> -	int type = 0;
> -
>  	if (cpu_is_omap44xx())
>  		/* Not yet supported */
>  		return 0;
> 
> -	if (cpu_is_omap242x())
> -		type = omap_rev() & OMAP2_DEVICETYPE_MASK;
> -
> -	if (type == GP_DEVICE) {
> +	if (OMAP2_DEVICE_TYPE_GP == omap_type()) {
>  		/* RAMFW: R/W access to all initiators for all qualifier sets
> */
>  		if (cpu_is_omap242x()) {
>  			__raw_writel(0xFF, OMAP24XX_VA_REQINFOPERM0); /* all q-
> vects */
This one looks fine to me.
--
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
diff mbox

Patch

diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 226b2e8..2eb5a27 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -93,16 +93,11 @@  extern unsigned long omapfb_reserve_sram(unsigned long sram_pstart,
  */
 static int is_sram_locked(void)
 {
-	int type = 0;
-
 	if (cpu_is_omap44xx())
 		/* Not yet supported */
 		return 0;
 
-	if (cpu_is_omap242x())
-		type = omap_rev() & OMAP2_DEVICETYPE_MASK;
-
-	if (type == GP_DEVICE) {
+	if (OMAP2_DEVICE_TYPE_GP == omap_type()) {
 		/* RAMFW: R/W access to all initiators for all qualifier sets */
 		if (cpu_is_omap242x()) {
 			__raw_writel(0xFF, OMAP24XX_VA_REQINFOPERM0); /* all q-vects */