This is the mail archive of the
newlib-cvs@sourceware.org
mailing list for the newlib project.
[newlib-cygwin/cygwin-2.0] or1k: UART also accept timeout interrupt
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: newlib-cvs at sourceware dot org
- Date: 27 May 2015 11:31:55 -0000
- Subject: [newlib-cygwin/cygwin-2.0] or1k: UART also accept timeout interrupt
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=aa26b784620268135cab52d77ffb39129cd1fb1f
commit aa26b784620268135cab52d77ffb39129cd1fb1f
Author: Jeff Johnston <jjohnstn@redhat.com>
Date: Tue May 26 15:27:02 2015 -0400
or1k: UART also accept timeout interrupt
- The UART interrupt only handled receiver FIFO full interrupts, but we
also want to handle timeout interrupts.
* or1k/or1k_uart.c: Fix interrupts
Diff:
---
libgloss/ChangeLog | 4 ++++
libgloss/or1k/or1k_uart.c | 8 +++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog
index 77137f0..6b3fe3c 100644
--- a/libgloss/ChangeLog
+++ b/libgloss/ChangeLog
@@ -1,5 +1,9 @@
2015-05-26 Stefan Wallentowitz <stefan.wallentowitz@tum.de>
+ * or1k/or1k_uart.c: Fix interrupts
+
+2015-05-26 Stefan Wallentowitz <stefan.wallentowitz@tum.de>
+
* or1k/timer.c: Properly set interrupt flags
2015-05-26 Stefan Wallentowitz <stefan.wallentowitz@tum.de>
diff --git a/libgloss/or1k/or1k_uart.c b/libgloss/or1k/or1k_uart.c
index e5b539a..0a991e6 100644
--- a/libgloss/or1k/or1k_uart.c
+++ b/libgloss/or1k/or1k_uart.c
@@ -94,9 +94,11 @@ void _or1k_uart_interrupt_handler(uint32_t data)
{
uint8_t iir = REG8(IIR);
- // Check if this is a read fifo interrupt, bit 0 indicates pending
- // interrupt and the other bits are IIR_RDA
- if (!(iir & 0x1) || ((iir & 0xfe) != IIR_RDA)) {
+ // Check if this is a read fifo or timeout interrupt, bit 0
+ // indicates pending interrupt and the other bits are IIR_RDA
+ // or IIR_TO
+ if (!(iir & 0x1) || ((iir & 0xfe) != IIR_RDA) ||
+ ((iir & 0xfe) != IIR_TO)) {
return;
}