[U-Boot] [PATCH] Update s3c24x0 timer implementation

Wolfgang Denk wd at denx.de
Sun Oct 23 19:22:48 CEST 2011


Dear Mark Norman,

In message <CAJtrzLOvjswmuww+xNLXxeSH4QxOBZww3JrZGKCgLq5w6B=y3w at mail.gmail.com> you wrote:
>
>  Since the .rel.text section is required by the relocation code, I
> assume that .bss global variables cannot be used until after
> relocation?

Why do you have to make such assumptions?  That's documented
behaviour.  Didn't you RTFM?

> After studying several other timer.c files I developed the following
> patch which uses the global data struct to store the global variables.
>  I also restructured some of the code based on structure of the other
> timer.c files.  I have confirmed it works correctly on the SBC I have.

Then please submit a proper patch - these introductury comments don;lt
belong intot he commit message and shouldbemoved into the comment
section (below the "---" line).


...
> +	/* Use PWM Timer 4 because it has no output.
> +	 * Prescaler is hard fixed at 250, divider at 2.
> +	 * This generates a Timer clock frequency of 100kHz (@PCLK=50MHz) and
> +	 * therefore 10us timer ticks.
> +	 */

Incorrect multiline comment format; please fix globally.

> +	/* Prescaler for Timer 4 is 250 */
> +	const ulong prescaler = 250;
> +	writel((prescaler-1) << 8, &timers->tcfg0);

Please move declarations up.  Don't split declarations by comment
lines.  Add a blank line between declarations and code.

...
> --- a/arch/arm/include/asm/global_data.h
> +++ b/arch/arm/include/asm/global_data.h
> @@ -38,9 +38,6 @@ typedef	struct	global_data {
>  	unsigned long	flags;
>  	unsigned long	baudrate;
>  	unsigned long	have_console;	/* serial_init() was called */
> -#ifdef CONFIG_PRE_CONSOLE_BUFFER
> -	unsigned long	precon_buf_idx;	/* Pre-Console buffer index */
> -#endif

Make sure not to add such unrelated, incorrect changes!

> -#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
> -	unsigned long	post_log_word; /* Record POST activities */
> -	unsigned long	post_log_res; /* success of POST test */
> -	unsigned long	post_init_f_time; /* When post_init_f started */
> -#endif

Ditto.

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
I think there's a world market for about five computers.
         -- attr. Thomas J. Watson (Chairman of the Board, IBM), 1943


More information about the U-Boot mailing list