summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-06-02 06:00:27 -0400
committerMike Frysinger <vapier@gentoo.org>2010-07-13 17:50:50 -0400
commita409fdd8fe013aa4a4564bedc1f673b9455e64da (patch)
treecdbef39a9a599cd748ff949726569608f7eafc47 /arch
parentc5dc48295bd8acdca3802c735ef243251b50b189 (diff)
Blackfin: serial: convert to portmux framework
Use the new portmux framework to handle the details when possible. Unfortunately, we cannot yet use this in the standalone initialization logic, so we need to keep around the old portmux writes for now. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/cpu/serial.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/blackfin/cpu/serial.h b/arch/blackfin/cpu/serial.h
index 5f9be8622d..f9e311f3ee 100644
--- a/arch/blackfin/cpu/serial.h
+++ b/arch/blackfin/cpu/serial.h
@@ -26,6 +26,8 @@
#ifndef __ASSEMBLY__
+#include <asm/portmux.h>
+
#define LOB(x) ((x) & 0xFF)
#define HIB(x) (((x) >> 8) & 0xFF)
@@ -103,6 +105,23 @@ struct bfin_mmr_serial {
__attribute__((always_inline))
static inline void serial_do_portmux(void)
{
+ if (!BFIN_DEBUG_EARLY_SERIAL) {
+ const unsigned short pins[] = {
+#if CONFIG_UART_CONSOLE == 0
+ P_UART0_TX, P_UART0_RX,
+#elif CONFIG_UART_CONSOLE == 1
+ P_UART1_TX, P_UART1_RX,
+#elif CONFIG_UART_CONSOLE == 2
+ P_UART2_TX, P_UART2_RX,
+#elif CONFIG_UART_CONSOLE == 3
+ P_UART3_TX, P_UART3_RX,
+#endif
+ 0,
+ };
+ peripheral_request_list(pins, "bfin-uart");
+ return;
+ }
+
#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); \