[U-Boot] [PATCH-ARM] CONFIG_SYS_HZ fix for ARM920T S3C24X0 Boards

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sun Jul 5 00:15:45 CEST 2009


On 02:29 Sun 21 Jun     , kevin.morfitt at fearnside-systems.co.uk wrote:
> This sets CONFIG_SYS_HZ to 1000 for all boards that use the s3c2400 and 
> s3c2410 cpu's.
> 
> Tested on an Embest SBC2440-II Board with local u-boot patches as I don't 
> have any s3c2400 or s3c2410 boards but need this patch applying before I can 
> submit patches for thge SBC2440-II Board.
> 
> Also, ran MAKEALL for all ARM9 targets and no new warnings or errors were found.
> 
> Note that the existing code modified by this patch does not meet the u-boot 
> coding style but I'd like to handle this separately and submit patches to fix 
> this later.
It look fine but it will be good that someone test it on the other soc
I'll try to ping someone
> 
> Signed-off-by: Kevin Morfitt <kevin.morfitt at fearnside-systems.co.uk>
> ---
>  cpu/arm920t/s3c24x0/timer.c |   42 ++++++++++++++++++++++++++----------------
>  include/configs/sbc2410x.h  |    4 +---
>  include/configs/smdk2400.h  |    4 +---
>  include/configs/smdk2410.h  |    4 +---
>  include/configs/trab.h      |   12 +-----------
>  5 files changed, 30 insertions(+), 36 deletions(-)
>  mode change 100644 => 100755 cpu/arm920t/s3c24x0/timer.c
>  mode change 100644 => 100755 include/configs/sbc2410x.h
>  mode change 100644 => 100755 include/configs/smdk2400.h
>  mode change 100644 => 100755 include/configs/smdk2410.h
>  mode change 100644 => 100755 include/configs/trab.h
> 
> diff --git a/cpu/arm920t/s3c24x0/timer.c b/cpu/arm920t/s3c24x0/timer.c
> old mode 100644
> new mode 100755
> index f0a09cd..8ea2e4b
> --- a/cpu/arm920t/s3c24x0/timer.c
> +++ b/cpu/arm920t/s3c24x0/timer.c
> @@ -38,7 +38,9 @@
>  #include <s3c2410.h>
>  #endif
>  
> +static unsigned long get_timer_raw(void);
>  int timer_load_val = 0;
> +static ulong timer_clk;
>  
>  
> +static unsigned long get_timer_raw(void)
rename it get_ticks
> +{
> +	ulong now = READ_TIMER();
> +
> +	if (lastdec >= now) {
> +		/* normal mode */
> +		timestamp += lastdec - now;
> +	} else {
> +		/* we have an overflow ... */
> +		timestamp += lastdec + timer_load_val - now;
> +	}
> +	lastdec = now;
> +
> +	return timestamp;
> +}
> +
>  /*
>   * This function is derived from PowerPC code (read timebase as long long).
>   * On ARM it just returns the timer value.
>   */
>  unsigned long long get_ticks(void)
>  {
> -	return get_timer(0);
> +	return get_timer_raw();
>  }
>  
Best Regards,
J.


More information about the U-Boot mailing list