2 * (C) Copyright 2012 Stephen Warren
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
19 #include <asm/arch/timer.h>
26 ulong get_timer_us(ulong base)
28 struct bcm2835_timer_regs *regs =
29 (struct bcm2835_timer_regs *)BCM2835_TIMER_PHYSADDR;
31 return readl(®s->clo) - base;
34 ulong get_timer(ulong base)
36 ulong us = get_timer_us(0);
37 us /= (1000000 / CONFIG_SYS_HZ);
42 unsigned long long get_ticks(void)
52 void __udelay(unsigned long usec)
57 endtime = get_timer_us(0) + usec;
60 ulong now = get_timer_us(0);