summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/shared/console/uart.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2004-11-10 23:51:17 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2004-11-10 23:51:17 +0000
commite79a194755c89fc9330ce74d6af450fa7c18c802 (patch)
tree8b4ba416f0d5996b89bb1a342e8b40b84d86b42e /c/src/lib/libbsp/powerpc/shared/console/uart.c
parent2004-11-10 Richard Campbell <richard.campbell@oarcorp.com> (diff)
downloadrtems-e79a194755c89fc9330ce74d6af450fa7c18c802.tar.bz2
2004-11-10 Richard Campbell <richard.campbell@oarcorp.com>
* Makefile.am, bootloader/misc.c, bootloader/pci.c, bootloader/pci.h, console/console.c, console/inch.c, console/reboot.c, console/uart.c, console/uart.h, irq/irq.c, irq/irq.h, irq/irq_init.c, motorola/motorola.c, motorola/motorola.h, openpic/openpic.c, openpic/openpic.h, pci/detect_raven_bridge.c, pci/pci.c, start/start.S, startup/bspstart.c, vectors/vectors_init.c, vme/vmeconfig.c: Add MVME2100 BSP and MPC8240 support. There was also a significant amount of spelling and whitespace cleanup. * tod/todcfg.c: New file.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/powerpc/shared/console/uart.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/powerpc/shared/console/uart.c b/c/src/lib/libbsp/powerpc/shared/console/uart.c
index 2532bef720..dc09a73608 100644
--- a/c/src/lib/libbsp/powerpc/shared/console/uart.c
+++ b/c/src/lib/libbsp/powerpc/shared/console/uart.c
@@ -200,8 +200,8 @@ BSP_uart_set_baud(int uart, int baud)
/*
* This function may be called whenever TERMIOS parameters
- * are changed, so we have to make sire that baud change is
- * indeed required
+ * are changed, so we have to make sure that baud change is
+ * indeed required.
*/
if(baud == uart_data[uart].baud)
@@ -458,8 +458,14 @@ uart_noop(const rtems_irq_connect_data *unused)
static int
uart_isr_is_on(const rtems_irq_connect_data *irq)
{
-int uart = (irq->name == BSP_ISA_UART_COM1_IRQ) ?
+ int uart;
+
+#if defined(mvme2100)
+ uart = BSP_UART_COM1;
+#else
+ uart = (irq->name == BSP_ISA_UART_COM1_IRQ) ?
BSP_UART_COM1 : BSP_UART_COM2;
+#endif
return uread(uart,IER);
}
@@ -467,8 +473,12 @@ static int
doit(int uart, rtems_irq_hdl handler, int (*p)(const rtems_irq_connect_data*))
{
rtems_irq_connect_data d={0};
+#if defined(mvme2100)
+ d.name = BSP_UART_COM1_IRQ;
+#else
d.name = (uart == BSP_UART_COM1) ?
BSP_ISA_UART_COM1_IRQ : BSP_ISA_UART_COM2_IRQ;
+#endif
d.off = d.on = uart_noop;
d.isOn = uart_isr_is_on;
d.hdl = handler;
@@ -523,6 +533,21 @@ BSP_uart_termios_set(int uart, void *ttyp)
}
int
+BSP_uart_termios_write_polled(int minor, const char *buf, int len)
+{
+ int uart=minor; /* could differ, theoretically */
+ int nwrite;
+ const char *b = buf;
+
+ assert(buf != NULL);
+
+ for (nwrite=0 ; nwrite < len ; nwrite++) {
+ BSP_uart_polled_write(uart, *b++);
+ }
+ return nwrite;
+}
+
+int
BSP_uart_termios_write_com(int minor, const char *buf, int len)
{
int uart=minor; /* could differ, theoretically */
@@ -533,7 +558,7 @@ BSP_uart_termios_write_com(int minor, const char *buf, int len)
return 0;
}
- /* If there TX buffer is busy - something is royally screwed up */
+ /* If the TX buffer is busy - something is royally screwed up */
/* assert((uread(BSP_UART_COM1, LSR) & THRE) != 0); */
if(termios_stopped_com[uart])