aboutsummaryrefslogtreecommitdiff
path: root/arch/mips/kernel/cpu-probe.c
diff options
context:
space:
mode:
authorPete Popov <ppopov@embeddedalley.com>2005-04-07 00:42:10 +0000
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 19:31:02 +0100
commit494900af689a22479eb405ff1323cad673bd9208 (patch)
treec4c50f2874f48679fd476a50e8866db2ce4696d3 /arch/mips/kernel/cpu-probe.c
parent3b495f2bb749b828499135743b9ddec46e34fda8 (diff)
Remove CONFIG_PM dependency from au1x wait in cpu_probe.
Additional work necessary to completely remove that config option. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/cpu-probe.c')
-rw-r--r--arch/mips/kernel/cpu-probe.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 66c2a2788ff..b7c8346df3c 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -51,29 +51,25 @@ static void r4k_wait(void)
".set\tmips0");
}
-/*
- * The Au1xxx wait is available only if we run CONFIG_PM and
- * the timer setup found we had a 32KHz counter available.
- * There are still problems with functions that may call au1k_wait
- * directly, but that will be discovered pretty quickly.
- */
-extern void (*au1k_wait_ptr)(void);
-
-void au1k_wait(void)
+/* The Au1xxx wait is available only if using 32khz counter or
+ * external timer source, but specifically not CP0 Counter. */
+static void au1k_wait(void)
{
-#ifdef CONFIG_PM
+ unsigned long addr;
/* using the wait instruction makes CP0 counter unusable */
- __asm__(".set\tmips3\n\t"
+ __asm__("la %0,au1k_wait\n\t"
+ ".set mips3\n\t"
+ "cache 0x14,0(%0)\n\t"
+ "cache 0x14,32(%0)\n\t"
+ "sync\n\t"
+ "nop\n\t"
"wait\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
"nop\n\t"
- ".set\tmips0");
-#else
- __asm__("nop\n\t"
- "nop");
-#endif
+ ".set mips0\n\t"
+ : : "r" (addr));
}
static inline void check_wait(void)
@@ -112,21 +108,20 @@ static inline void check_wait(void)
cpu_wait = r4k_wait;
printk(" available.\n");
break;
-#ifdef CONFIG_PM
case CPU_AU1000:
case CPU_AU1100:
case CPU_AU1500:
case CPU_AU1550:
case CPU_AU1200:
- if (au1k_wait_ptr != NULL) {
- cpu_wait = au1k_wait_ptr;
- printk(" available.\n");
- }
- else {
- printk(" unavailable.\n");
+ {
+ extern int allow_au1k_wait; /* au1000/common/time.c */
+ if (allow_au1k_wait) {
+ cpu_wait = au1k_wait;
+ printk(" available.\n");
+ } else
+ printk(" unavailable.\n");
}
break;
-#endif
default:
printk(" unavailable.\n");
break;