[U-Boot] [PATCH] at91: change CONFIG_SYS_HZ to 1000

Wolfgang Denk wd at denx.de
Tue Feb 24 22:42:30 CET 2009


Dear Detlef Vollmann,

In message <49A4095E.7010502 at vollmann.ch> you wrote:
> It seems that resistance is futile...
> Nearly all boards now use a value of 1000 for CONFIG_SYS_HZ,
> and a commit from Oct 1 last year in the net code breaks all
> boards silently that have a different value.
> So here's a patch for the at91 arm926ejs CPUs and boards
> that changes get_timer and get_ticks to return milliseconds.
> This will break boards that are not in the tree but use such CPUs,
> but at least it'll break them loudly.
> 
>   Detlef
> 
> CHANGELOG:
> Change at91 CPUs based on arm926ejs to return milliseconds
> from get_timer and get_ticks.  Also changes in the value of
> CONFIG_SYS_HZ to 1000 in all board configs using these CPUs.
> This will not compile on boards using these CPUs with a
> different value for CONFIG_SYS_HZ.

Please use git tools to format and send the patch. Make sure to
provide a usable comit message, and place any additional comments
below a '---' line.

Also, please don't forget your signed-off-by line.

Please see http://www.denx.de/wiki/U-Boot/Patches for details.

> diff -Nrup u-boot-2009.03-rc1.orig/cpu/arm926ejs/at91/timer.c u-boot-2009.03-rc1/cpu/arm926ejs/at91/timer.c
> --- u-boot-2009.03-rc1.orig/cpu/arm926ejs/at91/timer.c  2009-02-23 00:22:21.000000000 +0100
> +++ u-boot-2009.03-rc1/cpu/arm926ejs/at91/timer.c       2009-02-24 14:58:47.000000000 +0100
> @@ -30,6 +30,19 @@
>  #include <asm/arch/io.h>
>  
>  /*
> + * This code essentially ignores the settings of AT91_MASTER_CLOCK
> + * and CONFIG_SYS_HZ, so we just bail out if they're not set to
> + * the canonical values.
> + */
> +#if (CONFIG_SYS_HZ != 1000)
> +#error "CONFIG_SYS_HZ must be set to 1000 for this CPU"
> +#endif

This makes no sense - CONFIG_SYS_HZ should be set to 1000 for all boards
and processors.

...
> +static inline ulong get_timer_usec(ulong base)
> +{
> +       ulong now = get_timer_masked_usec();
> +
> +       if (now >= base)
> +               return now - base;
^^^^^^^^^^^^^^

Here and elsewhere: please intent by TABs only.

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You can fool some of the people all of the time, and You can fool all
of the people some of the time, but You can't fool mom.


More information about the U-Boot mailing list