linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] Fix for Freescale ppc cores: major revision detection
@ 2008-02-11 20:29 Martin Langer
  2008-02-26 10:32 ` Paul Mackerras
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Langer @ 2008-02-11 20:29 UTC (permalink / raw)
  To: linuxppc-dev

On Mon, Feb 11, 2008 at 09:01:03AM -0600, Kumar Gala wrote:
> 
> On Feb 9, 2008, at 11:47 AM, Martin Langer wrote:
> 
> >Ppc cores by Freescale are using the configuration field instead of  
> >the
> >major revision field for their major revision number. Those field
> >definitions come from include/asm-powerpc/reg.h.
> >
> >Look at the pdf below and you will see that PVR_MAJ() does a wrong  
> >shift
> >for ppc cores by Freescale. This patch fixes it.
> >
> >http://www.freescale.com/files/archives/doc/support_info/PPCPVR.pdf
> 
> This doc doesn't encompass the e500/book-e cores that don't follow the  
> same pattern.
> 
> The code should probably be something like:
> 
> #ifdef CONFIG_FSL_BOOKE
> maj = PVR_MAJ(pvr);
> #else
> maj = (pvr >> 8) & 0xff;
> #endif

Thanks for the hint. Inspired by that I did the logic the other way 
round. So we have the same default cases as we had before and 
additionally it will fit for the cores mentioned in the doc.


--- arch/powerpc/kernel/setup-common.c.ORIGINAL	2008-02-08 22:22:56.000000000 +0100
+++ arch/powerpc/kernel/setup-common.c	2008-02-11 20:54:37.000000000 +0100
@@ -241,8 +241,21 @@
 	/* If we are a Freescale core do a simple check so
 	 * we dont have to keep adding cases in the future */
 	if (PVR_VER(pvr) & 0x8000) {
-		maj = PVR_MAJ(pvr);
-		min = PVR_MIN(pvr);
+		switch (PVR_VER(pvr)) {
+			case 0x8000:	/* 7441/7450/7451, Vger */
+			case 0x8001:	/* 7445/7455, Apollo 6 */
+			case 0x8002:	/* 7447/7457, Apollo 7 */
+			case 0x8003:	/* 7447A, Apollo 7 PM */
+			case 0x8004:	/* 7448, Apollo 8 */
+			case 0x800c:	/* 7410, Nitro */
+				maj = ((pvr >> 8) & 0xF);
+				min = PVR_MIN(pvr);
+				break;
+			default:	/* e500/book-e */
+				maj = PVR_MAJ(pvr);
+				min = PVR_MIN(pvr);
+				break;
+		}
 	} else {
 		switch (PVR_VER(pvr)) {
 			case 0x0020:	/* 403 family */

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH] Fix for Freescale ppc cores: major revision detection
@ 2008-02-09 17:47 Martin Langer
  2008-02-11 15:01 ` Kumar Gala
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Langer @ 2008-02-09 17:47 UTC (permalink / raw)
  To: linuxppc-dev

Ppc cores by Freescale are using the configuration field instead of the 
major revision field for their major revision number. Those field 
definitions come from include/asm-powerpc/reg.h.

Look at the pdf below and you will see that PVR_MAJ() does a wrong shift 
for ppc cores by Freescale. This patch fixes it.

http://www.freescale.com/files/archives/doc/support_info/PPCPVR.pdf


Signed-Off-By: Martin Langer <martin-langer@gmx.de>


--- arch/powerpc/kernel/setup-common.c.ORIGINAL	2008-02-08 22:22:56.000000000 +0100
+++ arch/powerpc/kernel/setup-common.c	2008-02-09 18:18:36.000000000 +0100
@@ -241,7 +241,7 @@
 	/* If we are a Freescale core do a simple check so
 	 * we dont have to keep adding cases in the future */
 	if (PVR_VER(pvr) & 0x8000) {
-		maj = PVR_MAJ(pvr);
+		maj = (pvr >> 8) & 0xF;
 		min = PVR_MIN(pvr);
 	} else {
 		switch (PVR_VER(pvr)) {

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

end of thread, other threads:[~2008-02-27 20:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-11 20:29 [PATCH] Fix for Freescale ppc cores: major revision detection Martin Langer
2008-02-26 10:32 ` Paul Mackerras
2008-02-27 20:40   ` Martin Langer
  -- strict thread matches above, loose matches on Subject: below --
2008-02-09 17:47 Martin Langer
2008-02-11 15:01 ` Kumar Gala

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