From: Michal Simek <michal.simek@xilinx.com>
Date: Wed, 11 Jul 2018 12:08:26 +0000 (+0200)
Subject: microblaze: Do not call timer init that early
X-Git-Tag: v2025.01-rc5-pxa1908~3978^2~32
X-Git-Url: http://git.dujemihanovic.xyz/%22http:/kyber.dk/phpMyBuilder/static/%7B%7B%20%24image.RelPermalink%20%7D%7D?a=commitdiff_plain;h=35670665d6b6176566b5701c078d5103c1ec4c86;p=u-boot.git

microblaze: Do not call timer init that early

Timer needs to be converted to DM but as of now it can't be called so
early because intc controller is not ready. Call it later in board_r.c.
Before this patch timer_init is called twice which is wrong.
The patch is blocking initialization before relocation.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c
index ef229023bf..58e5c30750 100644
--- a/arch/microblaze/cpu/timer.c
+++ b/arch/microblaze/cpu/timer.c
@@ -51,6 +51,10 @@ int timer_init (void)
 
 	debug("TIMER: Initialization\n");
 
+	/* Do not init before relocation */
+	if (!(gd->flags & GD_FLG_RELOC))
+		return 0;
+
 	node = fdt_node_offset_by_compatible(blob, node,
 				"xlnx,xps-timer-1.00.a");
 	if (node != -1) {