]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
microblaze: Do not call timer init that early
authorMichal Simek <michal.simek@xilinx.com>
Wed, 11 Jul 2018 12:08:26 +0000 (14:08 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 24 Jul 2018 09:36:01 +0000 (11:36 +0200)
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>
arch/microblaze/cpu/timer.c

index 8845e07d0e8bb0c1ca3d5c9244f80fc399398047..351d3ced0444b2f22204e054e280bd050d8058c8 100644 (file)
@@ -52,6 +52,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) {