diff mbox

[U-Boot,v2,1/2] x86: Move i8254_init() to x86_cpu_init_f()

Message ID 1449624700-7296-1-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Bin Meng
Headers show

Commit Message

Bin Meng Dec. 9, 2015, 1:31 a.m. UTC
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().

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>

---

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(-)

Comments

Bin Meng Dec. 9, 2015, 1:57 a.m. UTC | #1
On Wed, Dec 9, 2015 at 9:31 AM, Bin Meng <bmeng.cn@gmail.com> wrote:
> 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().
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> Acked-by: Simon Glass <sjg@chromium.org>
>

applied to u-boot-x86/master, thanks!
diff mbox

Patch

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index 1707993..381d835 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -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;
 }
 
diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c
index 6aa2437..5c4ec00 100644
--- a/drivers/timer/tsc_timer.c
+++ b/drivers/timer/tsc_timer.c
@@ -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();