]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/armv7/zynq/timer.c
Merge branch 'master' of git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / arch / arm / cpu / armv7 / zynq / timer.c
index 8c4357de4202c1b8197b916c575165ed1e84facc..2be253c2c3d5ec29d2e7a50da9542701728d0340 100644 (file)
  * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  * Alex Zuepke <azu@sysgo.de>
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -73,7 +57,7 @@ int timer_init(void)
                        SCUTIMER_CONTROL_ENABLE_MASK;
 
        /* Load the timer counter register */
-       writel(0xFFFFFFFF, &timer_base->counter);
+       writel(0xFFFFFFFF, &timer_base->load);
 
        /*
         * Start the A9Timer device
@@ -123,8 +107,7 @@ void __udelay(unsigned long usec)
        if (usec == 0)
                return;
 
-       countticks = (u32) (((unsigned long long) TIMER_TICK_HZ * usec) /
-                                                               1000000);
+       countticks = lldiv(TIMER_TICK_HZ * usec, 1000000);
 
        /* decrementing timer */
        timeend = readl(&timer_base->counter) - countticks;