summaryrefslogtreecommitdiff
path: root/cpu/blackfin
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-10-11 21:15:53 -0400
committerMike Frysinger <vapier@gentoo.org>2009-01-28 13:26:14 -0500
commit51230e6e356ccf4c932e0c4ff54f1e49da02285c (patch)
treed68b752f6f2be44a6296c490a7e1b326adb916e9 /cpu/blackfin
parent4f6a313240c531042f16909a3a170ab047b95779 (diff)
downloadu-boot-imx-51230e6e356ccf4c932e0c4ff54f1e49da02285c.zip
u-boot-imx-51230e6e356ccf4c932e0c4ff54f1e49da02285c.tar.gz
u-boot-imx-51230e6e356ccf4c932e0c4ff54f1e49da02285c.tar.bz2
Blackfin: add portmuxing for UARTs on the BF51x
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'cpu/blackfin')
-rw-r--r--cpu/blackfin/serial.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/cpu/blackfin/serial.h b/cpu/blackfin/serial.h
index ec40c26..90fceec 100644
--- a/cpu/blackfin/serial.h
+++ b/cpu/blackfin/serial.h
@@ -95,7 +95,16 @@
__attribute__((always_inline))
static inline void serial_do_portmux(void)
{
-#ifdef __ADSPBF52x__
+#if defined(__ADSPBF51x__)
+# define DO_MUX(port, mux_tx, mux_rx, tx, rx) \
+ bfin_write_PORT##port##_MUX((bfin_read_PORT##port##_MUX() & ~(PORT_x_MUX_##mux_tx##_MASK | PORT_x_MUX_##mux_rx##_MASK)) | PORT_x_MUX_##mux_tx##_FUNC_2 | PORT_x_MUX_##mux_rx##_FUNC_2); \
+ bfin_write_PORT##port##_FER(bfin_read_PORT##port##_FER() | P##port##tx | P##port##rx);
+ switch (CONFIG_UART_CONSOLE) {
+ case 0: DO_MUX(G, 5, 5, 9, 10); break; /* Port G; mux 5; PG9 and PG10 */
+ case 1: DO_MUX(F, 2, 3, 14, 15); break; /* Port H; mux 2/3; PH14 and PH15 */
+ }
+ SSYNC();
+#elif defined(__ADSPBF52x__)
# define DO_MUX(port, mux, tx, rx) \
bfin_write_PORT##port##_MUX((bfin_read_PORT##port##_MUX() & ~PORT_x_MUX_##mux##_MASK) | PORT_x_MUX_##mux##_FUNC_3); \
bfin_write_PORT##port##_FER(bfin_read_PORT##port##_FER() | P##port##tx | P##port##rx);