3 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4 * Marius Groeger <mgroeger@sysgo.de>
7 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
8 * Alex Zuepke <azu@sysgo.de>
10 * See file CREDITS for list of people who contributed to this
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License as
15 * published by the Free Software Foundation; either version 2 of
16 * the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
37 void reset_timer (void)
39 reset_timer_masked ();
42 ulong get_timer (ulong base)
44 return get_timer_masked ();
47 void set_timer (ulong t)
52 void __udelay (unsigned long usec)
58 void reset_timer_masked (void)
63 ulong get_timer_masked (void)
68 void udelay_masked (unsigned long usec)
79 tmo = usec * CONFIG_SYS_HZ;
83 endtime = get_timer_masked () + tmo;
86 ulong now = get_timer_masked ();
92 * This function is derived from PowerPC code (read timebase as long long).
93 * On ARM it just returns the timer value.
95 unsigned long long get_ticks(void)
101 * This function is derived from PowerPC code (timebase clock frequency).
102 * On ARM it returns the number of timer ticks per second.
104 ulong get_tbclk (void)
108 tbclk = CONFIG_SYS_HZ;