[U-Boot] [RFC PATCH] OMAP: Timer: Replace bss variable by gd
Nishanth Menon
nm at ti.com
Fri Dec 10 01:06:48 CET 2010
On Thu, Dec 9, 2010 at 10:31 AM, Dirk Behme <dirk.behme at googlemail.com> wrote:
> Reuse the gd->tbl value for timestamp and add gd->lastinc for lastinc bss
> values in the OMAP timer driver.
>
> The usage of bss values in drivers before initialisation of bss is forbidden.
> In that special case some data in .rel.dyn gets corrupted.
>
> Signed-off-by: Dirk Behme <dirk.behme at gmail.com>
>
> ---
>
> Note: This is compile tested only (therefore the RFC). Please *test*
> on real OMAP HW, e.g. Beagle.
>
> This is change is inspired by
>
> http://git.denx.de/u-boot.git/?p=u-boot.git;a=commitdiff;h=a429db7e3ce6136f80f22584588247926ba60b05
>
> arch/arm/cpu/armv7/omap-common/timer.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> Index: u-boot.git/arch/arm/cpu/armv7/omap-common/timer.c
> ===================================================================
> --- u-boot.git.orig/arch/arm/cpu/armv7/omap-common/timer.c
> +++ u-boot.git/arch/arm/cpu/armv7/omap-common/timer.c
> @@ -35,8 +35,8 @@
> #include <common.h>
> #include <asm/io.h>
>
> -static ulong timestamp;
> -static ulong lastinc;
> +DECLARE_GLOBAL_DATA_PTR;
> +
> static struct gptimer *timer_base = (struct gptimer *)CONFIG_SYS_TIMERBASE;
>
[...]
Tested-by: Nishanth Menon <nm at ti.com>
Acked-by: Nishanth Menon <nm at ti.com
Tested on OMAP4 pandaboard with codesourcery 2010.09 gcc 4.5.1 and is
seen to fix the issue I reported on
http://groups.google.com/group/pandaboard/browse_thread/thread/d59461353a5e693f
Tests:
on u-boot prompt:
sleep 5 (test if time delays are still functional) -> Pass
mmc boot to MeeGo filesystem -> Pass
Thanks a bunch Dirk - just had started to debug this and steve pointed this out.
Regards,
Nishanth Menon
More information about the U-Boot
mailing list