This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 5/8] or1k: UART also accept timeout interrupt


The UART interrupt only handled receiver FIFO full interrupts, but we
also want to handle timeout interrupts.

libgloss/Changelog:
    * or1k/or1k_uart.c: Fix interrupts

>From 6eb51dc12618d8df43f33b5bcc116dda1b279a58 Mon Sep 17 00:00:00 2001
From: Stefan Wallentowitz <stefan.wallentowitz@tum.de>
Date: Wed, 15 Apr 2015 09:24:34 +0200
Subject: [PATCH 5/8] or1k: UART also accept timeout interrupt

The UART interrupt only handled receiver FIFO full interrupts, but we
also want to handle timeout interrupts.

libgloss/Changelog:
	* or1k/or1k_uart.c: Fix interrupts
---
 libgloss/or1k/or1k_uart.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

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;
 	}
 
-- 
2.1.4



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]