summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/arm926ejs/kirkwood
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2011-01-20 22:56:39 +0000
committerAlbert Aribaud <albert.aribaud@free.fr>2011-02-02 00:54:45 +0100
commitc9ac3ba129b242b5977b03c17ed8d2f0d000e085 (patch)
tree15731603c91122c1960fb365738e70e4f78b4b15 /arch/arm/cpu/arm926ejs/kirkwood
parent009b54079e65ddf004041ccaccef3b8647ce8a0b (diff)
downloadtalos-obmc-uboot-c9ac3ba129b242b5977b03c17ed8d2f0d000e085.tar.gz
talos-obmc-uboot-c9ac3ba129b242b5977b03c17ed8d2f0d000e085.zip
arm926ejs: timer: Replace bss variable by gdr
Reuse the gd->tbl value for timestamp and add gd->lastinc for lastinc bss values in the arm926ejs timers implementation. The usage of bss values in drivers before initialisation of bss is forbidden. In that special case some data in .rel.dyn gets corrupted. This patch is similiar to the patch Dirk Behme posted for the armv7/omap-common/timer.c and added suggestions from Reinhard Meyer. Tested on the arm926ejs mx27 based magnesium board Tested on the arm926ejs kirkwood based suen3 board Signed-off-by: Heiko Schocher <hs@denx.de> cc: Albert ARIBAUD <albert.aribaud@free.fr> cc: Prafulla Wadaskar <prafulla@marvell.com> cc: Stefano Babic <sbabic@denx.de> cc: Reinhard Meyer <u-boot@emk-elektronik.de>
Diffstat (limited to 'arch/arm/cpu/arm926ejs/kirkwood')
-rw-r--r--arch/arm/cpu/arm926ejs/kirkwood/timer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/timer.c b/arch/arm/cpu/arm926ejs/kirkwood/timer.c
index 2ec6a93807..3e80329608 100644
--- a/arch/arm/cpu/arm926ejs/kirkwood/timer.c
+++ b/arch/arm/cpu/arm926ejs/kirkwood/timer.c
@@ -83,8 +83,10 @@ struct kwtmr_registers *kwtmr_regs = (struct kwtmr_registers *)KW_TIMER_BASE;
#define READ_TIMER (readl(CNTMR_VAL_REG(UBOOT_CNTR)) / \
(CONFIG_SYS_TCLK / 1000))
-static ulong timestamp;
-static ulong lastdec;
+DECLARE_GLOBAL_DATA_PTR;
+
+#define timestamp gd->tbl
+#define lastdec gd->lastinc
void reset_timer_masked(void)
{
OpenPOWER on IntegriCloud