Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] ppc32: Kill PVR_440* defines

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>

authored by

Tom Rini and committed by
Linus Torvalds
95409aac 66b375bf

+8 -18
+4 -9
arch/ppc/platforms/4xx/ebony.c
··· 91 91 * on Rev. C silicon then errata forces us to 92 92 * use the internal clock. 93 93 */ 94 - switch (PVR_REV(mfspr(SPRN_PVR))) { 95 - case PVR_REV(PVR_440GP_RB): 96 - freq = EBONY_440GP_RB_SYSCLK; 97 - break; 98 - case PVR_REV(PVR_440GP_RC1): 99 - default: 100 - freq = EBONY_440GP_RC_SYSCLK; 101 - break; 102 - } 94 + if (strcmp(cur_cpu_spec[0]->cpu_name, "440GP Rev. B") == 0) 95 + freq = EBONY_440GP_RB_SYSCLK; 96 + else 97 + freq = EBONY_440GP_RC_SYSCLK; 103 98 104 99 ibm44x_calibrate_decr(freq); 105 100 }
+4 -3
arch/ppc/syslib/ibm440gx_common.c
··· 236 236 /* Disable L2C on rev.A, rev.B and 800MHz version of rev.C, 237 237 enable it on all other revisions 238 238 */ 239 - u32 pvr = mfspr(SPRN_PVR); 240 - if (pvr == PVR_440GX_RA || pvr == PVR_440GX_RB || 241 - (pvr == PVR_440GX_RC && p->cpu > 667000000)) 239 + if (strcmp(cur_cpu_spec[0]->cpu_name, "440GX Rev. A") == 0 || 240 + strcmp(cur_cpu_spec[0]->cpu_name, "440GX Rev. B") == 0 241 + || (strcmp(cur_cpu_spec[0]->cpu_name, "440GX Rev. C") 242 + == 0 && p->cpu > 667000000)) 242 243 ibm440gx_l2c_disable(); 243 244 else 244 245 ibm440gx_l2c_enable();
-6
include/asm-ppc/reg.h
··· 366 366 #define PVR_STB03XXX 0x40310000 367 367 #define PVR_NP405H 0x41410000 368 368 #define PVR_NP405L 0x41610000 369 - #define PVR_440GP_RB 0x40120440 370 - #define PVR_440GP_RC1 0x40120481 371 - #define PVR_440GP_RC2 0x40200481 372 - #define PVR_440GX_RA 0x51b21850 373 - #define PVR_440GX_RB 0x51b21851 374 - #define PVR_440GX_RC 0x51b21892 375 369 #define PVR_601 0x00010000 376 370 #define PVR_602 0x00050000 377 371 #define PVR_603 0x00030000