* RE: [PATCH] Fixed CPU type check for OMAP3
2008-09-08 16:33 Tero Kristo
@ 2008-09-08 14:47 ` Tero.Kristo
0 siblings, 0 replies; 5+ messages in thread
From: Tero.Kristo @ 2008-09-08 14:47 UTC (permalink / raw)
To: linux-omap
Oops, minor bug here, pr_info is still putting out wrong data, should be
from the array I added. Sending new patch soon.
>-----Original Message-----
>From: linux-omap-owner@vger.kernel.org
>[mailto:linux-omap-owner@vger.kernel.org] On Behalf Of ext Tero Kristo
>Sent: 08 September, 2008 19:34
>To: linux-omap@vger.kernel.org
>Subject: [PATCH] Fixed CPU type check for OMAP3
>
>ES version definitions were incorrect, also GP/EMU/SEC etc.
>types were not detected at all.
>
>Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
>---
> arch/arm/mach-omap2/id.c | 9 ++++++++-
> arch/arm/plat-omap/include/mach/cpu.h | 2 +-
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
>diff --git a/arch/arm/mach-omap2/id.c
>b/arch/arm/mach-omap2/id.c index a526c0f..290b88c 100644
>--- a/arch/arm/mach-omap2/id.c
>+++ b/arch/arm/mach-omap2/id.c
>@@ -53,6 +53,13 @@ static struct omap_id omap_ids[] __initdata = {
> { .hawkeye = 0xb68a, .dev = 0x0, .type = 0x24300000 }, };
>
>+static const char omap3_revs[][4] = {
>+ "1.0",
>+ "2.0",
>+ "2.1",
>+ "3.0"
>+};
>+
> static struct omap_chip_id omap_chip;
>
> /**
>@@ -224,7 +231,7 @@ void __init omap2_check_revision(void)
> * Note that rev cannot be used directly as ES1.0 uses value 0.
> */
> if (hawkeye == 0xb7ae) {
>- system_rev = 0x34300000 | ((1 + rev) << 12);
>+ _set_system_rev(0x34300000 | (rev << 12), rev);
> pr_info("OMAP%04x ES2.%i\n", system_rev >> 16, rev);
> _set_omap_chip();
> return;
>diff --git a/arch/arm/plat-omap/include/mach/cpu.h
>b/arch/arm/plat-omap/include/mach/cpu.h
>index e046418..e170d29 100644
>--- a/arch/arm/plat-omap/include/mach/cpu.h
>+++ b/arch/arm/plat-omap/include/mach/cpu.h
>@@ -357,7 +357,7 @@ IS_OMAP_TYPE(3430, 0x3430)
> #define OMAP3430_REV_ES1_0 0x34300000
> #define OMAP3430_REV_ES2_0 0x34301000
> #define OMAP3430_REV_ES2_1 0x34302000
>-#define OMAP3430_REV_ES2_2 0x34303000
>+#define OMAP3430_REV_ES3_0 0x34303000
>
> /*
> * omap_chip bits
>--
>1.5.4.3
>
>--
>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] 5+ messages in thread
* [PATCH] Fixed CPU type check for OMAP3
@ 2008-09-08 16:33 Tero Kristo
2008-09-08 14:47 ` Tero.Kristo
0 siblings, 1 reply; 5+ messages in thread
From: Tero Kristo @ 2008-09-08 16:33 UTC (permalink / raw)
To: linux-omap
ES version definitions were incorrect, also GP/EMU/SEC etc. types were not
detected at all.
Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
---
arch/arm/mach-omap2/id.c | 9 ++++++++-
arch/arm/plat-omap/include/mach/cpu.h | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index a526c0f..290b88c 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -53,6 +53,13 @@ static struct omap_id omap_ids[] __initdata = {
{ .hawkeye = 0xb68a, .dev = 0x0, .type = 0x24300000 },
};
+static const char omap3_revs[][4] = {
+ "1.0",
+ "2.0",
+ "2.1",
+ "3.0"
+};
+
static struct omap_chip_id omap_chip;
/**
@@ -224,7 +231,7 @@ void __init omap2_check_revision(void)
* Note that rev cannot be used directly as ES1.0 uses value 0.
*/
if (hawkeye == 0xb7ae) {
- system_rev = 0x34300000 | ((1 + rev) << 12);
+ _set_system_rev(0x34300000 | (rev << 12), rev);
pr_info("OMAP%04x ES2.%i\n", system_rev >> 16, rev);
_set_omap_chip();
return;
diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/mach/cpu.h
index e046418..e170d29 100644
--- a/arch/arm/plat-omap/include/mach/cpu.h
+++ b/arch/arm/plat-omap/include/mach/cpu.h
@@ -357,7 +357,7 @@ IS_OMAP_TYPE(3430, 0x3430)
#define OMAP3430_REV_ES1_0 0x34300000
#define OMAP3430_REV_ES2_0 0x34301000
#define OMAP3430_REV_ES2_1 0x34302000
-#define OMAP3430_REV_ES2_2 0x34303000
+#define OMAP3430_REV_ES3_0 0x34303000
/*
* omap_chip bits
--
1.5.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] Fixed CPU type check for OMAP3
@ 2008-09-08 16:51 Tero Kristo
2008-09-11 0:29 ` Tony Lindgren
0 siblings, 1 reply; 5+ messages in thread
From: Tero Kristo @ 2008-09-08 16:51 UTC (permalink / raw)
To: linux-omap
ES version definitions were incorrect, also GP/EMU/SEC etc. types were not
detected at all.
Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
---
arch/arm/mach-omap2/id.c | 11 +++++++++--
arch/arm/plat-omap/include/mach/cpu.h | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index a526c0f..290b88c 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -53,6 +53,13 @@ static struct omap_id omap_ids[] __initdata = {
{ .hawkeye = 0xb68a, .dev = 0x0, .type = 0x24300000 },
};
+static const char omap3_revs[][4] = {
+ "1.0",
+ "2.0",
+ "2.1",
+ "3.0"
+};
+
static struct omap_chip_id omap_chip;
/**
@@ -224,7 +231,7 @@ void __init omap2_check_revision(void)
* Note that rev cannot be used directly as ES1.0 uses value 0.
*/
if (hawkeye == 0xb7ae) {
- system_rev = 0x34300000 | ((1 + rev) << 12);
- pr_info("OMAP%04x ES2.%i\n", system_rev >> 16, rev);
+ _set_system_rev(0x34300000 | (rev << 12), rev);
+ pr_info("OMAP%04x ES%s\n", system_rev >> 16, omap3_revs[rev]);
_set_omap_chip();
return;
diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/mach/cpu.h
index e046418..e170d29 100644
--- a/arch/arm/plat-omap/include/mach/cpu.h
+++ b/arch/arm/plat-omap/include/mach/cpu.h
@@ -357,7 +357,7 @@ IS_OMAP_TYPE(3430, 0x3430)
#define OMAP3430_REV_ES1_0 0x34300000
#define OMAP3430_REV_ES2_0 0x34301000
#define OMAP3430_REV_ES2_1 0x34302000
-#define OMAP3430_REV_ES2_2 0x34303000
+#define OMAP3430_REV_ES3_0 0x34303000
/*
* omap_chip bits
--
1.5.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Fixed CPU type check for OMAP3
2008-09-08 16:51 [PATCH] Fixed CPU type check for OMAP3 Tero Kristo
@ 2008-09-11 0:29 ` Tony Lindgren
2008-09-11 8:52 ` Tero.Kristo
0 siblings, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2008-09-11 0:29 UTC (permalink / raw)
To: Tero Kristo; +Cc: linux-omap
* Tero Kristo <tero.kristo@nokia.com> [080908 08:01]:
> ES version definitions were incorrect, also GP/EMU/SEC etc. types were not
> detected at all.
I've redone the id.c, the old one was getting messy for omap2. Maybe
try my patch I posted on Tuesday and see how it works for you?
Also one comment below.
> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
> ---
> arch/arm/mach-omap2/id.c | 11 +++++++++--
> arch/arm/plat-omap/include/mach/cpu.h | 2 +-
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
> index a526c0f..290b88c 100644
> --- a/arch/arm/mach-omap2/id.c
> +++ b/arch/arm/mach-omap2/id.c
> @@ -53,6 +53,13 @@ static struct omap_id omap_ids[] __initdata = {
> { .hawkeye = 0xb68a, .dev = 0x0, .type = 0x24300000 },
> };
>
> +static const char omap3_revs[][4] = {
> + "1.0",
> + "2.0",
> + "2.1",
> + "3.0"
> +};
> +
> static struct omap_chip_id omap_chip;
>
> /**
> @@ -224,7 +231,7 @@ void __init omap2_check_revision(void)
> * Note that rev cannot be used directly as ES1.0 uses value 0.
> */
> if (hawkeye == 0xb7ae) {
> - system_rev = 0x34300000 | ((1 + rev) << 12);
> - pr_info("OMAP%04x ES2.%i\n", system_rev >> 16, rev);
> + _set_system_rev(0x34300000 | (rev << 12), rev);
> + pr_info("OMAP%04x ES%s\n", system_rev >> 16, omap3_revs[rev]);
> _set_omap_chip();
> return;
> diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/mach/cpu.h
> index e046418..e170d29 100644
> --- a/arch/arm/plat-omap/include/mach/cpu.h
> +++ b/arch/arm/plat-omap/include/mach/cpu.h
> @@ -357,7 +357,7 @@ IS_OMAP_TYPE(3430, 0x3430)
> #define OMAP3430_REV_ES1_0 0x34300000
> #define OMAP3430_REV_ES2_0 0x34301000
> #define OMAP3430_REV_ES2_1 0x34302000
> -#define OMAP3430_REV_ES2_2 0x34303000
> +#define OMAP3430_REV_ES3_0 0x34303000
>
> /*
> * omap_chip bits
Are you sure ES3.0 gives a three for revision? I believe 2.2 had 3, or
is the revision register broken again?
Tony
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] Fixed CPU type check for OMAP3
2008-09-11 0:29 ` Tony Lindgren
@ 2008-09-11 8:52 ` Tero.Kristo
0 siblings, 0 replies; 5+ messages in thread
From: Tero.Kristo @ 2008-09-11 8:52 UTC (permalink / raw)
To: tony; +Cc: linux-omap
>From: ext Tony Lindgren [mailto:tony@atomide.com]
>Sent: 11 September, 2008 03:29
>
>I've redone the id.c, the old one was getting messy for omap2.
>Maybe try my patch I posted on Tuesday and see how it works for you?
Hmm did not notice this patch, just made a quick fix for this as I was
seeing some problems with CPU type detection. I need to check this out
when I have more time for this.
>
>Also one comment below.
>> #define OMAP3430_REV_ES1_0 0x34300000
>> #define OMAP3430_REV_ES2_0 0x34301000
>> #define OMAP3430_REV_ES2_1 0x34302000
>> -#define OMAP3430_REV_ES2_2 0x34303000
>> +#define OMAP3430_REV_ES3_0 0x34303000
>>
>> /*
>> * omap_chip bits
>
>Are you sure ES3.0 gives a three for revision? I believe 2.2
>had 3, or is the revision register broken again?
I have tested this piece of code with ES2.1 and ES3.0 and it gives
correct results, so I am certain 3.0 gives a 3 for rev. Regarding 2.2 I
am not so sure, I think such chip revision does not exist at all. There
was also something weird with the earlier code as it increased revision
by 1, thus giving wrong results for any revision... and causing
is_sil_rev_* macros to give incorrect results.
-Tero
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-09-11 8:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-08 16:51 [PATCH] Fixed CPU type check for OMAP3 Tero Kristo
2008-09-11 0:29 ` Tony Lindgren
2008-09-11 8:52 ` Tero.Kristo
-- strict thread matches above, loose matches on Subject: below --
2008-09-08 16:33 Tero Kristo
2008-09-08 14:47 ` Tero.Kristo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox