Re: [PATCH 08/10] Alchemy: DB1300 blink leds on timer tick

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri,  6 Mar 2009 10:20:07 -0600
Kevin Hickey <khickey@xxxxxxxxxxx> 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.
> 
> Signed-off-by: Kevin Hickey <khickey@xxxxxxxxxxx>
> ---
>  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;
>  }
>  

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).

(btw, I made something similar for the DB1200 a while ago:
 http://mlau.at/files/au1xxx-updates/4040-Alchemy-DB1200-cpu-idle-counter.patch
)

Best regards,
	Manuel Lauss


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux