linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] omap2/3: Update revision identification
@ 2010-08-16 15:53 Sanjeev Premi
  2010-09-03  8:21 ` Premi, Sanjeev
  2010-09-23 16:56 ` Tony Lindgren
  0 siblings, 2 replies; 3+ messages in thread
From: Sanjeev Premi @ 2010-08-16 15:53 UTC (permalink / raw)
  To: linux-omap; +Cc: Sanjeev Premi

The existing definitions for cpu revision used
upper nibble in the bits[15:08]. With OMAP3630,
definitions use lower nibble.

This patch unifies the definitions to start
at lower nibble.

  [1] http://marc.info/?t=128161739100005&r=1&w=2

Signed-off-by: Sanjeev Premi <premi@ti.com>
---
 arch/arm/mach-omap2/id.c              |   22 +++++++++++---------
 arch/arm/plat-omap/include/plat/cpu.h |   36 ++++++++++++++++----------------
 2 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 9a879f9..06f0d0f 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -366,21 +366,23 @@ static void __init omap3_cpuinfo(void)
 		strcpy(cpu_rev, "1.0");
 		break;
 	case OMAP_REVBITS_01:
-		strcpy(cpu_rev, "1.1");
+		if (cpu_is_omap3630()) {
+			strcpy(cpu_rev, "1.1");
+		} else {
+			strcpy(cpu_rev, "2.0");
+		}
 		break;
 	case OMAP_REVBITS_02:
-		strcpy(cpu_rev, "1.2");
-		break;
-	case OMAP_REVBITS_10:
-		strcpy(cpu_rev, "2.0");
-		break;
-	case OMAP_REVBITS_20:
-		strcpy(cpu_rev, "2.1");
+		if (cpu_is_omap3630()) {
+			strcpy(cpu_rev, "1.2");
+		} else {
+			strcpy(cpu_rev, "2.1");
+		}
 		break;
-	case OMAP_REVBITS_30:
+	case OMAP_REVBITS_03:
 		strcpy(cpu_rev, "3.0");
 		break;
-	case OMAP_REVBITS_40:
+	case OMAP_REVBITS_04:
 	/* FALLTHROUGH */
 	default:
 		/* Use the latest known revision as default */
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index 2e2ae53..46e16b7 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -68,10 +68,9 @@ unsigned int omap_rev(void);
 #define OMAP_REVBITS_00		0x00
 #define OMAP_REVBITS_01		0x01
 #define OMAP_REVBITS_02		0x02
-#define OMAP_REVBITS_10		0x10
-#define OMAP_REVBITS_20		0x20
-#define OMAP_REVBITS_30		0x30
-#define OMAP_REVBITS_40		0x40
+#define OMAP_REVBITS_03		0x03
+#define OMAP_REVBITS_04		0x04
+#define OMAP_REVBITS_05		0x05
 
 /*
  * Get the CPU revision for OMAP devices
@@ -363,23 +362,24 @@ IS_OMAP_TYPE(3517, 0x3517)
 
 /* Various silicon revisions for omap2 */
 #define OMAP242X_CLASS		0x24200024
-#define OMAP2420_REV_ES1_0	0x24200024
-#define OMAP2420_REV_ES2_0	0x24201024
+#define OMAP2420_REV_ES1_0	(OMAP242X_CLASS)
+#define OMAP2420_REV_ES2_0	(OMAP242X_CLASS | (OMAP_REVBITS_01 << 8))
 
 #define OMAP243X_CLASS		0x24300024
-#define OMAP2430_REV_ES1_0	0x24300024
+#define OMAP2430_REV_ES1_0	(OMAP243X_CLASS)
 
 #define OMAP343X_CLASS		0x34300034
-#define OMAP3430_REV_ES1_0	0x34300034
-#define OMAP3430_REV_ES2_0	0x34301034
-#define OMAP3430_REV_ES2_1	0x34302034
-#define OMAP3430_REV_ES3_0	0x34303034
-#define OMAP3430_REV_ES3_1	0x34304034
-#define OMAP3430_REV_ES3_1_2	0x34305034
-
-#define OMAP3630_REV_ES1_0	0x36300034
-#define OMAP3630_REV_ES1_1	0x36300134
-#define OMAP3630_REV_ES1_2	0x36300234
+#define OMAP3430_REV_ES1_0	(OMAP343X_CLASS)
+#define OMAP3430_REV_ES2_0	(OMAP343X_CLASS | (OMAP_REVBITS_01 << 8))
+#define OMAP3430_REV_ES2_1	(OMAP343X_CLASS | (OMAP_REVBITS_02 << 8))
+#define OMAP3430_REV_ES3_0	(OMAP343X_CLASS | (OMAP_REVBITS_03 << 8))
+#define OMAP3430_REV_ES3_1	(OMAP343X_CLASS | (OMAP_REVBITS_04 << 8))
+#define OMAP3430_REV_ES3_1_2	(OMAP343X_CLASS | (OMAP_REVBITS_05 << 8))
+
+#define OMAP363X_CLASS		0x36000034
+#define OMAP3630_REV_ES1_0	(OMAP363X_CLASS)
+#define OMAP3630_REV_ES1_1	(OMAP363X_CLASS | (OMAP_REVBITS_01 << 8))
+#define OMAP3630_REV_ES1_2	(OMAP363X_CLASS | (OMAP_REVBITS_02 << 8))
 
 #define OMAP35XX_CLASS		0x35000034
 #define OMAP3503_REV(v)		(OMAP35XX_CLASS | (0x3503 << 16) | (v << 8))
