diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-10-07 10:43:04 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-10-07 10:43:04 -0400 |
| commit | a56e74f546b64be93731e42d83baf5b538cc1b11 (patch) | |
| tree | 18f6dee45d801e57ac9db2a31664b0d5c0762c50 /arch/mips/include | |
| parent | d08e2e09042bd3f7ef66a35cb4bb92794ab26bb2 (diff) | |
| parent | e4e7f10bfc4069925e99cc4b428c3434e30b6c3f (diff) | |
Merge branch 'arm-aesbs' of git://git.linaro.org/people/ardbiesheuvel/linux-arm into devel-stable
Diffstat (limited to 'arch/mips/include')
| -rw-r--r-- | arch/mips/include/asm/cpu-features.h | 8 | ||||
| -rw-r--r-- | arch/mips/include/asm/cpu-info.h | 1 | ||||
| -rw-r--r-- | arch/mips/include/asm/cpu-type.h | 203 | ||||
| -rw-r--r-- | arch/mips/include/asm/cpu.h | 38 | ||||
| -rw-r--r-- | arch/mips/include/asm/mach-au1x00/au1000.h | 4 | ||||
| -rw-r--r-- | arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h | 2 | ||||
| -rw-r--r-- | arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h | 2 | ||||
| -rw-r--r-- | arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h | 2 | ||||
| -rw-r--r-- | arch/mips/include/asm/mipsregs.h | 7 | ||||
| -rw-r--r-- | arch/mips/include/asm/pci.h | 12 | ||||
| -rw-r--r-- | arch/mips/include/asm/timex.h | 33 | ||||
| -rw-r--r-- | arch/mips/include/asm/vga.h | 3 |
12 files changed, 296 insertions, 19 deletions
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h index fa44f3ec5302..d445d060e346 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. |
| @@ -193,7 +187,7 @@ | |||
| 193 | 187 | ||
| 194 | /* | 188 | /* |
| 195 | * MIPS32, MIPS64, VR5500, IDT32332, IDT32334 and maybe a few other | 189 | * MIPS32, MIPS64, VR5500, IDT32332, IDT32334 and maybe a few other |
| 196 | * pre-MIPS32/MIPS53 processors have CLO, CLZ. The IDT RC64574 is 64-bit and | 190 | * pre-MIPS32/MIPS64 processors have CLO, CLZ. The IDT RC64574 is 64-bit and |
| 197 | * has CLO and CLZ but not DCLO nor DCLZ. For 64-bit kernels | 191 | * has CLO and CLZ but not DCLO nor DCLZ. For 64-bit kernels |
| 198 | * cpu_has_clo_clz also indicates the availability of DCLO and DCLZ. | 192 | * cpu_has_clo_clz also indicates the availability of DCLO and DCLZ. |
| 199 | */ | 193 | */ |
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)) |
