aspeed/timer: move static variables under arch_global_data
Subsystems (3)
PATCH 1/1 aspeed/timer: move static variables under arch_global_data
The timestamp and lastdec variables are under BSS which is a problem as the timer_init() routine is called in the early init phase. Move them under arch_global_data.
Signed-off-by Cédric Le Goater <[email protected]>
---
Tested on AST2500 EVB
arch/arm/mach-aspeed/timer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/mach-aspeed/timer.c +4 -2
@@ -31,8 +31,10 @@#define READ_CLK (*(volatile ulong *)(AST_TIMER_BASE + 0))#define READ_TIMER (READ_CLK / CLK_PER_HZ) -static ulong timestamp; -static ulong lastdec; +DECLARE_GLOBAL_DATA_PTR ; + +#define timestamp gd->arch.tbl +#define lastdec gd->arch.lastincint timer_init (void ) {
Signature · 1 line
2.13.6
Andrew Jeffery
AppliedQuoted 5 lines · Cédric Le Goater
The timestamp and lastdec variables are under BSS which is a problem as the
timer_init()routine is called in the early init phase. Move them underarch_global_data.Signed-off-by Cédric Le Goater <[email protected]>
Applied to v2016.07-aspeed-openbmc.
Cheers,
Andrew
Quoted 24 lines
---
Tested on AST2500 EVB
arch/arm/mach-aspeed/timer.c | 6 ++++--1 file changed, 4 insertions(+), 2 deletions(-)arch/arm/mach-aspeed/timer.c +0
-0@@ -31,8 +31,10 @@ #define READ_CLK (*(volatile ulong *)(AST_TIMER_BASE + 0)) #define READ_TIMER (READ_CLK / CLK_PER_HZ)arch/arm/mach-aspeed/timer.c +4
-2-static ulong timestamp; -static ulong lastdec; +DECLARE_GLOBAL_DATA_PTR ; + +#define timestamp gd->arch.tbl +#define lastdec gd->arch.lastinc
inttimer_init(void)
{