x86: Move i8254_init() to x86_cpu_init_f()
PATCH v2 1/2 x86: Move i8254_init() to x86_cpu_init_f()
Right now i8254_init() is called from timer_init() in the tsc timer driver. But actually i8254 and tsc are completely different things. Since tsc timer has been converted to driver model, we should find a new place that is appropriate for U-Boot to call i8254_init(), which is now x86_cpu_init_f().
---
Changes in v2:
- Rebase on top of u-boot/master
- Reorder the patches so that patch#2 in v1 comes first in v2
arch/x86/cpu/cpu.c | 5 +++++ drivers/timer/tsc_timer.c | 10 ---------- 2 files changed, 5 insertions(+), 10 deletions(-)
arch/x86/cpu/cpu.c +5 -0
@@ -399,6 +399,11 @@ int x86_cpu_init_f(void) } } +#ifdef CONFIG_I8254_TIMER +/* Set up the i8254 timer if required */ +i8254_init (); +#endif +return 0 ; }
drivers/timer/tsc_timer.c +0 -10
@@ -325,16 +325,6 @@ void __udelay(unsigned long usec)#endif } -int timer_init (void ) -{ -#ifdef CONFIG_I8254_TIMER -/* Set up the i8254 timer if required */ -i8254_init (); -#endif - -return 0 ; -} -static int tsc_timer_get_count (struct udevice *dev,u64 *count) {u64 now_tick =rdtsc ();
Signature · 1 line
1.8.2.1
PATCH v2 1/2 x86: Move i8254_init() to x86_cpu_init_f()
Quoted 9 lines · Bin Meng
Right now
i8254_init()is called fromtimer_init()in the tsc timer driver. But actually i8254 and tsc are completely different things. Since tsc timer has been converted to driver model, we should find a new place that is appropriate for U-Boot to calli8254_init(), which is nowx86_cpu_init_f().Signed-off-by Bin Meng <[email protected]>Acked-by Simon Glass <[email protected]>
applied to u-boot-x86/master, thanks!
PATCH v2 2/2 common: Remove timer_init() call for x86
In reply to Bin MengWith driver model timer support, there should not be an explict call to timer_init(). Remove this call for x86.
---
Changes in v2: None
common/board_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/board_f.c +1 -1
@@ -825,7 +825,7 @@ static init_fnc_t init_sequence_f[] = {/* TODO: can we rename this to timer_init()? */ init_timebase,#endif -#if defined(CONFIG_X86 ) || defined(CONFIG_ARM ) || defined(CONFIG_MIPS ) || \ +#if defined(CONFIG_ARM ) || defined(CONFIG_MIPS ) || \ defined(CONFIG_BLACKFIN ) || defined(CONFIG_NDS32 ) || \ defined(CONFIG_SPARC ) timer_init, /* initialize timer */
Signature · 1 line
1.8.2.1
PATCH v2 2/2 common: Remove timer_init() call for x86
Quoted 6 lines · Bin Meng
With driver model timer support, there should not be an explict call to
timer_init(). Remove this call for x86.Signed-off-by Bin Meng <[email protected]>Acked-by Simon Glass <[email protected]>
applied to u-boot-x86/master, thanks!