]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/mach-mvebu/timer.c
arm: socfpga: misc: Add support for printing boot mode
[u-boot] / arch / arm / mach-mvebu / timer.c
index 40c4bc2da1b233732f69821dec23ccd90495bba9..c516c419edaf2cc75c5403939eb27fd9f8dd33b4 100644 (file)
@@ -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));