From patchwork Sun Sep 7 07:51:32 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Langer X-Patchwork-Id: 194 X-Patchwork-Delegate: paulus@samba.org Return-Path: X-Original-To: patchwork@ozlabs.org Delivered-To: patchwork@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id DEF4FDDF10 for ; Sun, 7 Sep 2008 17:52:30 +1000 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by ozlabs.org (Postfix) with SMTP id 220AADDD04 for ; Sun, 7 Sep 2008 17:51:38 +1000 (EST) Received: (qmail invoked by alias); 07 Sep 2008 07:51:34 -0000 Received: from pool-69-134-198-89.dbd-ipconnect.net (EHLO tuba) [89.198.134.69] by mail.gmx.net (mp045) with SMTP; 07 Sep 2008 09:51:34 +0200 X-Authenticated: #2769515 X-Provags-ID: V01U2FsdGVkX18VuG4VHbwVHF0UTgFCv3eipRVLuRYBztYQtIpoiK m9bH9rolT210Ui Received: from ml by tuba with local (Exim 4.50) id 1KcF3U-00010N-HO for linuxppc-dev@ozlabs.org; Sun, 07 Sep 2008 09:51:32 +0200 Date: Sun, 7 Sep 2008 09:51:32 +0200 From: Martin Langer To: linuxppc-dev@ozlabs.org Subject: [PATCH] powerpc: Fix major revision number for Freescale cores Message-ID: <20080907075132.GA3563@tuba> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.9i X-Y-GMX-Trusted: 0 X-FuHaFi: 0.52 X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork=ozlabs.org@ozlabs.org Some 74xx cores by Freescale are using the configuration field instead of the major revision field for their revision number. This patch corrects the wrong behaviour for those ppc cores including my one. There is a reference document at Freecale. It decribes the PVR register. The patch is based on that pdf. You can find the document here: http://www.freescale.com/files/archives/doc/support_info/PPCPVR.pdf Signed-off-by: Martin Langer --- arch/powerpc/kernel/setup-common.c.ORIGINAL 2008-09-06 23:26:50.000000000 +0200 +++ arch/powerpc/kernel/setup-common.c 2008-09-06 23:27:11.000000000 +0200 @@ -254,8 +254,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, Voyager */ + 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 */