* [U-Boot] [PATCH] altera_jtag_uart: bypass when no jtag connection
@ 2010-03-27 23:20 Thomas Chou
2010-03-31 0:30 ` [U-Boot] [PATCH v2] " Thomas Chou
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Chou @ 2010-03-27 23:20 UTC (permalink / raw)
To: u-boot
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,
#define CONFIG_ALTERA_JTAG_UART_BYPASS
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
drivers/serial/altera_jtag_uart.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/serial/altera_jtag_uart.c b/drivers/serial/altera_jtag_uart.c
index 9eccaa0..54d481b 100644
--- a/drivers/serial/altera_jtag_uart.c
+++ b/drivers/serial/altera_jtag_uart.c
@@ -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 (&jtag->data, (unsigned char)c);
}
--
1.6.6.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* [U-Boot] [PATCH v2] altera_jtag_uart: bypass when no jtag connection
2010-03-27 23:20 [U-Boot] [PATCH] altera_jtag_uart: bypass when no jtag connection Thomas Chou
@ 2010-03-31 0:30 ` Thomas Chou
2010-04-23 1:38 ` Scott McNutt
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Chou @ 2010-03-31 0:30 UTC (permalink / raw)
To: u-boot
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,
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
follow the "Fix outx/writex parameter order in io.h" patch from Scott.
drivers/serial/altera_jtag_uart.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/serial/altera_jtag_uart.c b/drivers/serial/altera_jtag_uart.c
index fb28aa9..2980e4d 100644
--- a/drivers/serial/altera_jtag_uart.c
+++ b/drivers/serial/altera_jtag_uart.c
@@ -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);
}
--
1.6.6.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* [U-Boot] [PATCH v2] altera_jtag_uart: bypass when no jtag connection
2010-03-31 0:30 ` [U-Boot] [PATCH v2] " Thomas Chou
@ 2010-04-23 1:38 ` Scott McNutt
0 siblings, 0 replies; 3+ messages in thread
From: Scott McNutt @ 2010-04-23 1:38 UTC (permalink / raw)
To: u-boot
Applied. Thanks.
--Scott
Thomas Chou wrote:
> 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,
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
> follow the "Fix outx/writex parameter order in io.h" patch from Scott.
>
> drivers/serial/altera_jtag_uart.c | 12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/serial/altera_jtag_uart.c b/drivers/serial/altera_jtag_uart.c
> index fb28aa9..2980e4d 100644
> --- a/drivers/serial/altera_jtag_uart.c
> +++ b/drivers/serial/altera_jtag_uart.c
> @@ -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);
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-23 1:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-27 23:20 [U-Boot] [PATCH] altera_jtag_uart: bypass when no jtag connection Thomas Chou
2010-03-31 0:30 ` [U-Boot] [PATCH v2] " Thomas Chou
2010-04-23 1:38 ` Scott McNutt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox