From: Manuel Lauss <manuel.lauss@googlemail.com>
To: Linux-MIPS <linux-mips@linux-mips.org>,
Ralf Baechle <ralf@linux-mips.org>
Cc: Manuel Lauss <manuel.lauss@gmail.com>
Subject: [PATCH 2/7] Alchemy: get rid of allow_au1k_wait
Date: Sun, 7 Jun 2009 20:38:59 +0200 [thread overview]
Message-ID: <1244399944-29043-3-git-send-email-manuel.lauss@gmail.com> (raw)
In-Reply-To: <1244399944-29043-2-git-send-email-manuel.lauss@gmail.com>
Eliminate the 'allow_au1k_wait' variable. MIPS kernel installs the
Alchemy-specific wait code before timer initialization; if the C0
timer must be used for timekeeping the wait function is set to NULL
which means no wait implementation is available.
This also corrects the 'wait instruction available' output in cpuinfo.
Run-tested on DB1200.
Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
---
arch/mips/alchemy/common/time.c | 14 ++++++++------
arch/mips/kernel/cpu-probe.c | 10 +++-------
2 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c
index 33fbae7..9fc0d44 100644
--- a/arch/mips/alchemy/common/time.c
+++ b/arch/mips/alchemy/common/time.c
@@ -36,14 +36,13 @@
#include <linux/interrupt.h>
#include <linux/spinlock.h>
+#include <asm/processor.h>
#include <asm/time.h>
#include <asm/mach-au1x00/au1000.h>
/* 32kHz clock enabled and detected */
#define CNTR_OK (SYS_CNTRL_E0 | SYS_CNTRL_32S)
-extern int allow_au1k_wait; /* default off for CP0 Counter */
-
static cycle_t au1x_counter1_read(struct clocksource *cs)
{
return au_readl(SYS_RTCREAD);
@@ -153,13 +152,16 @@ void __init plat_time_init(void)
printk(KERN_INFO "Alchemy clocksource installed\n");
- /* can now use 'wait' */
- allow_au1k_wait = 1;
return;
cntr_err:
- /* counters unusable, use C0 counter */
+ /* MIPS kernel assigns 'au1k_wait' to 'cpu_wait' before this
+ * function is called. Because the Alchemy counters are unusable
+ * the C0 timekeeping code is installed and use of the 'wait'
+ * instruction must be prohibited, which is done most easily by
+ * assigning NULL to cpu_wait.
+ */
+ cpu_wait = NULL;
r4k_clockevent_init();
init_r4k_clocksource();
- allow_au1k_wait = 0;
}
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index b13b8eb..262ea9c 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -91,15 +91,11 @@ static void rm7k_wait_irqoff(void)
}
/* The Au1xxx wait is available only if using 32khz counter or
- * external timer source, but specifically not CP0 Counter. */
-int allow_au1k_wait;
-
+ * external timer source, but specifically not CP0 Counter.
+ * alchemy/common/time.c may override cpu_wait!
+ */
static void au1k_wait(void)
{
- if (!allow_au1k_wait)
- return;
-
- /* using the wait instruction makes CP0 counter unusable */
__asm__(" .set mips3 \n"
" cache 0x14, 0(%0) \n"
" cache 0x14, 32(%0) \n"
--
1.6.3.1
next prev parent reply other threads:[~2009-06-07 18:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-07 18:38 [PATCH 0/7] Alchemy: core and platform updates v2 Manuel Lauss
2009-06-07 18:38 ` [PATCH 1/7] Alchemy: prioritize timer and usb irqs Manuel Lauss
2009-06-07 18:38 ` Manuel Lauss [this message]
2009-06-07 18:39 ` [PATCH 3/7] Alchemy: extended DB1200 board support Manuel Lauss
2009-06-07 18:39 ` [PATCH 4/7] Alchemy: DB1200 AC97+I2S audio support Manuel Lauss
2009-06-07 18:39 ` [PATCH 5/7] Alchemy: new PCMCIA socket driver for devboards Manuel Lauss
2009-06-07 18:39 ` [PATCH 6/7] Alchemy: convert to physmap flash Manuel Lauss
2009-06-07 18:39 ` [PATCH 7/7] Alchemy: db1200 defconfig update Manuel Lauss
2009-06-08 9:25 ` [alsa-devel] [PATCH 4/7] Alchemy: DB1200 AC97+I2S audio support Mark Brown
2009-06-08 9:43 ` Manuel Lauss
2009-06-08 10:20 ` Mark Brown
2009-06-08 11:25 ` Manuel Lauss
2009-06-08 11:53 ` Mark Brown
2009-06-08 12:21 ` Manuel Lauss
2009-06-08 12:44 ` Mark Brown
2009-06-08 13:11 ` Manuel Lauss
2009-06-08 13:45 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1244399944-29043-3-git-send-email-manuel.lauss@gmail.com \
--to=manuel.lauss@googlemail.com \
--cc=linux-mips@linux-mips.org \
--cc=manuel.lauss@gmail.com \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).