]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ppc32: Kill PVR_440* defines
authorTom Rini <trini@kernel.crashing.org>
Fri, 9 Sep 2005 20:01:48 +0000 (13:01 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 9 Sep 2005 20:57:29 +0000 (13:57 -0700)
The following patch changes the usages of PVR_440* into strcmp's with the
cpu_name field, and removes the defines altogether.  The Ebony portion was
briefly tested long ago.  One benefit of moving from PVR-tests to string
tests in general is that not all CPUs can be on and be able to do this type
of comparison.

See http://patchwork.ozlabs.org/linuxppc/patch?id=1250 for the original
thread.

Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc/platforms/4xx/ebony.c
arch/ppc/syslib/ibm440gx_common.c
include/asm-ppc/reg.h

index 0fd3442f51310318ac15c1d954766854067b391e..d6b2b1965dcb30a179689705a1db8d627ac01abe 100644 (file)
@@ -91,15 +91,10 @@ ebony_calibrate_decr(void)
         * on Rev. C silicon then errata forces us to
         * use the internal clock.
         */
-       switch (PVR_REV(mfspr(SPRN_PVR))) {
-               case PVR_REV(PVR_440GP_RB):
-                       freq = EBONY_440GP_RB_SYSCLK;
-                       break;
-               case PVR_REV(PVR_440GP_RC1):
-               default:
-                       freq = EBONY_440GP_RC_SYSCLK;
-                       break;
-       }
+       if (strcmp(cur_cpu_spec[0]->cpu_name, "440GP Rev. B") == 0)
+               freq = EBONY_440GP_RB_SYSCLK;
+       else
+               freq = EBONY_440GP_RC_SYSCLK;
 
        ibm44x_calibrate_decr(freq);
 }
index d4776af6a3ca210a49b519d98bd28ec72e071181..0bb919859b8be862b8cee9dcbba2994fd1caba53 100644 (file)
@@ -236,9 +236,10 @@ void __init ibm440gx_l2c_setup(struct ibm44x_clocks* p)
        /* Disable L2C on rev.A, rev.B and 800MHz version of rev.C,
           enable it on all other revisions
         */
-       u32 pvr = mfspr(SPRN_PVR);
-       if (pvr == PVR_440GX_RA || pvr == PVR_440GX_RB ||
-           (pvr == PVR_440GX_RC && p->cpu > 667000000))
+       if (strcmp(cur_cpu_spec[0]->cpu_name, "440GX Rev. A") == 0 ||
+                       strcmp(cur_cpu_spec[0]->cpu_name, "440GX Rev. B") == 0
+                       || (strcmp(cur_cpu_spec[0]->cpu_name, "440GX Rev. C")
+                               == 0 && p->cpu > 667000000))
                ibm440gx_l2c_disable();
        else
                ibm440gx_l2c_enable();
index 88b4222154d48517cb8ba5e7014a69d306929ccb..73c33e3ef9c6d635a03a439a6b038490d0bd2a3e 100644 (file)
 #define PVR_STB03XXX   0x40310000
 #define PVR_NP405H     0x41410000
 #define PVR_NP405L     0x41610000
-#define PVR_440GP_RB   0x40120440
-#define PVR_440GP_RC1  0x40120481
-#define PVR_440GP_RC2  0x40200481
-#define PVR_440GX_RA   0x51b21850
-#define PVR_440GX_RB   0x51b21851
-#define PVR_440GX_RC   0x51b21892
 #define PVR_601                0x00010000
 #define PVR_602                0x00050000
 #define PVR_603                0x00030000