diff options
author | imp <imp@FreeBSD.org> | 2013-12-23 01:24:32 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2013-12-23 01:24:32 +0000 |
commit | 8313ffe0353eb13f1fe633cc21dc1fdb720949b5 (patch) | |
tree | 1d3720759b7a56a576b3b717d0f900c9350b951e /sys/arm/at91 | |
parent | d08ecc86b4bcc22a4c54676370e6d87b43de66d0 (diff) | |
download | FreeBSD-src-8313ffe0353eb13f1fe633cc21dc1fdb720949b5.zip FreeBSD-src-8313ffe0353eb13f1fe633cc21dc1fdb720949b5.tar.gz |
MFC r259685:
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.
Approved by: re@ (gjb@)
Diffstat (limited to 'sys/arm/at91')
-rw-r--r-- | sys/arm/at91/uart_dev_at91usart.c | 16 |
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 |