On Sat, 07 Mar 2009 13:04:57 -0600
Kevin Hickey <khickey@rmicorp.com> wrote:
> On Sat, 2009-03-07 at 10:37 +0100, Manuel Lauss wrote:
> > On Fri, 6 Mar 2009 10:20:07 -0600
> > Kevin Hickey <khickey@rmicorp.com> wrote:
> >
> > > Blinks the dots on the hex display on the DB1300 board every 1000 timer
> > > ticks.
> > > This can help tell the difference between a soft and hard hung board.
>
> > Please don't do that. I'd still like to get all devboard hackery out
> > of code in common/ (at least for mainline kernels; what you do to the
> > RMI-sources I don't care about).
>
> Can you suggest an alternative? Or are you saying that this
> functionality does not belong in the mainline kernel at all?
>
How about this? No ifdefery, and every board can implement its own
board_timer_set callback to blink some leds. (Note, I still don't feel
this is "right", but ultimately it's not up you anyway).
diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c
index f58d4ff..ac448c2 100644
--- a/arch/mips/alchemy/common/time.c
+++ b/arch/mips/alchemy/common/time.c
@@ -44,6 +44,8 @@
extern int allow_au1k_wait; /* default off for CP0 Counter */
+void (*board_timer_set)(void) = NULL;
+
static cycle_t au1x_counter1_read(void)
{
return au_readl(SYS_RTCREAD);
@@ -67,6 +69,9 @@ static int au1x_rtcmatch2_set_next_event(unsigned long delta,
au_writel(delta, SYS_RTCMATCH2);
au_sync();
+ if (board_timer_set)
+ board_timer_set();
+
return 0;
}
|