diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2012-08-19 17:44:01 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-05 01:19:35 -0400 |
commit | d3dbeef657fdc9e870e0b01f811bbb906af052f8 (patch) | |
tree | 85f19e5f69ac6ae8d71bc8d9d6bd6d6ef70a4395 | |
parent | d1cfc0ce5d3196ccd88b9d868bb7cbcab61e0a31 (diff) |
powerpc: Rename 64-bit PVR constants to PVR_foo
We have an old FIXME in reg.h which points out that we should standardise
on PVR_foo for our PVR #defines. Currently we use PVR_ on 32-bit and PV_
on 64-bit.
So do that rename and remove the FIXME.
Seeing as we're touching all but one usage of __is_processor(), rename it
to something less ugly and more indicative of what it does, which is
simply to check the PVR version.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/include/asm/reg.h | 39 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom_init.c | 2 | ||||
-rw-r--r-- | arch/powerpc/oprofile/op_model_power4.c | 16 | ||||
-rw-r--r-- | arch/powerpc/perf/core-book3s.c | 2 | ||||
-rw-r--r-- | drivers/scsi/ipr.c | 18 |
5 files changed, 38 insertions, 39 deletions
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 638608677e2a..43bb15fc899b 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -937,7 +937,7 @@ | |||
937 | #define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */ | 937 | #define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */ |
938 | #define PVR_REV(pvr) (((pvr) >> 0) & 0xFFFF) /* Revison field */ | 938 | #define PVR_REV(pvr) (((pvr) >> 0) & 0xFFFF) /* Revison field */ |
939 | 939 | ||
940 | #define __is_processor(pv) (PVR_VER(mfspr(SPRN_PVR)) == (pv)) | 940 | #define pvr_version_is(pvr) (PVR_VER(mfspr(SPRN_PVR)) == (pvr)) |
941 | 941 | ||
942 | /* | 942 | /* |
943 | * IBM has further subdivided the standard PowerPC 16-bit version and | 943 | * IBM has further subdivided the standard PowerPC 16-bit version and |
@@ -1002,25 +1002,24 @@ | |||
1002 | #define PVR_476_ISS 0x00052000 | 1002 | #define PVR_476_ISS 0x00052000 |
1003 | 1003 | ||
1004 | /* 64-bit processors */ | 1004 | /* 64-bit processors */ |
1005 | /* XXX the prefix should be PVR_, we'll do a global sweep to fix it one day */ | 1005 | #define PVR_NORTHSTAR 0x0033 |
1006 | #define PV_NORTHSTAR 0x0033 | 1006 | #define PVR_PULSAR 0x0034 |
1007 | #define PV_PULSAR 0x0034 | 1007 | #define PVR_POWER4 0x0035 |
1008 | #define PV_POWER4 0x0035 | 1008 | #define PVR_ICESTAR 0x0036 |
1009 | #define PV_ICESTAR 0x0036 | 1009 | #define PVR_SSTAR 0x0037 |
1010 | #define PV_SSTAR 0x0037 | 1010 | #define PVR_POWER4p 0x0038 |
1011 | #define PV_POWER4p 0x0038 | 1011 | #define PVR_970 0x0039 |
1012 | #define PV_970 0x0039 | 1012 | #define PVR_POWER5 0x003A |
1013 | #define PV_POWER5 0x003A | 1013 | #define PVR_POWER5p 0x003B |
1014 | #define PV_POWER5p 0x003B | 1014 | #define PVR_970FX 0x003C |
1015 | #define PV_970FX 0x003C | 1015 | #define PVR_POWER6 0x003E |
1016 | #define PV_POWER6 0x003E | 1016 | #define PVR_POWER7 0x003F |
1017 | #define PV_POWER7 0x003F | 1017 | #define PVR_630 0x0040 |
1018 | #define PV_630 0x0040 | 1018 | #define PVR_630p 0x0041 |
1019 | #define PV_630p 0x0041 | 1019 | #define PVR_970MP 0x0044 |
1020 | #define PV_970MP 0x0044 | 1020 | #define PVR_970GX 0x0045 |
1021 | #define PV_970GX 0x0045 | 1021 | #define PVR_BE 0x0070 |
1022 | #define PV_BE 0x0070 | 1022 | #define PVR_PA6T 0x0090 |
1023 | #define PV_PA6T 0x0090 | ||
1024 | 1023 | ||
1025 | /* Macros for setting and retrieving special purpose registers */ | 1024 | /* Macros for setting and retrieving special purpose registers */ |
1026 | #ifndef __ASSEMBLY__ | 1025 | #ifndef __ASSEMBLY__ |
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 0794a3017b1b..ce68278a5d73 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -1691,7 +1691,7 @@ static void __init prom_initialize_tce_table(void) | |||
1691 | * else will impact performance, so we always allocate 8MB. | 1691 | * else will impact performance, so we always allocate 8MB. |
1692 | * Anton | 1692 | * Anton |
1693 | */ | 1693 | */ |
1694 | if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p)) | 1694 | if (pvr_version_is(PVR_POWER4) || pvr_version_is(PVR_POWER4p)) |
1695 | minsize = 8UL << 20; | 1695 | minsize = 8UL << 20; |
1696 | else | 1696 | else |
1697 | minsize = 4UL << 20; | 1697 | minsize = 4UL << 20; |
diff --git a/arch/powerpc/oprofile/op_model_power4.c b/arch/powerpc/oprofile/op_model_power4.c index 95ae77dec3f6..caffffa5b8f2 100644 --- a/arch/powerpc/oprofile/op_model_power4.c +++ b/arch/powerpc/oprofile/op_model_power4.c | |||
@@ -61,10 +61,10 @@ static int power4_reg_setup(struct op_counter_config *ctr, | |||
61 | else | 61 | else |
62 | mmcr0_val |= MMCR0_PROBLEM_DISABLE; | 62 | mmcr0_val |= MMCR0_PROBLEM_DISABLE; |
63 | 63 | ||
64 | if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p) || | 64 | if (pvr_version_is(PVR_POWER4) || pvr_version_is(PVR_POWER4p) || |
65 | __is_processor(PV_970) || __is_processor(PV_970FX) || | 65 | pvr_version_is(PVR_970) || pvr_version_is(PVR_970FX) || |
66 | __is_processor(PV_970MP) || __is_processor(PV_970GX) || | 66 | pvr_version_is(PVR_970MP) || pvr_version_is(PVR_970GX) || |
67 | __is_processor(PV_POWER5) || __is_processor(PV_POWER5p)) | 67 | pvr_version_is(PVR_POWER5) || pvr_version_is(PVR_POWER5p)) |
68 | use_slot_nums = 1; | 68 | use_slot_nums = 1; |
69 | 69 | ||
70 | return 0; | 70 | return 0; |
@@ -84,9 +84,9 @@ extern void ppc_enable_pmcs(void); | |||
84 | */ | 84 | */ |
85 | static inline int mmcra_must_set_sample(void) | 85 | static inline int mmcra_must_set_sample(void) |
86 | { | 86 | { |
87 | if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p) || | 87 | if (pvr_version_is(PVR_POWER4) || pvr_version_is(PVR_POWER4p) || |
88 | __is_processor(PV_970) || __is_processor(PV_970FX) || | 88 | pvr_version_is(PVR_970) || pvr_version_is(PVR_970FX) || |
89 | __is_processor(PV_970MP) || __is_processor(PV_970GX)) | 89 | pvr_version_is(PVR_970MP) || pvr_version_is(PVR_970GX)) |
90 | return 1; | 90 | return 1; |
91 | 91 | ||
92 | return 0; | 92 | return 0; |
@@ -276,7 +276,7 @@ static bool pmc_overflow(unsigned long val) | |||
276 | * PMCs because a user might set a period of less than 256 and we | 276 | * PMCs because a user might set a period of less than 256 and we |
277 | * don't want to mistakenly reset them. | 277 | * don't want to mistakenly reset them. |
278 | */ | 278 | */ |
279 | if (__is_processor(PV_POWER7) && ((0x80000000 - val) <= 256)) | 279 | if (pvr_version_is(PVR_POWER7) && ((0x80000000 - val) <= 256)) |
280 | return true; | 280 | return true; |
281 | 281 | ||
282 | return false; | 282 | return false; |
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c index 77b49ddda9d3..331cf090857d 100644 --- a/arch/powerpc/perf/core-book3s.c +++ b/arch/powerpc/perf/core-book3s.c | |||
@@ -1396,7 +1396,7 @@ static bool pmc_overflow(unsigned long val) | |||
1396 | * PMCs because a user might set a period of less than 256 and we | 1396 | * PMCs because a user might set a period of less than 256 and we |
1397 | * don't want to mistakenly reset them. | 1397 | * don't want to mistakenly reset them. |
1398 | */ | 1398 | */ |
1399 | if (__is_processor(PV_POWER7) && ((0x80000000 - val) <= 256)) | 1399 | if (pvr_version_is(PVR_POWER7) && ((0x80000000 - val) <= 256)) |
1400 | return true; | 1400 | return true; |
1401 | 1401 | ||
1402 | return false; | 1402 | return false; |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 467dc38246f9..6077c43edacc 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -6304,14 +6304,14 @@ static struct ata_port_info sata_port_info = { | |||
6304 | 6304 | ||
6305 | #ifdef CONFIG_PPC_PSERIES | 6305 | #ifdef CONFIG_PPC_PSERIES |
6306 | static const u16 ipr_blocked_processors[] = { | 6306 | static const u16 ipr_blocked_processors[] = { |
6307 | PV_NORTHSTAR, | 6307 | PVR_NORTHSTAR, |
6308 | PV_PULSAR, | 6308 | PVR_PULSAR, |
6309 | PV_POWER4, | 6309 | PVR_POWER4, |
6310 | PV_ICESTAR, | 6310 | PVR_ICESTAR, |
6311 | PV_SSTAR, | 6311 | PVR_SSTAR, |
6312 | PV_POWER4p, | 6312 | PVR_POWER4p, |
6313 | PV_630, | 6313 | PVR_630, |
6314 | PV_630p | 6314 | PVR_630p |
6315 | }; | 6315 | }; |
6316 | 6316 | ||
6317 | /** | 6317 | /** |
@@ -6331,7 +6331,7 @@ static int ipr_invalid_adapter(struct ipr_ioa_cfg *ioa_cfg) | |||
6331 | 6331 | ||
6332 | if ((ioa_cfg->type == 0x5702) && (ioa_cfg->pdev->revision < 4)) { | 6332 | if ((ioa_cfg->type == 0x5702) && (ioa_cfg->pdev->revision < 4)) { |
6333 | for (i = 0; i < ARRAY_SIZE(ipr_blocked_processors); i++){ | 6333 | for (i = 0; i < ARRAY_SIZE(ipr_blocked_processors); i++){ |
6334 | if (__is_processor(ipr_blocked_processors[i])) | 6334 | if (pvr_version_is(ipr_blocked_processors[i])) |
6335 | return 1; | 6335 | return 1; |
6336 | } | 6336 | } |
6337 | } | 6337 | } |