qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 8/8] hw/char/escc2: Add XRES command


From: Jasper Lowell
Subject: [PATCH 8/8] hw/char/escc2: Add XRES command
Date: Wed, 17 Jun 2020 18:24:02 +1000

The Transmitter Reset (XRES) command is used for clearing the the
transmit FIFO of any data. When the controller has completed the
command, an XPR interrupt is generated (if this interrupt is enabled).

Signed-off-by: Jasper Lowell <jasper.lowell@bt.com>
---
 hw/char/escc2.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/char/escc2.c b/hw/char/escc2.c
index 3bacdfaa7c..a40731b836 100644
--- a/hw/char/escc2.c
+++ b/hw/char/escc2.c
@@ -790,6 +790,11 @@ static void escc2_channel_command(ESCC2ChannelState 
*channel)
          */
         command &= REGISTER_CMDR_XRES;
     }
+
+    if (command & REGISTER_CMDR_XRES) {
+        memset(channel->fifo_transmit, 0, sizeof(channel->fifo_transmit));
+        escc2_channel_irq_event(channel, REGISTER_ISR1, REGISTER_ISR1_XPR);
+    }
 }
 
 static void escc2_mem_write(void *opaque, hwaddr addr, uint64_t value,
-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]