From 40599239e7875b39e2a5c12e6545992041c72c52 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 24 Oct 2008 22:48:47 -0400 Subject: 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 --- lib_blackfin/board.c | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'lib_blackfin/board.c') 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) -- cgit v1.2.3