summaryrefslogtreecommitdiffstats
path: root/sys/arm/at91/uart_dev_at91usart.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2013-12-21 16:23:31 +0000
committerimp <imp@FreeBSD.org>2013-12-21 16:23:31 +0000
commit0c0507101538eccdd84801e85cda5f9fdc73e7e4 (patch)
treefb9135c583a3997dac6217835ef5597d0d89215a /sys/arm/at91/uart_dev_at91usart.c
parent33f08bf94db6b89f21884b640b39be779a14538d (diff)
downloadFreeBSD-src-0c0507101538eccdd84801e85cda5f9fdc73e7e4.zip
FreeBSD-src-0c0507101538eccdd84801e85cda5f9fdc73e7e4.tar.gz
Plumb the cn_grab and cn_ungrab routines down into the uart
clients. Mask RX interrupts while grabbed on the atmel serial driver. This UART interrupts every character. When interrupts are enabled at the mountroot> prompt, this means the ISR eats the characters. Rather than try to create a cooperative buffering system for the low level kernel console, instead just mask out the ISR. For NS8250 and decsendents this isn't needed, since interrupts only happen after 14 or more characters (depending on the fifo settings). Plumb such that these are optional so there's no change in behavior for all the other UART clients. ddb worked on this platform because all interrupts were disabled while it was running, so this problem wasn't noticed. The mountroot> issue has been around for a very very long time. MFC after: 3 days
Diffstat (limited to 'sys/arm/at91/uart_dev_at91usart.c')
-rw-r--r--sys/arm/at91/uart_dev_at91usart.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/arm/at91/uart_dev_at91usart.c b/sys/arm/at91/uart_dev_at91usart.c
index 9bc4dbf..43655b6 100644
--- a/sys/arm/at91/uart_dev_at91usart.c
+++ b/sys/arm/at91/uart_dev_at91usart.c
@@ -219,6 +219,20 @@ at91_usart_param(struct uart_bas *bas, int baudrate, int databits,
return (0);
}
+static void
+at91_usart_grab(struct uart_bas *bas)
+{
+
+ WR4(bas, USART_IDR, USART_CSR_RXRDY);
+}
+
+static void
+at91_usart_ungrab(struct uart_bas *bas)
+{
+
+ WR4(bas, USART_IER, USART_CSR_RXRDY);
+}
+
static struct uart_ops at91_usart_ops = {
.probe = at91_usart_probe,
.init = at91_usart_init,
@@ -226,6 +240,8 @@ static struct uart_ops at91_usart_ops = {
.putc = at91_usart_putc,
.rxready = at91_usart_rxready,
.getc = at91_usart_getc,
+ .grab = at91_usart_grab,
+ .ungrab = at91_usart_ungrab,
};
static int
OpenPOWER on IntegriCloud