[U-Boot] [PATCH 25/37] arm: rmobile: Add support TMU base timer function

Kim Phillips kim.phillips at freescale.com
Tue Aug 14 01:26:13 CEST 2012


patch 25/37 showing up in an otherwise unnumbered patchseries of 6,
and with the cover letter set to 'v3' where all 6 patches are at v2
makes for a highly confusing patchset.

On Fri, 10 Aug 2012 16:16:12 +0900
Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj at renesas.com> wrote:

> Some rmobile SoC has TMU base timer function. This supports TMU.
> 
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj at renesas.com>
> ---
>  V2: Set COBJS one object per line, and sort the list.
> 
>  arch/arm/cpu/armv7/rmobile/Makefile           |    4 +-
>  arch/arm/cpu/armv7/rmobile/timer_tmu.c        |  161 +++++++++++++++++++++++++

this is a copy of arch/sh/lib/time.c but with proper struct tmu_regs
instead of #defines; is it not possible to refactor & merge the two?

> +int timer_init(void)
> +{
> +	/* Divide clock by CONFIG_SYS_TMU_CLK_DIV */
> +	u16 bit = 0;
> +
> +	switch (CONFIG_SYS_TMU_CLK_DIV) {
> +	case 1024:
> +		bit = 4;
> +		break;
> +	case 256:
> +		bit = 3;
> +		break;
> +	case 64:
> +		bit = 2;
> +		break;
> +	case 16:
> +		bit = 1;
> +		break;
> +	case 4:
> +	default:
> +		break;
> +	}

Can this be broken down into a shift operation?

Kim



More information about the U-Boot mailing list