summaryrefslogtreecommitdiff
path: root/lib_blackfin/board.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-10-24 22:48:47 -0400
committerMike Frysinger <vapier@gentoo.org>2009-02-02 12:24:42 -0500
commit40599239e7875b39e2a5c12e6545992041c72c52 (patch)
tree1cb9d7601f914acbf80c467ec7710abc61756258 /lib_blackfin/board.c
parent6957a6209b02f6b69607fc47425f13731cc477f1 (diff)
Blackfin: cache core/system clock values
Calculating the clocks requires a bit of calls to gcc math functions, so cache the values after the first run since they'll most likely never change once U-Boot is up and running. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'lib_blackfin/board.c')
-rw-r--r--lib_blackfin/board.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/lib_blackfin/board.c b/lib_blackfin/board.c
index 01b71d448..4aa859593 100644
--- a/lib_blackfin/board.c
+++ b/lib_blackfin/board.c
@@ -44,50 +44,6 @@ static inline void serial_early_puts(const char *s)
#endif
}
-/* Get the input voltage */
-static u_long get_vco(void)
-{
- u_long msel;
- u_long vco;
-
- msel = (*pPLL_CTL >> 9) & 0x3F;
- if (0 == msel)
- msel = 64;
-
- vco = CONFIG_CLKIN_HZ;
- vco >>= (1 & *pPLL_CTL); /* DF bit */
- vco = msel * vco;
- return vco;
-}
-
-/* Get the Core clock */
-u_long get_cclk(void)
-{
- u_long csel, ssel;
- if (*pPLL_STAT & 0x1)
- return CONFIG_CLKIN_HZ;
-
- ssel = *pPLL_DIV;
- csel = ((ssel >> 4) & 0x03);
- ssel &= 0xf;
- if (ssel && ssel < (1 << csel)) /* SCLK > CCLK */
- return get_vco() / ssel;
- return get_vco() >> csel;
-}
-
-/* Get the System clock */
-u_long get_sclk(void)
-{
- u_long ssel;
-
- if (*pPLL_STAT & 0x1)
- return CONFIG_CLKIN_HZ;
-
- ssel = (*pPLL_DIV & 0xf);
-
- return get_vco() / ssel;
-}
-
static void *mem_malloc_start, *mem_malloc_end, *mem_malloc_brk;
static void mem_malloc_init(void)