]> git.sur5r.net Git - u-boot/commitdiff
altera_jtag_uart: bypass when no jtag connection
authorThomas Chou <thomas@wytron.com.tw>
Wed, 31 Mar 2010 00:30:08 +0000 (08:30 +0800)
committerScott McNutt <smcnutt@psyent.com>
Sat, 24 Apr 2010 22:21:23 +0000 (18:21 -0400)
This patch adds an option to bypass output waiting when there
is no jtag connection. This allows the jtag uart work similar
to a serial uart, ie, boot even without connection.

This option is enabled with CONFIG_ALTERA_JTAG_UART_BYPASS

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Scott McNutt <smcnutt@psyent.com>
drivers/serial/altera_jtag_uart.c

index fb28aa9eb94bbc3d1ffe52958f63c3c381b58c24..2980e4d07c18105a9c27827102f9be97edc18dee 100644 (file)
@@ -38,8 +38,16 @@ int serial_init( void ) { return(0);}
 
 void serial_putc (char c)
 {
-       while (NIOS_JTAG_WSPACE ( readl (&jtag->control)) == 0)
-               WATCHDOG_RESET ();
+       while (1) {
+               unsigned st = readl(&jtag->control);
+               if (NIOS_JTAG_WSPACE(st))
+                       break;
+#ifdef CONFIG_ALTERA_JTAG_UART_BYPASS
+               if (!(st & NIOS_JTAG_AC)) /* no connection */
+                       return;
+#endif
+               WATCHDOG_RESET();
+       }
        writel ((unsigned char)c, &jtag->data);
 }