diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-04-29 18:03:29 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-07-26 16:37:57 +0200 |
commit | 6c768ca746c341dd6acbb8b39f48acb48e964d83 (patch) | |
tree | 1c20bed09fe9e70e525a2761d660301947f07dae /drivers/serial/serial_s5p.c | |
parent | 6262e4e74e2cdb9f231dc71c9893d4a4bd1e88df (diff) | |
download | u-boot-imx-6c768ca746c341dd6acbb8b39f48acb48e964d83.zip u-boot-imx-6c768ca746c341dd6acbb8b39f48acb48e964d83.tar.gz u-boot-imx-6c768ca746c341dd6acbb8b39f48acb48e964d83.tar.bz2 |
serial: push default_serial_console to drivers
Rather than sticking arch/board/driver specific logic in the common
serial code, push it all out to the respective drivers. The serial
drivers declare these funcs weak so that boards can still override
things with their own definition.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>
Tested-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'drivers/serial/serial_s5p.c')
-rw-r--r-- | drivers/serial/serial_s5p.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c index f1ffa29..6604aa9 100644 --- a/drivers/serial/serial_s5p.c +++ b/drivers/serial/serial_s5p.c @@ -22,6 +22,7 @@ */ #include <common.h> +#include <linux/compiler.h> #include <asm/io.h> #include <asm/arch/uart.h> #include <asm/arch/clk.h> @@ -205,3 +206,18 @@ struct serial_device s5p_serial2_device = DECLARE_S5P_SERIAL_FUNCTIONS(3); struct serial_device s5p_serial3_device = INIT_S5P_SERIAL_STRUCTURE(3, "s5pser3", "S5PUART3"); + +__weak struct serial_device *default_serial_console(void) +{ +#if defined(CONFIG_SERIAL0) + return &s5p_serial0_device; +#elif defined(CONFIG_SERIAL1) + return &s5p_serial1_device; +#elif defined(CONFIG_SERIAL2) + return &s5p_serial2_device; +#elif defined(CONFIG_SERIAL3) + return &s5p_serial3_device; +#else +#error "CONFIG_SERIAL? missing." +#endif +} |