timer: generic udelay()

Add GENERIC_UDELAY Kconfig option so that a generic
udelay() implementation is provided utilizing the
monotonic timer. That way each board/chipset doesn't
need to duplicate the same udelay(). Additionally,
assume that GENERIC_UDELAY implies init_timer()
is not required.

BUG=None
BRANCH=None
TEST=Built nyan, ryu, and rambi. May need help testing.

Change-Id: Idd26de19eefc91ee3b0ceddfb1bc2152e19fd8ab
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/219719
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
Aaron Durbin 2014-09-25 10:05:15 -05:00 committed by chrome-internal-fetch
commit 1a85fbcad7
19 changed files with 24 additions and 243 deletions

View file

@ -1,7 +1,11 @@
#ifndef DELAY_H
#define DELAY_H
#if IS_ENABLED(CONFIG_GENERIC_UDELAY)
static inline void init_timer(void) {}
#else
void init_timer(void);
#endif
void udelay(unsigned usecs);
void mdelay(unsigned msecs);