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.
Signed-off-by: Kevin Hickey <khickey@rmicorp.com>
---
arch/mips/alchemy/common/time.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c
index f58d4ff..2b2f6bf 100644
--- a/arch/mips/alchemy/common/time.c
+++ b/arch/mips/alchemy/common/time.c
@@ -39,6 +39,10 @@
#include <asm/time.h>
#include <asm/mach-au1x00/au1000.h>
+#ifdef CONFIG_MIPS_DB1300
+#include <dev_boards.h>
+#endif
+
/* 32kHz clock enabled and detected */
#define CNTR_OK (SYS_CNTRL_E0 | SYS_CNTRL_32S)
@@ -60,6 +64,11 @@ static struct clocksource au1x_counter1_clocksource = {
static int au1x_rtcmatch2_set_next_event(unsigned long delta,
struct clock_event_device *cd)
{
+#ifdef CONFIG_MIPS_DB1300
+ static u8 dots = 1;
+ static u32 delayer = 0;
+#endif
+
delta += au_readl(SYS_RTCREAD);
/* wait for register access */
while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M21)
@@ -67,6 +76,13 @@ static int au1x_rtcmatch2_set_next_event(unsigned long delta,
au_writel(delta, SYS_RTCMATCH2);
au_sync();
+#ifdef CONFIG_MIPS_DB1300
+ if (++delayer % 1000 == 0) {
+ db_set_hex_dots(dots++);
+ dots %= 4;
+ }
+#endif
+
return 0;
}
--
1.5.4.3
|