summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2012-09-12 12:26:30 +0200
committerTom Rini <trini@ti.com>2012-10-15 11:53:48 -0700
commit407e6a280044c9d1a512e9d544bbc0d12f48cca3 (patch)
tree31ff0678116e3847da8a2e538a30c731915ac660 /drivers
parent90bad891e18cd77273ee951e61623d768255bcda (diff)
downloadu-boot-imx-407e6a280044c9d1a512e9d544bbc0d12f48cca3.zip
u-boot-imx-407e6a280044c9d1a512e9d544bbc0d12f48cca3.tar.gz
u-boot-imx-407e6a280044c9d1a512e9d544bbc0d12f48cca3.tar.bz2
serial: pxa: Implement default_serial_console in serial_pxa.c
Implement weak default_serial_console() function in serial_pxa driver, which gets available in case CONFIG_SERIAL_MULTI is enabled. This will get helpful in subsequent patches, which will encapsulate PXA's struct serial_device instances in serial_pxa driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Tom Rini <trini@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/serial_pxa.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/serial/serial_pxa.c b/drivers/serial/serial_pxa.c
index 97e3f36..ad2d77e 100644
--- a/drivers/serial/serial_pxa.c
+++ b/drivers/serial/serial_pxa.c
@@ -36,6 +36,7 @@
#include <asm/arch/pxa-regs.h>
#include <asm/arch/regs-uart.h>
#include <asm/io.h>
+#include <linux/compiler.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -298,4 +299,19 @@ void pxa_puts_dev(unsigned int uart_index, const char *s)
#ifndef CONFIG_SERIAL_MULTI
pxa_uart(serial, UART)
+#else
+__weak struct serial_device *default_serial_console(void)
+{
+#if CONFIG_CONS_INDEX == 1
+ return &serial_hwuart_device;
+#elif CONFIG_CONS_INDEX == 2
+ return &serial_stuart_device;
+#elif CONFIG_CONS_INDEX == 3
+ return &serial_ffuart_device;
+#elif CONFIG_CONS_INDEX == 4
+ return &serial_btuart_device;
+#else
+#error "Bad CONFIG_CONS_INDEX."
+#endif
+}
#endif