summaryrefslogtreecommitdiff
path: root/cpu/blackfin
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-04-24 23:54:19 -0400
committerMike Frysinger <vapier@gentoo.org>2009-05-06 08:47:27 -0400
commitf58bf804a14324c6c9186a7a664fa23281780e8b (patch)
treeb0cb13c712d73908486d65211690d1a6f6b5f5a7 /cpu/blackfin
parent02778f2f1b4b1a28b492367477db27c58d45ae35 (diff)
Blackfin: avoid get_sclk() with early serial debug
When the clock functions were changed to use cached values (and thereby avoiding expensive math functions), early serial debug broke because the baud programming is called before external memory is available. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'cpu/blackfin')
-rw-r--r--cpu/blackfin/serial.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/cpu/blackfin/serial.h b/cpu/blackfin/serial.h
index 7b47878df3..6cbc564b53 100644
--- a/cpu/blackfin/serial.h
+++ b/cpu/blackfin/serial.h
@@ -81,11 +81,6 @@
#ifndef __ASSEMBLY__
-/* We cannot use get_sclk() in initcode as it is defined elsewhere. */
-#ifdef BFIN_IN_INITCODE
-# define get_sclk() (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT / CONFIG_SCLK_DIV)
-#endif
-
#ifdef __ADSPBF54x__
# define ACCESS_LATCH()
# define ACCESS_PORT_IER()
@@ -190,6 +185,11 @@ static inline uint16_t serial_early_get_div(void)
return divisor;
}
+/* We cannot use get_sclk() early on as it uses caches in external memory */
+#if defined(BFIN_IN_INITCODE) || defined(CONFIG_DEBUG_EARLY_SERIAL)
+# define get_sclk() (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT / CONFIG_SCLK_DIV)
+#endif
+
__attribute__((always_inline))
static inline void serial_early_set_baud(uint32_t baud)
{