summaryrefslogtreecommitdiff
path: root/arch/blackfin
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2012-09-13 00:02:54 +0200
committerTom Rini <trini@ti.com>2012-10-15 11:53:51 -0700
commit41651cab97143e3385057279a2633e2812f328ba (patch)
tree0d41209b414afe9563bd7a891096a3a97b529fb6 /arch/blackfin
parent425101e115946f29287c51b2ea2c3527978645aa (diff)
downloadu-boot-imx-41651cab97143e3385057279a2633e2812f328ba.zip
u-boot-imx-41651cab97143e3385057279a2633e2812f328ba.tar.gz
u-boot-imx-41651cab97143e3385057279a2633e2812f328ba.tar.bz2
serial: bfin: Flip the jtag serial console to CONFIG_SERIAL_MULTI
Rework the emulation of serial console via JTAG from simple ad-hoc implementation of serial port routines to CONFIG_SERIAL_MULTI and enable CONFIG_SERIAL_MULTI unconditionally for blackfin. In order for the JTAG serial console to take precedence over all other serial ports available in system, implement override for default_serial_console call returning this JTAG serial console. This brings in a bit of a growth of size, but eventually will allow us to unconditionally enable CONFIG_SERIAL_MULTI throughout the whole U-Boot and maintain only one serial subsystem. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Tom Rini <trini@ti.com> Cc: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/cpu/jtag-console.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/arch/blackfin/cpu/jtag-console.c b/arch/blackfin/cpu/jtag-console.c
index a77358a..7cddb85 100644
--- a/arch/blackfin/cpu/jtag-console.c
+++ b/arch/blackfin/cpu/jtag-console.c
@@ -194,12 +194,35 @@ int drv_jtag_console_init(void)
}
#ifdef CONFIG_UART_CONSOLE_IS_JTAG
+#include <serial.h>
/* Since the JTAG is always available (at power on), allow it to fake a UART */
-void serial_set_baud(uint32_t baud) {}
-void serial_setbrg(void) {}
-int serial_init(void) { return 0; }
-void serial_putc(const char c) __attribute__((alias("jtag_putc")));
-void serial_puts(const char *s) __attribute__((alias("jtag_puts")));
-int serial_tstc(void) __attribute__((alias("jtag_tstc")));
-int serial_getc(void) __attribute__((alias("jtag_getc")));
+void jtag_serial_setbrg(void)
+{
+}
+
+int jtag_serial_init(void)
+{
+ return 0;
+}
+
+static struct serial_device serial_jtag_drv = {
+ .name = "jtag",
+ .start = jtag_serial_init,
+ .stop = NULL,
+ .setbrg = jtag_serial_setbrg,
+ .putc = jtag_putc,
+ .puts = jtag_puts,
+ .tstc = jtag_tstc,
+ .getc = jtag_getc,
+};
+
+void bfin_jtag_initialize(void)
+{
+ serial_register(&serial_jtag_drv);
+}
+
+struct serial_device *default_serial_console(void)
+{
+ return &serial_jtag_drv;
+}
#endif