diff options
Diffstat (limited to 'arch/mips')
37 files changed, 401 insertions, 74 deletions
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 75a36ad11ff5..ca8f8340d75f 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
| @@ -288,9 +288,6 @@ endif | |||
| 288 | vmlinux.32: vmlinux | 288 | vmlinux.32: vmlinux |
| 289 | $(OBJCOPY) -O $(32bit-bfd) $(OBJCOPYFLAGS) $< $@ | 289 | $(OBJCOPY) -O $(32bit-bfd) $(OBJCOPYFLAGS) $< $@ |
| 290 | 290 | ||
| 291 | |||
| 292 | #obj-$(CONFIG_KPROBES) += kprobes.o | ||
| 293 | |||
| 294 | # | 291 | # |
| 295 | # The 64-bit ELF tools are pretty broken so at this time we generate 64-bit | 292 | # The 64-bit ELF tools are pretty broken so at this time we generate 64-bit |
| 296 | # ELF files from 32-bit files by conversion. | 293 | # ELF files from 32-bit files by conversion. |
diff --git a/arch/mips/alchemy/common/usb.c b/arch/mips/alchemy/common/usb.c index fcc695626117..2adc7edda49c 100644 --- a/arch/mips/alchemy/common/usb.c +++ b/arch/mips/alchemy/common/usb.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| 15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
| 16 | #include <linux/syscore_ops.h> | 16 | #include <linux/syscore_ops.h> |
| 17 | #include <asm/cpu.h> | ||
| 17 | #include <asm/mach-au1x00/au1000.h> | 18 | #include <asm/mach-au1x00/au1000.h> |
| 18 | 19 | ||
| 19 | /* control register offsets */ | 20 | /* control register offsets */ |
| @@ -358,7 +359,7 @@ static inline int au1200_coherency_bug(void) | |||
| 358 | { | 359 | { |
| 359 | #if defined(CONFIG_DMA_COHERENT) | 360 | #if defined(CONFIG_DMA_COHERENT) |
| 360 | /* Au1200 AB USB does not support coherent memory */ | 361 | /* Au1200 AB USB does not support coherent memory */ |
| 361 | if (!(read_c0_prid() & 0xff)) { | 362 | if (!(read_c0_prid() & PRID_REV_MASK)) { |
| 362 | printk(KERN_INFO "Au1200 USB: this is chip revision AB !!\n"); | 363 | printk(KERN_INFO "Au1200 USB: this is chip revision AB !!\n"); |
| 363 | printk(KERN_INFO "Au1200 USB: update your board or re-configure" | 364 | printk(KERN_INFO "Au1200 USB: update your board or re-configure" |
| 364 | " the kernel\n"); | 365 | " the kernel\n"); |
diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c index 7e17374a9ae8..b713cd64b087 100644 --- a/arch/mips/bcm63xx/cpu.c +++ b/arch/mips/bcm63xx/cpu.c | |||
| @@ -306,14 +306,14 @@ void __init bcm63xx_cpu_init(void) | |||
| 306 | 306 | ||
| 307 | switch (c->cputype) { | 307 | switch (c->cputype) { |
| 308 | case CPU_BMIPS3300: | 308 | case CPU_BMIPS3300: |
| 309 | if ((read_c0_prid() & 0xff00) != PRID_IMP_BMIPS3300_ALT) | 309 | if ((read_c0_prid() & PRID_IMP_MASK) != PRID_IMP_BMIPS3300_ALT) |
| 310 | __cpu_name[cpu] = "Broadcom BCM6338"; | 310 | __cpu_name[cpu] = "Broadcom BCM6338"; |
| 311 | /* fall-through */ | 311 | /* fall-through */ |
| 312 | case CPU_BMIPS32: | 312 | case CPU_BMIPS32: |
| 313 | chipid_reg = BCM_6345_PERF_BASE; | 313 | chipid_reg = BCM_6345_PERF_BASE; |
| 314 | break; | 314 | break; |
| 315 | case CPU_BMIPS4350: | 315 | case CPU_BMIPS4350: |
| 316 | switch ((read_c0_prid() & 0xff)) { | 316 | switch ((read_c0_prid() & PRID_REV_MASK)) { |
| 317 | case 0x04: | 317 | case 0x04: |
| 318 | chipid_reg = BCM_3368_PERF_BASE; | 318 | chipid_reg = BCM_3368_PERF_BASE; |
| 319 | break; | 319 | break; |
diff --git a/arch/mips/boot/dts/include/dt-bindings b/arch/mips/boot/dts/include/dt-bindings index 68ae3887b3e5..08c00e4972fa 120000 --- a/arch/mips/boot/dts/include/dt-bindings +++ b/arch/mips/boot/dts/include/dt-bindings | |||
| @@ -1 +1 @@ | |||
| ../../../../../include/dt-bindings | ../../../../../include/dt-bindings \ No newline at end of file | ||
diff --git a/arch/mips/cavium-octeon/csrc-octeon.c b/arch/mips/cavium-octeon/csrc-octeon.c index 02193953eb9e..b752c4ed0b79 100644 --- a/arch/mips/cavium-octeon/csrc-octeon.c +++ b/arch/mips/cavium-octeon/csrc-octeon.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/smp.h> | 12 | #include <linux/smp.h> |
| 13 | 13 | ||
| 14 | #include <asm/cpu-info.h> | 14 | #include <asm/cpu-info.h> |
| 15 | #include <asm/cpu-type.h> | ||
| 15 | #include <asm/time.h> | 16 | #include <asm/time.h> |
| 16 | 17 | ||
| 17 | #include <asm/octeon/octeon.h> | 18 | #include <asm/octeon/octeon.h> |
diff --git a/arch/mips/dec/prom/init.c b/arch/mips/dec/prom/init.c index ab169046e442..468f665de7bb 100644 --- a/arch/mips/dec/prom/init.c +++ b/arch/mips/dec/prom/init.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | #include <asm/bootinfo.h> | 14 | #include <asm/bootinfo.h> |
| 15 | #include <asm/cpu.h> | 15 | #include <asm/cpu.h> |
| 16 | #include <asm/cpu-type.h> | ||
| 16 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
| 17 | 18 | ||
| 18 | #include <asm/dec/prom.h> | 19 | #include <asm/dec/prom.h> |
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h index fa44f3ec5302..51680d15ca8e 100644 --- a/arch/mips/include/asm/cpu-features.h +++ b/arch/mips/include/asm/cpu-features.h | |||
| @@ -13,12 +13,6 @@ | |||
| 13 | #include <asm/cpu-info.h> | 13 | #include <asm/cpu-info.h> |
| 14 | #include <cpu-feature-overrides.h> | 14 | #include <cpu-feature-overrides.h> |
| 15 | 15 | ||
| 16 | #ifndef current_cpu_type | ||
| 17 | #define current_cpu_type() current_cpu_data.cputype | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #define boot_cpu_type() cpu_data[0].cputype | ||
| 21 | |||
| 22 | /* | 16 | /* |
| 23 | * SMP assumption: Options of CPU 0 are a superset of all processors. | 17 | * SMP assumption: Options of CPU 0 are a superset of all processors. |
| 24 | * This is true for all known MIPS systems. | 18 | * This is true for all known MIPS systems. |
diff --git a/arch/mips/include/asm/cpu-info.h b/arch/mips/include/asm/cpu-info.h index 41401d8eb7d1..21c8e29c8f91 100644 --- a/arch/mips/include/asm/cpu-info.h +++ b/arch/mips/include/asm/cpu-info.h | |||
| @@ -84,6 +84,7 @@ struct cpuinfo_mips { | |||
| 84 | extern struct cpuinfo_mips cpu_data[]; | 84 | extern struct cpuinfo_mips cpu_data[]; |
| 85 | #define current_cpu_data cpu_data[smp_processor_id()] | 85 | #define current_cpu_data cpu_data[smp_processor_id()] |
| 86 | #define raw_current_cpu_data cpu_data[raw_smp_processor_id()] | 86 | #define raw_current_cpu_data cpu_data[raw_smp_processor_id()] |
| 87 | #define boot_cpu_data cpu_data[0] | ||
| 87 | 88 | ||
| 88 | extern void cpu_probe(void); | 89 | extern void cpu_probe(void); |
| 89 | extern void cpu_report(void); | 90 | extern void cpu_report(void); |
diff --git a/arch/mips/include/asm/cpu-type.h b/arch/mips/include/asm/cpu-type.h new file mode 100644 index 000000000000..4a402cc60c03 --- /dev/null +++ b/arch/mips/include/asm/cpu-type.h | |||
| @@ -0,0 +1,203 @@ | |||
| 1 | /* | ||
| 2 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 3 | * License. See the file "COPYING" in the main directory of this archive | ||
| 4 | * for more details. | ||
| 5 | * | ||
| 6 | * Copyright (C) 2003, 2004 Ralf Baechle | ||
| 7 | * Copyright (C) 2004 Maciej W. Rozycki | ||
| 8 | */ | ||
| 9 | #ifndef __ASM_CPU_TYPE_H | ||
| 10 | #define __ASM_CPU_TYPE_H | ||
| 11 | |||
| 12 | #include <linux/smp.h> | ||
| 13 | #include <linux/compiler.h> | ||
| 14 | |||
| 15 | static inline int __pure __get_cpu_type(const int cpu_type) | ||
| 16 | { | ||
| 17 | switch (cpu_type) { | ||
| 18 | #if defined(CONFIG_SYS_HAS_CPU_LOONGSON2E) || \ | ||
| 19 | defined(CONFIG_SYS_HAS_CPU_LOONGSON2F) | ||
| 20 | case CPU_LOONGSON2: | ||
| 21 | #endif | ||
| 22 | |||
| 23 | #ifdef CONFIG_SYS_HAS_CPU_LOONGSON1B | ||
| 24 | case CPU_LOONGSON1: | ||
| 25 | #endif | ||
| 26 | |||
| 27 | #ifdef CONFIG_SYS_HAS_CPU_MIPS32_R1 | ||
| 28 | case CPU_4KC: | ||
| 29 | case CPU_ALCHEMY: | ||
| 30 | case CPU_BMIPS3300: | ||
| 31 | case CPU_BMIPS4350: | ||
| 32 | case CPU_PR4450: | ||
| 33 | case CPU_BMIPS32: | ||
| 34 | case CPU_JZRISC: | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #if defined(CONFIG_SYS_HAS_CPU_MIPS32_R1) || \ | ||
| 38 | defined(CONFIG_SYS_HAS_CPU_MIPS32_R2) | ||
| 39 | case CPU_4KEC: | ||
| 40 | #endif | ||
| 41 | |||
| 42 | #ifdef CONFIG_SYS_HAS_CPU_MIPS32_R2 | ||
| 43 | case CPU_4KSC: | ||
| 44 | case CPU_24K: | ||
| 45 | case CPU_34K: | ||
| 46 | case CPU_1004K: | ||
| 47 | case CPU_74K: | ||
| 48 | case CPU_M14KC: | ||
| 49 | case CPU_M14KEC: | ||
| 50 | #endif | ||
| 51 | |||
| 52 | #ifdef CONFIG_SYS_HAS_CPU_MIPS64_R1 | ||
| 53 | case CPU_5KC: | ||
| 54 | case CPU_5KE: | ||
| 55 | case CPU_20KC: | ||
| 56 | case CPU_25KF: | ||
| 57 | case CPU_SB1: | ||
| 58 | case CPU_SB1A: | ||
| 59 | #endif | ||
| 60 | |||
| 61 | #ifdef CONFIG_SYS_HAS_CPU_MIPS64_R2 | ||
| 62 | /* | ||
| 63 | * All MIPS64 R2 processors have their own special symbols. That is, | ||
| 64 | * there currently is no pure R2 core | ||
| 65 | */ | ||
| 66 | #endif | ||
| 67 | |||
| 68 | #ifdef CONFIG_SYS_HAS_CPU_R3000 | ||
| 69 | case CPU_R2000: | ||
| 70 | case CPU_R3000: | ||
| 71 | case CPU_R3000A: | ||
| 72 | case CPU_R3041: | ||
| 73 | case CPU_R3051: | ||
| 74 | case CPU_R3052: | ||
| 75 | case CPU_R3081: | ||
| 76 | case CPU_R3081E: | ||
| 77 | #endif | ||
| 78 | |||
| 79 | #ifdef CONFIG_SYS_HAS_CPU_TX39XX | ||
| 80 | case CPU_TX3912: | ||
| 81 | case CPU_TX3922: | ||
| 82 | case CPU_TX3927: | ||
| 83 | #endif | ||
| 84 | |||
| 85 | #ifdef CONFIG_SYS_HAS_CPU_VR41XX | ||
| 86 | case CPU_VR41XX: | ||
| 87 | case CPU_VR4111: | ||
| 88 | case CPU_VR4121: | ||
| 89 | case CPU_VR4122: | ||
| 90 | case CPU_VR4131: | ||
| 91 | case CPU_VR4133: | ||
| 92 | case CPU_VR4181: | ||
| 93 | case CPU_VR4181A: | ||
| 94 | #endif | ||
| 95 | |||
| 96 | #ifdef CONFIG_SYS_HAS_CPU_R4300 | ||
| 97 | case CPU_R4300: | ||
| 98 | case CPU_R4310: | ||
| 99 | #endif | ||
| 100 | |||
| 101 | #ifdef CONFIG_SYS_HAS_CPU_R4X00 | ||
| 102 | case CPU_R4000PC: | ||
| 103 | case CPU_R4000SC: | ||
| 104 | case CPU_R4000MC: | ||
| 105 | case CPU_R4200: | ||
| 106 | case CPU_R4400PC: | ||
| 107 | case CPU_R4400SC: | ||
| 108 | case CPU_R4400MC: | ||
| 109 | case CPU_R4600: | ||
| 110 | case CPU_R4700: | ||
| 111 | case CPU_R4640: | ||
| 112 | case CPU_R4650: | ||
| 113 | #endif | ||
| 114 | |||
| 115 | #ifdef CONFIG_SYS_HAS_CPU_TX49XX | ||
| 116 | case CPU_TX49XX: | ||
| 117 | #endif | ||
| 118 | |||
| 119 | #ifdef CONFIG_SYS_HAS_CPU_R5000 | ||
| 120 | case CPU_R5000: | ||
| 121 | #endif | ||
| 122 | |||
| 123 | #ifdef CONFIG_SYS_HAS_CPU_R5432 | ||
| 124 | case CPU_R5432: | ||
| 125 | #endif | ||
| 126 | |||
| 127 | #ifdef CONFIG_SYS_HAS_CPU_R5500 | ||
| 128 | case CPU_R5500: | ||
| 129 | #endif | ||
| 130 | |||
| 131 | #ifdef CONFIG_SYS_HAS_CPU_R6000 | ||
| 132 | case CPU_R6000: | ||
| 133 | case CPU_R6000A: | ||
| 134 | #endif | ||
| 135 | |||
| 136 | #ifdef CONFIG_SYS_HAS_CPU_NEVADA | ||
| 137 | case CPU_NEVADA: | ||
| 138 | #endif | ||
| 139 | |||
| 140 | #ifdef CONFIG_SYS_HAS_CPU_R8000 | ||
| 141 | case CPU_R8000: | ||
| 142 | #endif | ||
| 143 | |||
| 144 | #ifdef CONFIG_SYS_HAS_CPU_R10000 | ||
| 145 | case CPU_R10000: | ||
| 146 | case CPU_R12000: | ||
| 147 | case CPU_R14000: | ||
| 148 | #endif | ||
| 149 | #ifdef CONFIG_SYS_HAS_CPU_RM7000 | ||
| 150 | case CPU_RM7000: | ||
| 151 | case CPU_SR71000: | ||
| 152 | #endif | ||
| 153 | #ifdef CONFIG_SYS_HAS_CPU_RM9000 | ||
| 154 | case CPU_RM9000: | ||
| 155 | #endif | ||
| 156 | #ifdef CONFIG_SYS_HAS_CPU_SB1 | ||
| 157 | case CPU_SB1: | ||
| 158 | case CPU_SB1A: | ||
| 159 | #endif | ||
| 160 | #ifdef CONFIG_SYS_HAS_CPU_CAVIUM_OCTEON | ||
| 161 | case CPU_CAVIUM_OCTEON: | ||
| 162 | case CPU_CAVIUM_OCTEON_PLUS: | ||
| 163 | case CPU_CAVIUM_OCTEON2: | ||
| 164 | #endif | ||
| 165 | |||
| 166 | #ifdef CONFIG_SYS_HAS_CPU_BMIPS4380 | ||
| 167 | case CPU_BMIPS4380: | ||
| 168 | #endif | ||
| 169 | |||
| 170 | #ifdef CONFIG_SYS_HAS_CPU_BMIPS5000 | ||
| 171 | case CPU_BMIPS5000: | ||
| 172 | #endif | ||
| 173 | |||
| 174 | #ifdef CONFIG_SYS_HAS_CPU_XLP | ||
| 175 | case CPU_XLP: | ||
| 176 | #endif | ||
| 177 | |||
| 178 | #ifdef CONFIG_SYS_HAS_CPU_XLR | ||
| 179 | case CPU_XLR: | ||
| 180 | #endif | ||
| 181 | break; | ||
| 182 | default: | ||
| 183 | unreachable(); | ||
| 184 | } | ||
| 185 | |||
| 186 | return cpu_type; | ||
| 187 | } | ||
| 188 | |||
| 189 | static inline int __pure current_cpu_type(void) | ||
| 190 | { | ||
| 191 | const int cpu_type = current_cpu_data.cputype; | ||
| 192 | |||
| 193 | return __get_cpu_type(cpu_type); | ||
| 194 | } | ||
| 195 | |||
| 196 | static inline int __pure boot_cpu_type(void) | ||
| 197 | { | ||
| 198 | const int cpu_type = cpu_data[0].cputype; | ||
| 199 | |||
| 200 | return __get_cpu_type(cpu_type); | ||
| 201 | } | ||
| 202 | |||
| 203 | #endif /* __ASM_CPU_TYPE_H */ | ||
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h index 71b9f1998be7..d2035e16502a 100644 --- a/arch/mips/include/asm/cpu.h +++ b/arch/mips/include/asm/cpu.h | |||
| @@ -3,15 +3,14 @@ | |||
| 3 | * various MIPS cpu types. | 3 | * various MIPS cpu types. |
| 4 | * | 4 | * |
| 5 | * Copyright (C) 1996 David S. Miller (davem@davemloft.net) | 5 | * Copyright (C) 1996 David S. Miller (davem@davemloft.net) |
| 6 | * Copyright (C) 2004 Maciej W. Rozycki | 6 | * Copyright (C) 2004, 2013 Maciej W. Rozycki |
| 7 | */ | 7 | */ |
| 8 | #ifndef _ASM_CPU_H | 8 | #ifndef _ASM_CPU_H |
| 9 | #define _ASM_CPU_H | 9 | #define _ASM_CPU_H |
| 10 | 10 | ||
| 11 | /* Assigned Company values for bits 23:16 of the PRId Register | 11 | /* |
| 12 | (CP0 register 15, select 0). As of the MIPS32 and MIPS64 specs from | 12 | As of the MIPS32 and MIPS64 specs from MTI, the PRId register (CP0 |
| 13 | MTI, the PRId register is defined in this (backwards compatible) | 13 | register 15, select 0) is defined in this (backwards compatible) way: |
| 14 | way: | ||
| 15 | 14 | ||
| 16 | +----------------+----------------+----------------+----------------+ | 15 | +----------------+----------------+----------------+----------------+ |
| 17 | | Company Options| Company ID | Processor ID | Revision | | 16 | | Company Options| Company ID | Processor ID | Revision | |
| @@ -23,6 +22,14 @@ | |||
| 23 | spec. | 22 | spec. |
| 24 | */ | 23 | */ |
| 25 | 24 | ||
| 25 | #define PRID_OPT_MASK 0xff000000 | ||
| 26 | |||
| 27 | /* | ||
| 28 | * Assigned Company values for bits 23:16 of the PRId register. | ||
| 29 | */ | ||
| 30 | |||
| 31 | #define PRID_COMP_MASK 0xff0000 | ||
| 32 | |||
| 26 | #define PRID_COMP_LEGACY 0x000000 | 33 | #define PRID_COMP_LEGACY 0x000000 |
| 27 | #define PRID_COMP_MIPS 0x010000 | 34 | #define PRID_COMP_MIPS 0x010000 |
| 28 | #define PRID_COMP_BROADCOM 0x020000 | 35 | #define PRID_COMP_BROADCOM 0x020000 |
| @@ -38,10 +45,17 @@ | |||
| 38 | #define PRID_COMP_INGENIC 0xd00000 | 45 | #define PRID_COMP_INGENIC 0xd00000 |
| 39 | 46 | ||
| 40 | /* | 47 | /* |
| 41 | * Assigned values for the product ID register. In order to detect a | 48 | * Assigned Processor ID (implementation) values for bits 15:8 of the PRId |
| 42 | * certain CPU type exactly eventually additional registers may need to | 49 | * register. In order to detect a certain CPU type exactly eventually |
| 43 | * be examined. These are valid when 23:16 == PRID_COMP_LEGACY | 50 | * additional registers may need to be examined. |
| 44 | */ | 51 | */ |
| 52 | |||
| 53 | #define PRID_IMP_MASK 0xff00 | ||
| 54 | |||
| 55 | /* | ||
| 56 | * These are valid when 23:16 == PRID_COMP_LEGACY | ||
| 57 | */ | ||
| 58 | |||
| 45 | #define PRID_IMP_R2000 0x0100 | 59 | #define PRID_IMP_R2000 0x0100 |
| 46 | #define PRID_IMP_AU1_REV1 0x0100 | 60 | #define PRID_IMP_AU1_REV1 0x0100 |
| 47 | #define PRID_IMP_AU1_REV2 0x0200 | 61 | #define PRID_IMP_AU1_REV2 0x0200 |
| @@ -182,11 +196,15 @@ | |||
| 182 | #define PRID_IMP_NETLOGIC_XLP2XX 0x1200 | 196 | #define PRID_IMP_NETLOGIC_XLP2XX 0x1200 |
| 183 | 197 | ||
| 184 | /* | 198 | /* |
| 185 | * Definitions for 7:0 on legacy processors | 199 | * Particular Revision values for bits 7:0 of the PRId register. |
| 186 | */ | 200 | */ |
| 187 | 201 | ||
| 188 | #define PRID_REV_MASK 0x00ff | 202 | #define PRID_REV_MASK 0x00ff |
| 189 | 203 | ||
| 204 | /* | ||
| 205 | * Definitions for 7:0 on legacy processors | ||
| 206 | */ | ||
| 207 | |||
| 190 | #define PRID_REV_TX4927 0x0022 | 208 | #define PRID_REV_TX4927 0x0022 |
| 191 | #define PRID_REV_TX4937 0x0030 | 209 | #define PRID_REV_TX4937 0x0030 |
| 192 | #define PRID_REV_R4400 0x0040 | 210 | #define PRID_REV_R4400 0x0040 |
| @@ -227,6 +245,8 @@ | |||
| 227 | * 31 16 15 8 7 0 | 245 | * 31 16 15 8 7 0 |
| 228 | */ | 246 | */ |
| 229 | 247 | ||
| 248 | #define FPIR_IMP_MASK 0xff00 | ||
| 249 | |||
| 230 | #define FPIR_IMP_NONE 0x0000 | 250 | #define FPIR_IMP_NONE 0x0000 |
| 231 | 251 | ||
| 232 | enum cpu_type_enum { | 252 | enum cpu_type_enum { |
diff --git a/arch/mips/include/asm/mach-au1x00/au1000.h b/arch/mips/include/asm/mach-au1x00/au1000.h index 3e11a468cdf8..54f9e84db8ac 100644 --- a/arch/mips/include/asm/mach-au1x00/au1000.h +++ b/arch/mips/include/asm/mach-au1x00/au1000.h | |||
| @@ -43,6 +43,8 @@ | |||
| 43 | #include <linux/io.h> | 43 | #include <linux/io.h> |
| 44 | #include <linux/irq.h> | 44 | #include <linux/irq.h> |
| 45 | 45 | ||
| 46 | #include <asm/cpu.h> | ||
| 47 | |||
| 46 | /* cpu pipeline flush */ | 48 | /* cpu pipeline flush */ |
| 47 | void static inline au_sync(void) | 49 | void static inline au_sync(void) |
| 48 | { | 50 | { |
| @@ -140,7 +142,7 @@ static inline int au1xxx_cpu_needs_config_od(void) | |||
| 140 | 142 | ||
| 141 | static inline int alchemy_get_cputype(void) | 143 | static inline int alchemy_get_cputype(void) |
| 142 | { | 144 | { |
| 143 | switch (read_c0_prid() & 0xffff0000) { | 145 | switch (read_c0_prid() & (PRID_OPT_MASK | PRID_COMP_MASK)) { |
| 144 | case 0x00030000: | 146 | case 0x00030000: |
| 145 | return ALCHEMY_CPU_AU1000; | 147 | return ALCHEMY_CPU_AU1000; |
| 146 | break; | 148 | break; |
diff --git a/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h index f4caacd25552..1bcb6421205e 100644 --- a/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h +++ b/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h | |||
| @@ -8,6 +8,8 @@ | |||
| 8 | #ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H | 8 | #ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H |
| 9 | #define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H | 9 | #define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H |
| 10 | 10 | ||
| 11 | #include <asm/cpu.h> | ||
| 12 | |||
| 11 | /* | 13 | /* |
| 12 | * IP22 with a variety of processors so we can't use defaults for everything. | 14 | * IP22 with a variety of processors so we can't use defaults for everything. |
| 13 | */ | 15 | */ |
diff --git a/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h index 1d2b6ff60d33..d6111aa2e886 100644 --- a/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h +++ b/arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h | |||
| @@ -8,6 +8,8 @@ | |||
| 8 | #ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H | 8 | #ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H |
| 9 | #define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H | 9 | #define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H |
| 10 | 10 | ||
| 11 | #include <asm/cpu.h> | ||
| 12 | |||
| 11 | /* | 13 | /* |
| 12 | * IP27 only comes with R10000 family processors all using the same config | 14 | * IP27 only comes with R10000 family processors all using the same config |
| 13 | */ | 15 | */ |
diff --git a/arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h index 65e9c856390d..4cec06d133db 100644 --- a/arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h +++ b/arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | #ifndef __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H | 9 | #ifndef __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H |
| 10 | #define __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H | 10 | #define __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H |
| 11 | 11 | ||
| 12 | #include <asm/cpu.h> | ||
| 13 | |||
| 12 | /* | 14 | /* |
| 13 | * IP28 only comes with R10000 family processors all using the same config | 15 | * IP28 only comes with R10000 family processors all using the same config |
| 14 | */ | 16 | */ |
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index fed1c3e9b486..e0331414c7d6 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h | |||
| @@ -603,6 +603,13 @@ | |||
| 603 | #define MIPS_CONF4_MMUEXTDEF (_ULCAST_(3) << 14) | 603 | #define MIPS_CONF4_MMUEXTDEF (_ULCAST_(3) << 14) |
| 604 | #define MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT (_ULCAST_(1) << 14) | 604 | #define MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT (_ULCAST_(1) << 14) |
| 605 | 605 | ||
| 606 | #define MIPS_CONF5_NF (_ULCAST_(1) << 0) | ||
| 607 | #define MIPS_CONF5_UFR (_ULCAST_(1) << 2) | ||
| 608 | #define MIPS_CONF5_MSAEN (_ULCAST_(1) << 27) | ||
| 609 | #define MIPS_CONF5_EVA (_ULCAST_(1) << 28) | ||
| 610 | #define MIPS_CONF5_CV (_ULCAST_(1) << 29) | ||
| 611 | #define MIPS_CONF5_K (_ULCAST_(1) << 30) | ||
| 612 | |||
| 606 | #define MIPS_CONF6_SYND (_ULCAST_(1) << 13) | 613 | #define MIPS_CONF6_SYND (_ULCAST_(1) << 13) |
| 607 | 614 | ||
| 608 | #define MIPS_CONF7_WII (_ULCAST_(1) << 31) | 615 | #define MIPS_CONF7_WII (_ULCAST_(1) << 31) |
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h index f194c08bd057..12d6842962be 100644 --- a/arch/mips/include/asm/pci.h +++ b/arch/mips/include/asm/pci.h | |||
| @@ -83,6 +83,18 @@ static inline void pcibios_penalize_isa_irq(int irq, int active) | |||
| 83 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | 83 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, |
| 84 | enum pci_mmap_state mmap_state, int write_combine); | 84 | enum pci_mmap_state mmap_state, int write_combine); |
| 85 | 85 | ||
| 86 | #define HAVE_ARCH_PCI_RESOURCE_TO_USER | ||
| 87 | |||
| 88 | static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, | ||
| 89 | const struct resource *rsrc, resource_size_t *start, | ||
| 90 | resource_size_t *end) | ||
| 91 | { | ||
| 92 | phys_t size = resource_size(rsrc); | ||
| 93 | |||
| 94 | *start = fixup_bigphys_addr(rsrc->start, size); | ||
| 95 | *end = rsrc->start + size; | ||
| 96 | } | ||
| 97 | |||
| 86 | /* | 98 | /* |
| 87 | * Dynamic DMA mapping stuff. | 99 | * Dynamic DMA mapping stuff. |
| 88 | * MIPS has everything mapped statically. | 100 | * MIPS has everything mapped statically. |
diff --git a/arch/mips/include/asm/timex.h b/arch/mips/include/asm/timex.h index 6529704aa73a..c5424757da65 100644 --- a/arch/mips/include/asm/timex.h +++ b/arch/mips/include/asm/timex.h | |||
| @@ -10,7 +10,9 @@ | |||
| 10 | 10 | ||
| 11 | #ifdef __KERNEL__ | 11 | #ifdef __KERNEL__ |
| 12 | 12 | ||
| 13 | #include <asm/cpu-features.h> | ||
| 13 | #include <asm/mipsregs.h> | 14 | #include <asm/mipsregs.h> |
| 15 | #include <asm/cpu-type.h> | ||
| 14 | 16 | ||
| 15 | /* | 17 | /* |
| 16 | * This is the clock rate of the i8253 PIT. A MIPS system may not have | 18 | * This is the clock rate of the i8253 PIT. A MIPS system may not have |
| @@ -33,9 +35,38 @@ | |||
| 33 | 35 | ||
| 34 | typedef unsigned int cycles_t; | 36 | typedef unsigned int cycles_t; |
| 35 | 37 | ||
| 38 | /* | ||
| 39 | * On R4000/R4400 before version 5.0 an erratum exists such that if the | ||
| 40 | * cycle counter is read in the exact moment that it is matching the | ||
| 41 | * compare register, no interrupt will be generated. | ||
| 42 | * | ||
| 43 | * There is a suggested workaround and also the erratum can't strike if | ||
| 44 | * the compare interrupt isn't being used as the clock source device. | ||
| 45 | * However for now the implementaton of this function doesn't get these | ||
| 46 | * fine details right. | ||
| 47 | */ | ||
| 36 | static inline cycles_t get_cycles(void) | 48 | static inline cycles_t get_cycles(void) |
| 37 | { | 49 | { |
| 38 | return 0; | 50 | switch (boot_cpu_type()) { |
| 51 | case CPU_R4400PC: | ||
| 52 | case CPU_R4400SC: | ||
| 53 | case CPU_R4400MC: | ||
| 54 | if ((read_c0_prid() & 0xff) >= 0x0050) | ||
| 55 | return read_c0_count(); | ||
| 56 | break; | ||
| 57 | |||
| 58 | case CPU_R4000PC: | ||
| 59 | case CPU_R4000SC: | ||
| 60 | case CPU_R4000MC: | ||
| 61 | break; | ||
| 62 | |||
| 63 | default: | ||
| 64 | if (cpu_has_counter) | ||
| 65 | return read_c0_count(); | ||
| 66 | break; | ||
| 67 | } | ||
| 68 | |||
| 69 | return 0; /* no usable counter */ | ||
| 39 | } | 70 | } |
| 40 | 71 | ||
| 41 | #endif /* __KERNEL__ */ | 72 | #endif /* __KERNEL__ */ |
diff --git a/arch/mips/include/asm/vga.h b/arch/mips/include/asm/vga.h index f4cff7e4fa8a..f82c83749a08 100644 --- a/arch/mips/include/asm/vga.h +++ b/arch/mips/include/asm/vga.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #ifndef _ASM_VGA_H | 6 | #ifndef _ASM_VGA_H |
| 7 | #define _ASM_VGA_H | 7 | #define _ASM_VGA_H |
| 8 | 8 | ||
| 9 | #include <asm/addrspace.h> | ||
| 9 | #include <asm/byteorder.h> | 10 | #include <asm/byteorder.h> |
| 10 | 11 | ||
| 11 | /* | 12 | /* |
| @@ -13,7 +14,7 @@ | |||
| 13 | * access the videoram directly without any black magic. | 14 | * access the videoram directly without any black magic. |
| 14 | */ | 15 | */ |
| 15 | 16 | ||
| 16 | #define VGA_MAP_MEM(x, s) (0xb0000000L + (unsigned long)(x)) | 17 | #define VGA_MAP_MEM(x, s) CKSEG1ADDR(0x10000000L + (unsigned long)(x)) |
| 17 | 18 | ||
| 18 | #define vga_readb(x) (*(x)) | 19 | #define vga_readb(x) (*(x)) |
| 19 | #define vga_writeb(x, y) (*(y) = (x)) | 20 | #define vga_writeb(x, y) (*(y) = (x)) |
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 37663c7862a5..5465dc183e5a 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | #include <asm/bugs.h> | 21 | #include <asm/bugs.h> |
| 22 | #include <asm/cpu.h> | 22 | #include <asm/cpu.h> |
| 23 | #include <asm/cpu-type.h> | ||
| 23 | #include <asm/fpu.h> | 24 | #include <asm/fpu.h> |
| 24 | #include <asm/mipsregs.h> | 25 | #include <asm/mipsregs.h> |
| 25 | #include <asm/watch.h> | 26 | #include <asm/watch.h> |
| @@ -55,7 +56,7 @@ static inline void check_errata(void) | |||
| 55 | { | 56 | { |
| 56 | struct cpuinfo_mips *c = ¤t_cpu_data; | 57 | struct cpuinfo_mips *c = ¤t_cpu_data; |
| 57 | 58 | ||
| 58 | switch (c->cputype) { | 59 | switch (current_cpu_type()) { |
| 59 | case CPU_34K: | 60 | case CPU_34K: |
| 60 | /* | 61 | /* |
| 61 | * Erratum "RPS May Cause Incorrect Instruction Execution" | 62 | * Erratum "RPS May Cause Incorrect Instruction Execution" |
| @@ -122,7 +123,7 @@ static inline unsigned long cpu_get_fpu_id(void) | |||
| 122 | */ | 123 | */ |
| 123 | static inline int __cpu_has_fpu(void) | 124 | static inline int __cpu_has_fpu(void) |
| 124 | { | 125 | { |
| 125 | return ((cpu_get_fpu_id() & 0xff00) != FPIR_IMP_NONE); | 126 | return ((cpu_get_fpu_id() & FPIR_IMP_MASK) != FPIR_IMP_NONE); |
| 126 | } | 127 | } |
| 127 | 128 | ||
| 128 | static inline void cpu_probe_vmbits(struct cpuinfo_mips *c) | 129 | static inline void cpu_probe_vmbits(struct cpuinfo_mips *c) |
| @@ -290,6 +291,17 @@ static inline unsigned int decode_config4(struct cpuinfo_mips *c) | |||
| 290 | return config4 & MIPS_CONF_M; | 291 | return config4 & MIPS_CONF_M; |
| 291 | } | 292 | } |
| 292 | 293 | ||
| 294 | static inline unsigned int decode_config5(struct cpuinfo_mips *c) | ||
| 295 | { | ||
| 296 | unsigned int config5; | ||
| 297 | |||
| 298 | config5 = read_c0_config5(); | ||
| 299 | config5 &= ~MIPS_CONF5_UFR; | ||
| 300 | write_c0_config5(config5); | ||
| 301 | |||
| 302 | return config5 & MIPS_CONF_M; | ||
| 303 | } | ||
| 304 | |||
| 293 | static void decode_configs(struct cpuinfo_mips *c) | 305 | static void decode_configs(struct cpuinfo_mips *c) |
| 294 | { | 306 | { |
| 295 | int ok; | 307 | int ok; |
| @@ -310,6 +322,8 @@ static void decode_configs(struct cpuinfo_mips *c) | |||
| 310 | ok = decode_config3(c); | 322 | ok = decode_config3(c); |
| 311 | if (ok) | 323 | if (ok) |
| 312 | ok = decode_config4(c); | 324 | ok = decode_config4(c); |
| 325 | if (ok) | ||
| 326 | ok = decode_config5(c); | ||
| 313 | 327 | ||
| 314 | mips_probe_watch_registers(c); | 328 | mips_probe_watch_registers(c); |
| 315 | 329 | ||
| @@ -322,7 +336,7 @@ static void decode_configs(struct cpuinfo_mips *c) | |||
| 322 | 336 | ||
| 323 | static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) | 337 | static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) |
| 324 | { | 338 | { |
| 325 | switch (c->processor_id & 0xff00) { | 339 | switch (c->processor_id & PRID_IMP_MASK) { |
| 326 | case PRID_IMP_R2000: | 340 | case PRID_IMP_R2000: |
| 327 | c->cputype = CPU_R2000; | 341 | c->cputype = CPU_R2000; |
| 328 | __cpu_name[cpu] = "R2000"; | 342 | __cpu_name[cpu] = "R2000"; |
| @@ -333,7 +347,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 333 | c->tlbsize = 64; | 347 | c->tlbsize = 64; |
| 334 | break; | 348 | break; |
| 335 | case PRID_IMP_R3000: | 349 | case PRID_IMP_R3000: |
| 336 | if ((c->processor_id & 0xff) == PRID_REV_R3000A) { | 350 | if ((c->processor_id & PRID_REV_MASK) == PRID_REV_R3000A) { |
| 337 | if (cpu_has_confreg()) { | 351 | if (cpu_has_confreg()) { |
| 338 | c->cputype = CPU_R3081E; | 352 | c->cputype = CPU_R3081E; |
| 339 | __cpu_name[cpu] = "R3081"; | 353 | __cpu_name[cpu] = "R3081"; |
| @@ -353,7 +367,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 353 | break; | 367 | break; |
| 354 | case PRID_IMP_R4000: | 368 | case PRID_IMP_R4000: |
| 355 | if (read_c0_config() & CONF_SC) { | 369 | if (read_c0_config() & CONF_SC) { |
| 356 | if ((c->processor_id & 0xff) >= PRID_REV_R4400) { | 370 | if ((c->processor_id & PRID_REV_MASK) >= |
| 371 | PRID_REV_R4400) { | ||
| 357 | c->cputype = CPU_R4400PC; | 372 | c->cputype = CPU_R4400PC; |
| 358 | __cpu_name[cpu] = "R4400PC"; | 373 | __cpu_name[cpu] = "R4400PC"; |
| 359 | } else { | 374 | } else { |
| @@ -361,7 +376,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 361 | __cpu_name[cpu] = "R4000PC"; | 376 | __cpu_name[cpu] = "R4000PC"; |
| 362 | } | 377 | } |
| 363 | } else { | 378 | } else { |
| 364 | if ((c->processor_id & 0xff) >= PRID_REV_R4400) { | 379 | if ((c->processor_id & PRID_REV_MASK) >= |
| 380 | PRID_REV_R4400) { | ||
| 365 | c->cputype = CPU_R4400SC; | 381 | c->cputype = CPU_R4400SC; |
| 366 | __cpu_name[cpu] = "R4400SC"; | 382 | __cpu_name[cpu] = "R4400SC"; |
| 367 | } else { | 383 | } else { |
| @@ -454,7 +470,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 454 | __cpu_name[cpu] = "TX3927"; | 470 | __cpu_name[cpu] = "TX3927"; |
| 455 | c->tlbsize = 64; | 471 | c->tlbsize = 64; |
| 456 | } else { | 472 | } else { |
| 457 | switch (c->processor_id & 0xff) { | 473 | switch (c->processor_id & PRID_REV_MASK) { |
| 458 | case PRID_REV_TX3912: | 474 | case PRID_REV_TX3912: |
| 459 | c->cputype = CPU_TX3912; | 475 | c->cputype = CPU_TX3912; |
| 460 | __cpu_name[cpu] = "TX3912"; | 476 | __cpu_name[cpu] = "TX3912"; |
| @@ -640,7 +656,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 640 | static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu) | 656 | static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu) |
| 641 | { | 657 | { |
| 642 | decode_configs(c); | 658 | decode_configs(c); |
| 643 | switch (c->processor_id & 0xff00) { | 659 | switch (c->processor_id & PRID_IMP_MASK) { |
| 644 | case PRID_IMP_4KC: | 660 | case PRID_IMP_4KC: |
| 645 | c->cputype = CPU_4KC; | 661 | c->cputype = CPU_4KC; |
| 646 | __cpu_name[cpu] = "MIPS 4Kc"; | 662 | __cpu_name[cpu] = "MIPS 4Kc"; |
| @@ -711,7 +727,7 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 711 | static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu) | 727 | static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu) |
| 712 | { | 728 | { |
| 713 | decode_configs(c); | 729 | decode_configs(c); |
| 714 | switch (c->processor_id & 0xff00) { | 730 | switch (c->processor_id & PRID_IMP_MASK) { |
| 715 | case PRID_IMP_AU1_REV1: | 731 | case PRID_IMP_AU1_REV1: |
| 716 | case PRID_IMP_AU1_REV2: | 732 | case PRID_IMP_AU1_REV2: |
| 717 | c->cputype = CPU_ALCHEMY; | 733 | c->cputype = CPU_ALCHEMY; |
| @@ -730,7 +746,7 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 730 | break; | 746 | break; |
| 731 | case 4: | 747 | case 4: |
| 732 | __cpu_name[cpu] = "Au1200"; | 748 | __cpu_name[cpu] = "Au1200"; |
| 733 | if ((c->processor_id & 0xff) == 2) | 749 | if ((c->processor_id & PRID_REV_MASK) == 2) |
| 734 | __cpu_name[cpu] = "Au1250"; | 750 | __cpu_name[cpu] = "Au1250"; |
| 735 | break; | 751 | break; |
| 736 | case 5: | 752 | case 5: |
| @@ -748,12 +764,12 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 748 | { | 764 | { |
| 749 | decode_configs(c); | 765 | decode_configs(c); |
| 750 | 766 | ||
| 751 | switch (c->processor_id & 0xff00) { | 767 | switch (c->processor_id & PRID_IMP_MASK) { |
| 752 | case PRID_IMP_SB1: | 768 | case PRID_IMP_SB1: |
| 753 | c->cputype = CPU_SB1; | 769 | c->cputype = CPU_SB1; |
| 754 | __cpu_name[cpu] = "SiByte SB1"; | 770 | __cpu_name[cpu] = "SiByte SB1"; |
| 755 | /* FPU in pass1 is known to have issues. */ | 771 | /* FPU in pass1 is known to have issues. */ |
| 756 | if ((c->processor_id & 0xff) < 0x02) | 772 | if ((c->processor_id & PRID_REV_MASK) < 0x02) |
| 757 | c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR); | 773 | c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR); |
| 758 | break; | 774 | break; |
| 759 | case PRID_IMP_SB1A: | 775 | case PRID_IMP_SB1A: |
| @@ -766,7 +782,7 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 766 | static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c, unsigned int cpu) | 782 | static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c, unsigned int cpu) |
| 767 | { | 783 | { |
| 768 | decode_configs(c); | 784 | decode_configs(c); |
| 769 | switch (c->processor_id & 0xff00) { | 785 | switch (c->processor_id & PRID_IMP_MASK) { |
| 770 | case PRID_IMP_SR71000: | 786 | case PRID_IMP_SR71000: |
| 771 | c->cputype = CPU_SR71000; | 787 | c->cputype = CPU_SR71000; |
| 772 | __cpu_name[cpu] = "Sandcraft SR71000"; | 788 | __cpu_name[cpu] = "Sandcraft SR71000"; |
| @@ -779,7 +795,7 @@ static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 779 | static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu) | 795 | static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu) |
| 780 | { | 796 | { |
| 781 | decode_configs(c); | 797 | decode_configs(c); |
| 782 | switch (c->processor_id & 0xff00) { | 798 | switch (c->processor_id & PRID_IMP_MASK) { |
| 783 | case PRID_IMP_PR4450: | 799 | case PRID_IMP_PR4450: |
| 784 | c->cputype = CPU_PR4450; | 800 | c->cputype = CPU_PR4450; |
| 785 | __cpu_name[cpu] = "Philips PR4450"; | 801 | __cpu_name[cpu] = "Philips PR4450"; |
| @@ -791,7 +807,7 @@ static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 791 | static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) | 807 | static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) |
| 792 | { | 808 | { |
| 793 | decode_configs(c); | 809 | decode_configs(c); |
| 794 | switch (c->processor_id & 0xff00) { | 810 | switch (c->processor_id & PRID_IMP_MASK) { |
| 795 | case PRID_IMP_BMIPS32_REV4: | 811 | case PRID_IMP_BMIPS32_REV4: |
| 796 | case PRID_IMP_BMIPS32_REV8: | 812 | case PRID_IMP_BMIPS32_REV8: |
| 797 | c->cputype = CPU_BMIPS32; | 813 | c->cputype = CPU_BMIPS32; |
| @@ -806,7 +822,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 806 | set_elf_platform(cpu, "bmips3300"); | 822 | set_elf_platform(cpu, "bmips3300"); |
| 807 | break; | 823 | break; |
| 808 | case PRID_IMP_BMIPS43XX: { | 824 | case PRID_IMP_BMIPS43XX: { |
| 809 | int rev = c->processor_id & 0xff; | 825 | int rev = c->processor_id & PRID_REV_MASK; |
| 810 | 826 | ||
| 811 | if (rev >= PRID_REV_BMIPS4380_LO && | 827 | if (rev >= PRID_REV_BMIPS4380_LO && |
| 812 | rev <= PRID_REV_BMIPS4380_HI) { | 828 | rev <= PRID_REV_BMIPS4380_HI) { |
| @@ -832,7 +848,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 832 | static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu) | 848 | static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu) |
| 833 | { | 849 | { |
| 834 | decode_configs(c); | 850 | decode_configs(c); |
| 835 | switch (c->processor_id & 0xff00) { | 851 | switch (c->processor_id & PRID_IMP_MASK) { |
| 836 | case PRID_IMP_CAVIUM_CN38XX: | 852 | case PRID_IMP_CAVIUM_CN38XX: |
| 837 | case PRID_IMP_CAVIUM_CN31XX: | 853 | case PRID_IMP_CAVIUM_CN31XX: |
| 838 | case PRID_IMP_CAVIUM_CN30XX: | 854 | case PRID_IMP_CAVIUM_CN30XX: |
| @@ -875,7 +891,7 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu) | |||
| 875 | decode_configs(c); | 891 | decode_configs(c); |
| 876 | /* JZRISC does not implement the CP0 counter. */ | 892 | /* JZRISC does not implement the CP0 counter. */ |
| 877 | c->options &= ~MIPS_CPU_COUNTER; | 893 | c->options &= ~MIPS_CPU_COUNTER; |
| 878 | switch (c->processor_id & 0xff00) { | 894 | switch (c->processor_id & PRID_IMP_MASK) { |
| 879 | case PRID_IMP_JZRISC: | 895 | case PRID_IMP_JZRISC: |
| 880 | c->cputype = CPU_JZRISC; | 896 | c->cputype = CPU_JZRISC; |
| 881 | __cpu_name[cpu] = "Ingenic JZRISC"; | 897 | __cpu_name[cpu] = "Ingenic JZRISC"; |
| @@ -890,7 +906,7 @@ static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu) | |||
| 890 | { | 906 | { |
| 891 | decode_configs(c); | 907 | decode_configs(c); |
| 892 | 908 | ||
| 893 | if ((c->processor_id & 0xff00) == PRID_IMP_NETLOGIC_AU13XX) { | 909 | if ((c->processor_id & PRID_IMP_MASK) == PRID_IMP_NETLOGIC_AU13XX) { |
| 894 | c->cputype = CPU_ALCHEMY; | 910 | c->cputype = CPU_ALCHEMY; |
| 895 | __cpu_name[cpu] = "Au1300"; | 911 | __cpu_name[cpu] = "Au1300"; |
| 896 | /* following stuff is not for Alchemy */ | 912 | /* following stuff is not for Alchemy */ |
| @@ -905,7 +921,7 @@ static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu) | |||
| 905 | MIPS_CPU_EJTAG | | 921 | MIPS_CPU_EJTAG | |
| 906 | MIPS_CPU_LLSC); | 922 | MIPS_CPU_LLSC); |
| 907 | 923 | ||
| 908 | switch (c->processor_id & 0xff00) { | 924 | switch (c->processor_id & PRID_IMP_MASK) { |
| 909 | case PRID_IMP_NETLOGIC_XLP2XX: | 925 | case PRID_IMP_NETLOGIC_XLP2XX: |
| 910 | c->cputype = CPU_XLP; | 926 | c->cputype = CPU_XLP; |
| 911 | __cpu_name[cpu] = "Broadcom XLPII"; | 927 | __cpu_name[cpu] = "Broadcom XLPII"; |
| @@ -984,7 +1000,7 @@ void cpu_probe(void) | |||
| 984 | c->cputype = CPU_UNKNOWN; | 1000 | c->cputype = CPU_UNKNOWN; |
| 985 | 1001 | ||
| 986 | c->processor_id = read_c0_prid(); | 1002 | c->processor_id = read_c0_prid(); |
| 987 | switch (c->processor_id & 0xff0000) { | 1003 | switch (c->processor_id & PRID_COMP_MASK) { |
| 988 | case PRID_COMP_LEGACY: | 1004 | case PRID_COMP_LEGACY: |
| 989 | cpu_probe_legacy(c, cpu); | 1005 | cpu_probe_legacy(c, cpu); |
| 990 | break; | 1006 | break; |
diff --git a/arch/mips/kernel/idle.c b/arch/mips/kernel/idle.c index 42f8875d2444..f7991d95bff9 100644 --- a/arch/mips/kernel/idle.c +++ b/arch/mips/kernel/idle.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/sched.h> | 18 | #include <linux/sched.h> |
| 19 | #include <asm/cpu.h> | 19 | #include <asm/cpu.h> |
| 20 | #include <asm/cpu-info.h> | 20 | #include <asm/cpu-info.h> |
| 21 | #include <asm/cpu-type.h> | ||
| 21 | #include <asm/idle.h> | 22 | #include <asm/idle.h> |
| 22 | #include <asm/mipsregs.h> | 23 | #include <asm/mipsregs.h> |
| 23 | 24 | ||
| @@ -136,7 +137,7 @@ void __init check_wait(void) | |||
| 136 | return; | 137 | return; |
| 137 | } | 138 | } |
| 138 | 139 | ||
| 139 | switch (c->cputype) { | 140 | switch (current_cpu_type()) { |
| 140 | case CPU_R3081: | 141 | case CPU_R3081: |
| 141 | case CPU_R3081E: | 142 | case CPU_R3081E: |
| 142 | cpu_wait = r3081_wait; | 143 | cpu_wait = r3081_wait; |
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index 364d26ae4215..dcb8e5d3bb8a 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/export.h> | 24 | #include <linux/export.h> |
| 25 | 25 | ||
| 26 | #include <asm/cpu-features.h> | 26 | #include <asm/cpu-features.h> |
| 27 | #include <asm/cpu-type.h> | ||
| 27 | #include <asm/div64.h> | 28 | #include <asm/div64.h> |
| 28 | #include <asm/smtc_ipi.h> | 29 | #include <asm/smtc_ipi.h> |
| 29 | #include <asm/time.h> | 30 | #include <asm/time.h> |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index aec3408edd4b..524841f02803 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | #include <asm/break.h> | 39 | #include <asm/break.h> |
| 40 | #include <asm/cop2.h> | 40 | #include <asm/cop2.h> |
| 41 | #include <asm/cpu.h> | 41 | #include <asm/cpu.h> |
| 42 | #include <asm/cpu-type.h> | ||
| 42 | #include <asm/dsp.h> | 43 | #include <asm/dsp.h> |
| 43 | #include <asm/fpu.h> | 44 | #include <asm/fpu.h> |
| 44 | #include <asm/fpu_emulator.h> | 45 | #include <asm/fpu_emulator.h> |
| @@ -622,7 +623,7 @@ static int simulate_rdhwr(struct pt_regs *regs, int rd, int rt) | |||
| 622 | regs->regs[rt] = read_c0_count(); | 623 | regs->regs[rt] = read_c0_count(); |
| 623 | return 0; | 624 | return 0; |
| 624 | case 3: /* Count register resolution */ | 625 | case 3: /* Count register resolution */ |
| 625 | switch (current_cpu_data.cputype) { | 626 | switch (current_cpu_type()) { |
| 626 | case CPU_20KC: | 627 | case CPU_20KC: |
| 627 | case CPU_25KF: | 628 | case CPU_25KF: |
| 628 | regs->regs[rt] = 1; | 629 | regs->regs[rt] = 1; |
diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c index 729e7702b1de..c8efdb5b6ee0 100644 --- a/arch/mips/mm/c-octeon.c +++ b/arch/mips/mm/c-octeon.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <asm/bootinfo.h> | 19 | #include <asm/bootinfo.h> |
| 20 | #include <asm/cacheops.h> | 20 | #include <asm/cacheops.h> |
| 21 | #include <asm/cpu-features.h> | 21 | #include <asm/cpu-features.h> |
| 22 | #include <asm/cpu-type.h> | ||
| 22 | #include <asm/page.h> | 23 | #include <asm/page.h> |
| 23 | #include <asm/pgtable.h> | 24 | #include <asm/pgtable.h> |
| 24 | #include <asm/r4kcache.h> | 25 | #include <asm/r4kcache.h> |
| @@ -186,9 +187,10 @@ static void probe_octeon(void) | |||
| 186 | unsigned long dcache_size; | 187 | unsigned long dcache_size; |
| 187 | unsigned int config1; | 188 | unsigned int config1; |
| 188 | struct cpuinfo_mips *c = ¤t_cpu_data; | 189 | struct cpuinfo_mips *c = ¤t_cpu_data; |
| 190 | int cputype = current_cpu_type(); | ||
| 189 | 191 | ||
| 190 | config1 = read_c0_config1(); | 192 | config1 = read_c0_config1(); |
| 191 | switch (c->cputype) { | 193 | switch (cputype) { |
| 192 | case CPU_CAVIUM_OCTEON: | 194 | case CPU_CAVIUM_OCTEON: |
| 193 | case CPU_CAVIUM_OCTEON_PLUS: | 195 | case CPU_CAVIUM_OCTEON_PLUS: |
| 194 | c->icache.linesz = 2 << ((config1 >> 19) & 7); | 196 | c->icache.linesz = 2 << ((config1 >> 19) & 7); |
| @@ -199,7 +201,7 @@ static void probe_octeon(void) | |||
| 199 | c->icache.sets * c->icache.ways * c->icache.linesz; | 201 | c->icache.sets * c->icache.ways * c->icache.linesz; |
| 200 | c->icache.waybit = ffs(icache_size / c->icache.ways) - 1; | 202 | c->icache.waybit = ffs(icache_size / c->icache.ways) - 1; |
| 201 | c->dcache.linesz = 128; | 203 | c->dcache.linesz = 128; |
| 202 | if (c->cputype == CPU_CAVIUM_OCTEON_PLUS) | 204 | if (cputype == CPU_CAVIUM_OCTEON_PLUS) |
| 203 | c->dcache.sets = 2; /* CN5XXX has two Dcache sets */ | 205 | c->dcache.sets = 2; /* CN5XXX has two Dcache sets */ |
| 204 | else | 206 | else |
| 205 | c->dcache.sets = 1; /* CN3XXX has one Dcache set */ | 207 | c->dcache.sets = 1; /* CN3XXX has one Dcache set */ |
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index f749f687ee87..627883bc6d5f 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/highmem.h> | 12 | #include <linux/highmem.h> |
| 13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 14 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
| 15 | #include <linux/preempt.h> | ||
| 15 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 16 | #include <linux/smp.h> | 17 | #include <linux/smp.h> |
| 17 | #include <linux/mm.h> | 18 | #include <linux/mm.h> |
| @@ -24,6 +25,7 @@ | |||
| 24 | #include <asm/cacheops.h> | 25 | #include <asm/cacheops.h> |
| 25 | #include <asm/cpu.h> | 26 | #include <asm/cpu.h> |
| 26 | #include <asm/cpu-features.h> | 27 | #include <asm/cpu-features.h> |
| 28 | #include <asm/cpu-type.h> | ||
| 27 | #include <asm/io.h> | 29 | #include <asm/io.h> |
| 28 | #include <asm/page.h> | 30 | #include <asm/page.h> |
| 29 | #include <asm/pgtable.h> | 31 | #include <asm/pgtable.h> |
| @@ -601,6 +603,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) | |||
| 601 | /* Catch bad driver code */ | 603 | /* Catch bad driver code */ |
| 602 | BUG_ON(size == 0); | 604 | BUG_ON(size == 0); |
| 603 | 605 | ||
| 606 | preempt_disable(); | ||
| 604 | if (cpu_has_inclusive_pcaches) { | 607 | if (cpu_has_inclusive_pcaches) { |
| 605 | if (size >= scache_size) | 608 | if (size >= scache_size) |
| 606 | r4k_blast_scache(); | 609 | r4k_blast_scache(); |
| @@ -621,6 +624,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) | |||
| 621 | R4600_HIT_CACHEOP_WAR_IMPL; | 624 | R4600_HIT_CACHEOP_WAR_IMPL; |
| 622 | blast_dcache_range(addr, addr + size); | 625 | blast_dcache_range(addr, addr + size); |
| 623 | } | 626 | } |
| 627 | preempt_enable(); | ||
| 624 | 628 | ||
| 625 | bc_wback_inv(addr, size); | 629 | bc_wback_inv(addr, size); |
| 626 | __sync(); | 630 | __sync(); |
| @@ -631,6 +635,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) | |||
| 631 | /* Catch bad driver code */ | 635 | /* Catch bad driver code */ |
| 632 | BUG_ON(size == 0); | 636 | BUG_ON(size == 0); |
| 633 | 637 | ||
| 638 | preempt_disable(); | ||
| 634 | if (cpu_has_inclusive_pcaches) { | 639 | if (cpu_has_inclusive_pcaches) { |
| 635 | if (size >= scache_size) | 640 | if (size >= scache_size) |
| 636 | r4k_blast_scache(); | 641 | r4k_blast_scache(); |
| @@ -655,6 +660,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) | |||
| 655 | R4600_HIT_CACHEOP_WAR_IMPL; | 660 | R4600_HIT_CACHEOP_WAR_IMPL; |
| 656 | blast_inv_dcache_range(addr, addr + size); | 661 | blast_inv_dcache_range(addr, addr + size); |
| 657 | } | 662 | } |
| 663 | preempt_enable(); | ||
| 658 | 664 | ||
| 659 | bc_inv(addr, size); | 665 | bc_inv(addr, size); |
| 660 | __sync(); | 666 | __sync(); |
| @@ -780,20 +786,30 @@ static inline void rm7k_erratum31(void) | |||
| 780 | 786 | ||
| 781 | static inline void alias_74k_erratum(struct cpuinfo_mips *c) | 787 | static inline void alias_74k_erratum(struct cpuinfo_mips *c) |
| 782 | { | 788 | { |
| 789 | unsigned int imp = c->processor_id & PRID_IMP_MASK; | ||
| 790 | unsigned int rev = c->processor_id & PRID_REV_MASK; | ||
| 791 | |||
| 783 | /* | 792 | /* |
| 784 | * Early versions of the 74K do not update the cache tags on a | 793 | * Early versions of the 74K do not update the cache tags on a |
| 785 | * vtag miss/ptag hit which can occur in the case of KSEG0/KUSEG | 794 | * vtag miss/ptag hit which can occur in the case of KSEG0/KUSEG |
| 786 | * aliases. In this case it is better to treat the cache as always | 795 | * aliases. In this case it is better to treat the cache as always |
| 787 | * having aliases. | 796 | * having aliases. |
| 788 | */ | 797 | */ |
| 789 | if ((c->processor_id & 0xff) <= PRID_REV_ENCODE_332(2, 4, 0)) | 798 | switch (imp) { |
| 790 | c->dcache.flags |= MIPS_CACHE_VTAG; | 799 | case PRID_IMP_74K: |
| 791 | if ((c->processor_id & 0xff) == PRID_REV_ENCODE_332(2, 4, 0)) | 800 | if (rev <= PRID_REV_ENCODE_332(2, 4, 0)) |
| 792 | write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND); | 801 | c->dcache.flags |= MIPS_CACHE_VTAG; |
| 793 | if (((c->processor_id & 0xff00) == PRID_IMP_1074K) && | 802 | if (rev == PRID_REV_ENCODE_332(2, 4, 0)) |
| 794 | ((c->processor_id & 0xff) <= PRID_REV_ENCODE_332(1, 1, 0))) { | 803 | write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND); |
| 795 | c->dcache.flags |= MIPS_CACHE_VTAG; | 804 | break; |
| 796 | write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND); | 805 | case PRID_IMP_1074K: |
| 806 | if (rev <= PRID_REV_ENCODE_332(1, 1, 0)) { | ||
| 807 | c->dcache.flags |= MIPS_CACHE_VTAG; | ||
| 808 | write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND); | ||
| 809 | } | ||
| 810 | break; | ||
| 811 | default: | ||
| 812 | BUG(); | ||
| 797 | } | 813 | } |
| 798 | } | 814 | } |
| 799 | 815 | ||
| @@ -809,7 +825,7 @@ static void probe_pcache(void) | |||
| 809 | unsigned long config1; | 825 | unsigned long config1; |
| 810 | unsigned int lsize; | 826 | unsigned int lsize; |
| 811 | 827 | ||
| 812 | switch (c->cputype) { | 828 | switch (current_cpu_type()) { |
| 813 | case CPU_R4600: /* QED style two way caches? */ | 829 | case CPU_R4600: /* QED style two way caches? */ |
| 814 | case CPU_R4700: | 830 | case CPU_R4700: |
| 815 | case CPU_R5000: | 831 | case CPU_R5000: |
| @@ -1025,7 +1041,8 @@ static void probe_pcache(void) | |||
| 1025 | * presumably no vendor is shipping his hardware in the "bad" | 1041 | * presumably no vendor is shipping his hardware in the "bad" |
| 1026 | * configuration. | 1042 | * configuration. |
| 1027 | */ | 1043 | */ |
| 1028 | if ((prid & 0xff00) == PRID_IMP_R4000 && (prid & 0xff) < 0x40 && | 1044 | if ((prid & PRID_IMP_MASK) == PRID_IMP_R4000 && |
| 1045 | (prid & PRID_REV_MASK) < PRID_REV_R4400 && | ||
| 1029 | !(config & CONF_SC) && c->icache.linesz != 16 && | 1046 | !(config & CONF_SC) && c->icache.linesz != 16 && |
| 1030 | PAGE_SIZE <= 0x8000) | 1047 | PAGE_SIZE <= 0x8000) |
| 1031 | panic("Improper R4000SC processor configuration detected"); | 1048 | panic("Improper R4000SC processor configuration detected"); |
| @@ -1045,7 +1062,7 @@ static void probe_pcache(void) | |||
| 1045 | * normally they'd suffer from aliases but magic in the hardware deals | 1062 | * normally they'd suffer from aliases but magic in the hardware deals |
| 1046 | * with that for us so we don't need to take care ourselves. | 1063 | * with that for us so we don't need to take care ourselves. |
| 1047 | */ | 1064 | */ |
| 1048 | switch (c->cputype) { | 1065 | switch (current_cpu_type()) { |
| 1049 | case CPU_20KC: | 1066 | case CPU_20KC: |
| 1050 | case CPU_25KF: | 1067 | case CPU_25KF: |
| 1051 | case CPU_SB1: | 1068 | case CPU_SB1: |
| @@ -1065,7 +1082,7 @@ static void probe_pcache(void) | |||
| 1065 | case CPU_34K: | 1082 | case CPU_34K: |
| 1066 | case CPU_74K: | 1083 | case CPU_74K: |
| 1067 | case CPU_1004K: | 1084 | case CPU_1004K: |
| 1068 | if (c->cputype == CPU_74K) | 1085 | if (current_cpu_type() == CPU_74K) |
| 1069 | alias_74k_erratum(c); | 1086 | alias_74k_erratum(c); |
| 1070 | if ((read_c0_config7() & (1 << 16))) { | 1087 | if ((read_c0_config7() & (1 << 16))) { |
| 1071 | /* effectively physically indexed dcache, | 1088 | /* effectively physically indexed dcache, |
| @@ -1078,7 +1095,7 @@ static void probe_pcache(void) | |||
| 1078 | c->dcache.flags |= MIPS_CACHE_ALIASES; | 1095 | c->dcache.flags |= MIPS_CACHE_ALIASES; |
| 1079 | } | 1096 | } |
| 1080 | 1097 | ||
| 1081 | switch (c->cputype) { | 1098 | switch (current_cpu_type()) { |
| 1082 | case CPU_20KC: | 1099 | case CPU_20KC: |
| 1083 | /* | 1100 | /* |
| 1084 | * Some older 20Kc chips doesn't have the 'VI' bit in | 1101 | * Some older 20Kc chips doesn't have the 'VI' bit in |
| @@ -1207,7 +1224,7 @@ static void setup_scache(void) | |||
| 1207 | * processors don't have a S-cache that would be relevant to the | 1224 | * processors don't have a S-cache that would be relevant to the |
| 1208 | * Linux memory management. | 1225 | * Linux memory management. |
| 1209 | */ | 1226 | */ |
| 1210 | switch (c->cputype) { | 1227 | switch (current_cpu_type()) { |
| 1211 | case CPU_R4000SC: | 1228 | case CPU_R4000SC: |
| 1212 | case CPU_R4000MC: | 1229 | case CPU_R4000MC: |
| 1213 | case CPU_R4400SC: | 1230 | case CPU_R4400SC: |
| @@ -1384,9 +1401,8 @@ static void r4k_cache_error_setup(void) | |||
| 1384 | { | 1401 | { |
| 1385 | extern char __weak except_vec2_generic; | 1402 | extern char __weak except_vec2_generic; |
| 1386 | extern char __weak except_vec2_sb1; | 1403 | extern char __weak except_vec2_sb1; |
| 1387 | struct cpuinfo_mips *c = ¤t_cpu_data; | ||
| 1388 | 1404 | ||
| 1389 | switch (c->cputype) { | 1405 | switch (current_cpu_type()) { |
| 1390 | case CPU_SB1: | 1406 | case CPU_SB1: |
| 1391 | case CPU_SB1A: | 1407 | case CPU_SB1A: |
| 1392 | set_uncached_handler(0x100, &except_vec2_sb1, 0x80); | 1408 | set_uncached_handler(0x100, &except_vec2_sb1, 0x80); |
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c index 664e523653d0..f25a7e9f8cbc 100644 --- a/arch/mips/mm/dma-default.c +++ b/arch/mips/mm/dma-default.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/highmem.h> | 18 | #include <linux/highmem.h> |
| 19 | 19 | ||
| 20 | #include <asm/cache.h> | 20 | #include <asm/cache.h> |
| 21 | #include <asm/cpu-type.h> | ||
| 21 | #include <asm/io.h> | 22 | #include <asm/io.h> |
| 22 | 23 | ||
| 23 | #include <dma-coherence.h> | 24 | #include <dma-coherence.h> |
diff --git a/arch/mips/mm/page.c b/arch/mips/mm/page.c index 218c2109a55d..cbd81d17793a 100644 --- a/arch/mips/mm/page.c +++ b/arch/mips/mm/page.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | #include <asm/bugs.h> | 19 | #include <asm/bugs.h> |
| 20 | #include <asm/cacheops.h> | 20 | #include <asm/cacheops.h> |
| 21 | #include <asm/cpu-type.h> | ||
| 21 | #include <asm/inst.h> | 22 | #include <asm/inst.h> |
| 22 | #include <asm/io.h> | 23 | #include <asm/io.h> |
| 23 | #include <asm/page.h> | 24 | #include <asm/page.h> |
diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c index 5d01392e3518..08d05aee8788 100644 --- a/arch/mips/mm/sc-mips.c +++ b/arch/mips/mm/sc-mips.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
| 7 | #include <linux/mm.h> | 7 | #include <linux/mm.h> |
| 8 | 8 | ||
| 9 | #include <asm/cpu-type.h> | ||
| 9 | #include <asm/mipsregs.h> | 10 | #include <asm/mipsregs.h> |
| 10 | #include <asm/bcache.h> | 11 | #include <asm/bcache.h> |
| 11 | #include <asm/cacheops.h> | 12 | #include <asm/cacheops.h> |
| @@ -71,7 +72,7 @@ static inline int mips_sc_is_activated(struct cpuinfo_mips *c) | |||
| 71 | unsigned int tmp; | 72 | unsigned int tmp; |
| 72 | 73 | ||
| 73 | /* Check the bypass bit (L2B) */ | 74 | /* Check the bypass bit (L2B) */ |
| 74 | switch (c->cputype) { | 75 | switch (current_cpu_type()) { |
| 75 | case CPU_34K: | 76 | case CPU_34K: |
| 76 | case CPU_74K: | 77 | case CPU_74K: |
| 77 | case CPU_1004K: | 78 | case CPU_1004K: |
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c index 00b26a67a06d..bb3a5f643e97 100644 --- a/arch/mips/mm/tlb-r4k.c +++ b/arch/mips/mm/tlb-r4k.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
| 17 | 17 | ||
| 18 | #include <asm/cpu.h> | 18 | #include <asm/cpu.h> |
| 19 | #include <asm/cpu-type.h> | ||
| 19 | #include <asm/bootinfo.h> | 20 | #include <asm/bootinfo.h> |
| 20 | #include <asm/mmu_context.h> | 21 | #include <asm/mmu_context.h> |
| 21 | #include <asm/pgtable.h> | 22 | #include <asm/pgtable.h> |
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 821b45175dc1..9bb3a9363b06 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/cache.h> | 30 | #include <linux/cache.h> |
| 31 | 31 | ||
| 32 | #include <asm/cacheflush.h> | 32 | #include <asm/cacheflush.h> |
| 33 | #include <asm/cpu-type.h> | ||
| 33 | #include <asm/pgtable.h> | 34 | #include <asm/pgtable.h> |
| 34 | #include <asm/war.h> | 35 | #include <asm/war.h> |
| 35 | #include <asm/uasm.h> | 36 | #include <asm/uasm.h> |
diff --git a/arch/mips/mti-malta/malta-time.c b/arch/mips/mti-malta/malta-time.c index 53aad4a35375..a18af5fce67e 100644 --- a/arch/mips/mti-malta/malta-time.c +++ b/arch/mips/mti-malta/malta-time.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/timex.h> | 27 | #include <linux/timex.h> |
| 28 | #include <linux/mc146818rtc.h> | 28 | #include <linux/mc146818rtc.h> |
| 29 | 29 | ||
| 30 | #include <asm/cpu.h> | ||
| 30 | #include <asm/mipsregs.h> | 31 | #include <asm/mipsregs.h> |
| 31 | #include <asm/mipsmtregs.h> | 32 | #include <asm/mipsmtregs.h> |
| 32 | #include <asm/hardirq.h> | 33 | #include <asm/hardirq.h> |
| @@ -76,7 +77,7 @@ static void __init estimate_frequencies(void) | |||
| 76 | #endif | 77 | #endif |
| 77 | 78 | ||
| 78 | #if defined (CONFIG_KVM_GUEST) && defined (CONFIG_KVM_HOST_FREQ) | 79 | #if defined (CONFIG_KVM_GUEST) && defined (CONFIG_KVM_HOST_FREQ) |
| 79 | unsigned int prid = read_c0_prid() & 0xffff00; | 80 | unsigned int prid = read_c0_prid() & (PRID_COMP_MASK | PRID_IMP_MASK); |
| 80 | 81 | ||
| 81 | /* | 82 | /* |
| 82 | * XXXKYMA: hardwire the CPU frequency to Host Freq/4 | 83 | * XXXKYMA: hardwire the CPU frequency to Host Freq/4 |
| @@ -169,7 +170,7 @@ unsigned int get_c0_compare_int(void) | |||
| 169 | 170 | ||
| 170 | void __init plat_time_init(void) | 171 | void __init plat_time_init(void) |
| 171 | { | 172 | { |
| 172 | unsigned int prid = read_c0_prid() & 0xffff00; | 173 | unsigned int prid = read_c0_prid() & (PRID_COMP_MASK | PRID_IMP_MASK); |
| 173 | unsigned int freq; | 174 | unsigned int freq; |
| 174 | 175 | ||
| 175 | estimate_frequencies(); | 176 | estimate_frequencies(); |
diff --git a/arch/mips/mti-sead3/sead3-time.c b/arch/mips/mti-sead3/sead3-time.c index a43ea3cc0a3b..552d26c34386 100644 --- a/arch/mips/mti-sead3/sead3-time.c +++ b/arch/mips/mti-sead3/sead3-time.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | */ | 7 | */ |
| 8 | #include <linux/init.h> | 8 | #include <linux/init.h> |
| 9 | 9 | ||
| 10 | #include <asm/cpu.h> | ||
| 10 | #include <asm/setup.h> | 11 | #include <asm/setup.h> |
| 11 | #include <asm/time.h> | 12 | #include <asm/time.h> |
| 12 | #include <asm/irq.h> | 13 | #include <asm/irq.h> |
| @@ -34,7 +35,7 @@ static void __iomem *status_reg = (void __iomem *)0xbf000410; | |||
| 34 | */ | 35 | */ |
| 35 | static unsigned int __init estimate_cpu_frequency(void) | 36 | static unsigned int __init estimate_cpu_frequency(void) |
| 36 | { | 37 | { |
| 37 | unsigned int prid = read_c0_prid() & 0xffff00; | 38 | unsigned int prid = read_c0_prid() & (PRID_COMP_MASK | PRID_IMP_MASK); |
| 38 | unsigned int tick = 0; | 39 | unsigned int tick = 0; |
| 39 | unsigned int freq; | 40 | unsigned int freq; |
| 40 | unsigned int orig; | 41 | unsigned int orig; |
diff --git a/arch/mips/netlogic/xlr/fmn-config.c b/arch/mips/netlogic/xlr/fmn-config.c index ed3bf0e3f309..c7622c6e5f67 100644 --- a/arch/mips/netlogic/xlr/fmn-config.c +++ b/arch/mips/netlogic/xlr/fmn-config.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/irq.h> | 36 | #include <linux/irq.h> |
| 37 | #include <linux/interrupt.h> | 37 | #include <linux/interrupt.h> |
| 38 | 38 | ||
| 39 | #include <asm/cpu.h> | ||
| 39 | #include <asm/mipsregs.h> | 40 | #include <asm/mipsregs.h> |
| 40 | #include <asm/netlogic/xlr/fmn.h> | 41 | #include <asm/netlogic/xlr/fmn.h> |
| 41 | #include <asm/netlogic/xlr/xlr.h> | 42 | #include <asm/netlogic/xlr/xlr.h> |
| @@ -187,7 +188,7 @@ void xlr_board_info_setup(void) | |||
| 187 | int processor_id, num_core; | 188 | int processor_id, num_core; |
| 188 | 189 | ||
| 189 | num_core = hweight32(nlm_current_node()->coremask); | 190 | num_core = hweight32(nlm_current_node()->coremask); |
| 190 | processor_id = read_c0_prid() & 0xff00; | 191 | processor_id = read_c0_prid() & PRID_IMP_MASK; |
| 191 | 192 | ||
| 192 | setup_cpu_fmninfo(cpu, num_core); | 193 | setup_cpu_fmninfo(cpu, num_core); |
| 193 | switch (processor_id) { | 194 | switch (processor_id) { |
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c index 5e5424753b56..4d1736fc1955 100644 --- a/arch/mips/oprofile/common.c +++ b/arch/mips/oprofile/common.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/oprofile.h> | 12 | #include <linux/oprofile.h> |
| 13 | #include <linux/smp.h> | 13 | #include <linux/smp.h> |
| 14 | #include <asm/cpu-info.h> | 14 | #include <asm/cpu-info.h> |
| 15 | #include <asm/cpu-type.h> | ||
| 15 | 16 | ||
| 16 | #include "op_impl.h" | 17 | #include "op_impl.h" |
| 17 | 18 | ||
diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c index 44dd5aa2e36f..5ec2a7bae02c 100644 --- a/arch/mips/pci/pci-bcm1480.c +++ b/arch/mips/pci/pci-bcm1480.c | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | #include <linux/mm.h> | 39 | #include <linux/mm.h> |
| 40 | #include <linux/console.h> | 40 | #include <linux/console.h> |
| 41 | #include <linux/tty.h> | 41 | #include <linux/tty.h> |
| 42 | #include <linux/vt.h> | ||
| 42 | 43 | ||
| 43 | #include <asm/sibyte/bcm1480_regs.h> | 44 | #include <asm/sibyte/bcm1480_regs.h> |
| 44 | #include <asm/sibyte/bcm1480_scd.h> | 45 | #include <asm/sibyte/bcm1480_scd.h> |
diff --git a/arch/mips/sibyte/bcm1480/setup.c b/arch/mips/sibyte/bcm1480/setup.c index 05ed92c92b69..8e2e04f77870 100644 --- a/arch/mips/sibyte/bcm1480/setup.c +++ b/arch/mips/sibyte/bcm1480/setup.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/string.h> | 22 | #include <linux/string.h> |
| 23 | 23 | ||
| 24 | #include <asm/bootinfo.h> | 24 | #include <asm/bootinfo.h> |
| 25 | #include <asm/cpu.h> | ||
| 25 | #include <asm/mipsregs.h> | 26 | #include <asm/mipsregs.h> |
| 26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
| 27 | #include <asm/sibyte/sb1250.h> | 28 | #include <asm/sibyte/sb1250.h> |
| @@ -119,7 +120,7 @@ void __init bcm1480_setup(void) | |||
| 119 | uint64_t sys_rev; | 120 | uint64_t sys_rev; |
| 120 | int plldiv; | 121 | int plldiv; |
| 121 | 122 | ||
| 122 | sb1_pass = read_c0_prid() & 0xff; | 123 | sb1_pass = read_c0_prid() & PRID_REV_MASK; |
| 123 | sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION)); | 124 | sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION)); |
| 124 | soc_type = SYS_SOC_TYPE(sys_rev); | 125 | soc_type = SYS_SOC_TYPE(sys_rev); |
| 125 | part_type = G_SYS_PART(sys_rev); | 126 | part_type = G_SYS_PART(sys_rev); |
diff --git a/arch/mips/sibyte/sb1250/setup.c b/arch/mips/sibyte/sb1250/setup.c index a14bd4cb0bc0..3c02b2a77ae9 100644 --- a/arch/mips/sibyte/sb1250/setup.c +++ b/arch/mips/sibyte/sb1250/setup.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/string.h> | 22 | #include <linux/string.h> |
| 23 | 23 | ||
| 24 | #include <asm/bootinfo.h> | 24 | #include <asm/bootinfo.h> |
| 25 | #include <asm/cpu.h> | ||
| 25 | #include <asm/mipsregs.h> | 26 | #include <asm/mipsregs.h> |
| 26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
| 27 | #include <asm/sibyte/sb1250.h> | 28 | #include <asm/sibyte/sb1250.h> |
| @@ -182,7 +183,7 @@ void __init sb1250_setup(void) | |||
| 182 | int plldiv; | 183 | int plldiv; |
| 183 | int bad_config = 0; | 184 | int bad_config = 0; |
| 184 | 185 | ||
| 185 | sb1_pass = read_c0_prid() & 0xff; | 186 | sb1_pass = read_c0_prid() & PRID_REV_MASK; |
| 186 | sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION)); | 187 | sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION)); |
| 187 | soc_type = SYS_SOC_TYPE(sys_rev); | 188 | soc_type = SYS_SOC_TYPE(sys_rev); |
| 188 | soc_pass = G_SYS_REVISION(sys_rev); | 189 | soc_pass = G_SYS_REVISION(sys_rev); |
diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c index 5b09b3544edd..efad85c8c823 100644 --- a/arch/mips/sni/setup.c +++ b/arch/mips/sni/setup.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #endif | 25 | #endif |
| 26 | 26 | ||
| 27 | #include <asm/bootinfo.h> | 27 | #include <asm/bootinfo.h> |
| 28 | #include <asm/cpu.h> | ||
| 28 | #include <asm/io.h> | 29 | #include <asm/io.h> |
| 29 | #include <asm/reboot.h> | 30 | #include <asm/reboot.h> |
| 30 | #include <asm/sni.h> | 31 | #include <asm/sni.h> |
| @@ -173,7 +174,7 @@ void __init plat_mem_setup(void) | |||
| 173 | system_type = "RM300-Cxx"; | 174 | system_type = "RM300-Cxx"; |
| 174 | break; | 175 | break; |
| 175 | case SNI_BRD_PCI_DESKTOP: | 176 | case SNI_BRD_PCI_DESKTOP: |
| 176 | switch (read_c0_prid() & 0xff00) { | 177 | switch (read_c0_prid() & PRID_IMP_MASK) { |
| 177 | case PRID_IMP_R4600: | 178 | case PRID_IMP_R4600: |
| 178 | case PRID_IMP_R4700: | 179 | case PRID_IMP_R4700: |
| 179 | system_type = "RM200-C20"; | 180 | system_type = "RM200-C20"; |
