Subject: PowerPC PVR version bug (G4 etc.)

From: "Matt Sealey" <[email-masked]>
Date: Sun, 30 Oct 2005 17:38:50 -0600

There is a small, innocuous but annoying processor version reporting bug.

/proc/cpuinfo for my 1Ghz 7447 says

revision : 0.1 (pvr 8002 0101)

In fact the processor is version 1.1. You can see it is properly encoded
but the macro used to decode it is (in asm-ppc/reg.h):

#define PVR_MAJ(pvr)	(((pvr) >>  4) & 0xF)	/* Major revision field */
#define PVR_MIN(pvr)	(((pvr) >>  0) & 0xF)	/* Minor revision field */

When Freescale processors are detected, it sets maj and min to the results
of these macros.

Then it prints:

seq_printf(m, "revision\t: %hd.%hd (pvr %04x %04x)\n",
	maj, min, PVR_VER(pvr), PVR_REV(pvr));

Obviously for standalone Freescale processors, at least this is plain wrong;
the correct shift is >> 8 for the major revision field. There is a comment
above the PVR_ macros that this is an IBM encoding scheme, so..

Any chance of a minor fix for this? It will affect every G4 processor ever
made which is a lot of chips in a lot of machines, and for systems that can
use a 7447, 7447A, 7448 there are two or three PVRs (7448 especially which
has a 1.1 and a 2.1 version) that can produce a 0.1 result which may cause
problems if someone accidentally decides to grep that string and ignore the
PVR.

As I said it's innocuous but it's there.

Thanks :)

-- 
Matt Sealey <[email-masked]>
Manager, Genesi, Developer Relations