diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2010-04-22 21:56:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-12 18:03:17 -0400 |
commit | f32041d369d10bf7bfae39c6b8597fa8463ec304 (patch) | |
tree | 76099ed838897647b289dab92ad212c9dc380207 | |
parent | 79d1e78997cd0030d4b449f4b8df46f933c480d7 (diff) |
MIPS: Sibyte: Apply M3 workaround only on affected chip types and versions.
(cherry picked from commit e65c7f33d75e977350ca350573d93c517ec02776)
Previously it was unconditionally used on all Sibyte family SOCs. The
M3 bug has to be handled in the TLB exception handler which is extremly
performance sensitive, so this modification is expected to deliver around
2-3% performance improvment. This is important as required changes to the
M3 workaround will make it more costly.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | arch/mips/include/asm/mach-sibyte/war.h | 6 | ||||
-rw-r--r-- | arch/mips/sibyte/sb1250/setup.c | 15 |
2 files changed, 20 insertions, 1 deletions
diff --git a/arch/mips/include/asm/mach-sibyte/war.h b/arch/mips/include/asm/mach-sibyte/war.h index 7950ef4f032c..743385d7b5f2 100644 --- a/arch/mips/include/asm/mach-sibyte/war.h +++ b/arch/mips/include/asm/mach-sibyte/war.h | |||
@@ -16,7 +16,11 @@ | |||
16 | #if defined(CONFIG_SB1_PASS_1_WORKAROUNDS) || \ | 16 | #if defined(CONFIG_SB1_PASS_1_WORKAROUNDS) || \ |
17 | defined(CONFIG_SB1_PASS_2_WORKAROUNDS) | 17 | defined(CONFIG_SB1_PASS_2_WORKAROUNDS) |
18 | 18 | ||
19 | #define BCM1250_M3_WAR 1 | 19 | #ifndef __ASSEMBLY__ |
20 | extern int sb1250_m3_workaround_needed(void); | ||
21 | #endif | ||
22 | |||
23 | #define BCM1250_M3_WAR sb1250_m3_workaround_needed() | ||
20 | #define SIBYTE_1956_WAR 1 | 24 | #define SIBYTE_1956_WAR 1 |
21 | 25 | ||
22 | #else | 26 | #else |
diff --git a/arch/mips/sibyte/sb1250/setup.c b/arch/mips/sibyte/sb1250/setup.c index 0444da1e23c2..92da3155ce07 100644 --- a/arch/mips/sibyte/sb1250/setup.c +++ b/arch/mips/sibyte/sb1250/setup.c | |||
@@ -87,6 +87,21 @@ static int __init setup_bcm1250(void) | |||
87 | return ret; | 87 | return ret; |
88 | } | 88 | } |
89 | 89 | ||
90 | int sb1250_m3_workaround_needed(void) | ||
91 | { | ||
92 | switch (soc_type) { | ||
93 | case K_SYS_SOC_TYPE_BCM1250: | ||
94 | case K_SYS_SOC_TYPE_BCM1250_ALT: | ||
95 | case K_SYS_SOC_TYPE_BCM1250_ALT2: | ||
96 | case K_SYS_SOC_TYPE_BCM1125: | ||
97 | case K_SYS_SOC_TYPE_BCM1125H: | ||
98 | return soc_pass < K_SYS_REVISION_BCM1250_C0; | ||
99 | |||
100 | default: | ||
101 | return 0; | ||
102 | } | ||
103 | } | ||
104 | |||
90 | static int __init setup_bcm112x(void) | 105 | static int __init setup_bcm112x(void) |
91 | { | 106 | { |
92 | int ret = 0; | 107 | int ret = 0; |