SPDX: Convert all of our single license tags to Linux Kernel style
[oweals/u-boot.git] / arch / arm / cpu / arm926ejs / spear / timer.c
index 66cf4de81713205d24e1b3d94f862f01badf62a4..e9ba87a4606218e85b15cfabd62159eb42f8e5c4 100644 (file)
@@ -1,24 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2009
  * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
- *
- * 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
  */
 
 #include <common.h>
@@ -38,8 +21,8 @@ static struct misc_regs *const misc_regs_p =
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define timestamp gd->tbl
-#define lastdec gd->lastinc
+#define timestamp gd->arch.tbl
+#define lastdec gd->arch.lastinc
 
 int timer_init(void)
 {
@@ -53,7 +36,7 @@ int timer_init(void)
        writel(MISC_PRSC_CFG, &misc_regs_p->prsc1_clk_cfg);
        synth = MISC_GPT3SYNTH;
 #else
-# error Incorrect config. Can only be spear{600|300|310|320}
+# error Incorrect config. Can only be SPEAR{600|300|310|320}
 #endif
 
        writel(readl(&misc_regs_p->periph_clk_cfg) | synth,
@@ -68,7 +51,9 @@ int timer_init(void)
        /* auto reload, start timer */
        writel(readl(&gpt_regs_p->control) | GPT_ENABLE, &gpt_regs_p->control);
 
-       reset_timer_masked();
+       /* Reset the timer */
+       lastdec = READ_TIMER();
+       timestamp = 0;
 
        return 0;
 }
@@ -76,22 +61,11 @@ int timer_init(void)
 /*
  * timer without interrupts
  */
-
-void reset_timer(void)
-{
-       reset_timer_masked();
-}
-
 ulong get_timer(ulong base)
 {
        return (get_timer_masked() / GPT_RESOLUTION) - base;
 }
 
-void set_timer(ulong t)
-{
-       timestamp = t;
-}
-
 void __udelay(unsigned long usec)
 {
        ulong tmo;
@@ -108,13 +82,6 @@ void __udelay(unsigned long usec)
                ;
 }
 
-void reset_timer_masked(void)
-{
-       /* reset time */
-       lastdec = READ_TIMER();
-       timestamp = 0;
-}
-
 ulong get_timer_masked(void)
 {
        ulong now = READ_TIMER();