All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: mvebu: Call timer_init early before PHY and DDR init
@ 2015-07-15 13:36 Stefan Roese
  2015-07-15 15:05 ` Anton Schubert
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Roese @ 2015-07-15 13:36 UTC (permalink / raw)
  To: u-boot

Without calling timer_init(), the xdelay() functions return immediately.
We need to call timer_init() early, so that these functions work and
the PHY and DDR init code works correctly.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Anton Schubert <anton.schubert@gmx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
---
 arch/arm/mach-mvebu/spl.c   | 2 ++
 arch/arm/mach-mvebu/timer.c | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c
index 2df25aa..e65f6ca 100644
--- a/arch/arm/mach-mvebu/spl.c
+++ b/arch/arm/mach-mvebu/spl.c
@@ -35,6 +35,8 @@ void board_init_f(ulong dummy)
 
 	preloader_console_init();
 
+	timer_init();
+
 	/* First init the serdes PHY's */
 	serdes_phy_config();
 
diff --git a/arch/arm/mach-mvebu/timer.c b/arch/arm/mach-mvebu/timer.c
index 40c4bc2..c516c41 100644
--- a/arch/arm/mach-mvebu/timer.c
+++ b/arch/arm/mach-mvebu/timer.c
@@ -41,6 +41,8 @@
 #define timestamp			gd->arch.tbl
 #define lastdec				gd->arch.lastinc
 
+static int init_done;
+
 /* Timer reload and current value registers */
 struct kwtmr_val {
 	u32 reload;	/* Timer reload reg */
@@ -112,6 +114,11 @@ void __udelay(unsigned long usec)
  */
 int timer_init(void)
 {
+	/* Only init the timer once */
+	if (init_done)
+		return 0;
+	init_done = 1;
+
 	/* load value into timer */
 	writel(TIMER_LOAD_VAL, CNTMR_RELOAD_REG(UBOOT_CNTR));
 	writel(TIMER_LOAD_VAL, CNTMR_VAL_REG(UBOOT_CNTR));
-- 
2.4.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] arm: mvebu: Call timer_init early before PHY and DDR init
  2015-07-15 13:36 [U-Boot] [PATCH] arm: mvebu: Call timer_init early before PHY and DDR init Stefan Roese
@ 2015-07-15 15:05 ` Anton Schubert
  0 siblings, 0 replies; 2+ messages in thread
From: Anton Schubert @ 2015-07-15 15:05 UTC (permalink / raw)
  To: u-boot

Tested-by: Anton Schubert <anton.schubert@gmx.de>

Tested on custom mv78260 board.

Anton

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-15 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-15 13:36 [U-Boot] [PATCH] arm: mvebu: Call timer_init early before PHY and DDR init Stefan Roese
2015-07-15 15:05 ` Anton Schubert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.