@@ -390,7 +390,7 @@ IS_OMAP_TYPE(3517, 0x3517)
 #define OMAP3517_REV(v)		(OMAP35XX_CLASS | (0x3517 << 16) | (v << 8))
 
 #define OMAP443X_CLASS		0x44300044
-#define OMAP4430_REV_ES1_0	0x44300044
+#define OMAP4430_REV_ES1_0	(OMAP443X_CLASS)
 
 /*
  * omap_chip bits
-- 
1.6.6.1


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

* RE: [PATCH 1/1] omap2/3: Update revision identification
  2010-08-16 15:53 [PATCH 1/1] omap2/3: Update revision identification Sanjeev Premi
@ 2010-09-03  8:21 ` Premi, Sanjeev
  2010-09-23 16:56 ` Tony Lindgren
  1 sibling, 0 replies; 3+ messages in thread
From: Premi, Sanjeev @ 2010-09-03  8:21 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org

> -----Original Message-----
> From: Premi, Sanjeev 
> Sent: Monday, August 16, 2010 9:23 PM
> To: linux-omap@vger.kernel.org
> Cc: Premi, Sanjeev
> Subject: [PATCH 1/1] omap2/3: Update revision identification
> 
> The existing definitions for cpu revision used
> upper nibble in the bits[15:08]. With OMAP3630,
> definitions use lower nibble.
> 
> This patch unifies the definitions to start
> at lower nibble.
> 
>   [1] http://marc.info/?t=128161739100005&r=1&w=2
> 
> Signed-off-by: Sanjeev Premi <premi@ti.com>
> ---
>  arch/arm/mach-omap2/id.c              |   22 +++++++++++---------
>  arch/arm/plat-omap/include/plat/cpu.h |   36 
> ++++++++++++++++----------------

Hi Tony,

Did you have chance to look at this?
(I was away from work; couldn't follow-up earlier).

Best regards,
Sanjeev

[snip]--[snip]

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

* Re: [PATCH 1/1] omap2/3: Update revision identification
  2010-08-16 15:53 [PATCH 1/1] omap2/3: Update revision identification Sanjeev Premi
  2010-09-03  8:21 ` Premi, Sanjeev
@ 2010-09-23 16:56 ` Tony Lindgren
  1 sibling, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2010-09-23 16:56 UTC (permalink / raw)
  To: Sanjeev Premi; +Cc: linux-omap

* Sanjeev Premi <premi@ti.com> [100816 08:46]:
> --- a/arch/arm/mach-omap2/id.c
> +++ b/arch/arm/mach-omap2/id.c
> @@ -366,21 +366,23 @@ static void __init omap3_cpuinfo(void)
>  		strcpy(cpu_rev, "1.0");
>  		break;
>  	case OMAP_REVBITS_01:
> -		strcpy(cpu_rev, "1.1");
> +		if (cpu_is_omap3630()) {
> +			strcpy(cpu_rev, "1.1");
> +		} else {
> +			strcpy(cpu_rev, "2.0");
> +		}
>  		break;

No { } brackets needed if it's one line + one line if else
statement.

>  	case OMAP_REVBITS_02:
> -		strcpy(cpu_rev, "1.2");
> -		break;
> -	case OMAP_REVBITS_10:
> -		strcpy(cpu_rev, "2.0");
> -		break;
> -	case OMAP_REVBITS_20:
> -		strcpy(cpu_rev, "2.1");
> +		if (cpu_is_omap3630()) {
> +			strcpy(cpu_rev, "1.2");
> +		} else {
> +			strcpy(cpu_rev, "2.1");
> +		}
>  		break;

Not needed here either.

> -	case OMAP_REVBITS_30:
> +	case OMAP_REVBITS_03:
>  		strcpy(cpu_rev, "3.0");
>  		break;
> -	case OMAP_REVBITS_40:
> +	case OMAP_REVBITS_04:
>  	/* FALLTHROUGH */
>  	default:
>  		/* Use the latest known revision as default */

Also, maybe just set a separate switch for 36xx?

In the long run it's best to avoid sprinkiling the cpu_is_omapxxxx
tests as that adds more places to patch when new omap xyz is
added.

> -#define OMAP2420_REV_ES2_0	0x24201024
> +#define OMAP2420_REV_ES1_0	(OMAP242X_CLASS)
> +#define OMAP2420_REV_ES2_0	(OMAP242X_CLASS | (OMAP_REVBITS_01 << 8))

No parens needed around OMAP242X_CLASS if it's just one value.
  
>  #define OMAP243X_CLASS		0x24300024
> -#define OMAP2430_REV_ES1_0	0x24300024
> +#define OMAP2430_REV_ES1_0	(OMAP243X_CLASS)

Not needed around OMAP243X_CLASS either. Please check
the other places too.

Regards,

Tony  

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

end of thread, other threads:[~2010-09-23 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-16 15:53 [PATCH 1/1] omap2/3: Update revision identification Sanjeev Premi
2010-09-03  8:21 ` Premi, Sanjeev
2010-09-23 16:56 ` Tony Lindgren

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).