]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/arm920t/s3c24x0/timer.c
sunxi: Add clock_get_pll5p() function
[u-boot] / arch / arm / cpu / arm920t / s3c24x0 / timer.c
index eb2b8d081612ab826758f48fcb1ca95d03e42dff..ba1e616b8246245ab4cab87ed42678144a49a4ab 100644 (file)
  * (C) Copyright 2002
  * Gary Jennejohn, DENX Software Engineering, <garyj@denx.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>
@@ -62,7 +46,7 @@ int timer_init(void)
        /* auto load, start timer 4 */
        tmr = (tmr & ~0x0700000) | 0x0500000;
        writel(tmr, &timers->tcon);
-       gd->lastinc = 0;
+       gd->arch.lastinc = 0;
        gd->arch.tbl = 0;
 
        return 0;
@@ -128,14 +112,14 @@ unsigned long long get_ticks(void)
        struct s3c24x0_timers *timers = s3c24x0_get_base_timers();
        ulong now = readl(&timers->tcnto4) & 0xffff;
 
-       if (gd->lastinc >= now) {
+       if (gd->arch.lastinc >= now) {
                /* normal mode */
-               gd->arch.tbl += gd->lastinc - now;
+               gd->arch.tbl += gd->arch.lastinc - now;
        } else {
                /* we have an overflow ... */
-               gd->arch.tbl += gd->lastinc + gd->arch.tbu - now;
+               gd->arch.tbl += gd->arch.lastinc + gd->arch.tbu - now;
        }
-       gd->lastinc = now;
+       gd->arch.lastinc = now;
 
        return gd->arch.tbl;
 }