aboutsummaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorMartin Kaiser <martin@kaiser.cx>2023-06-15 15:22:56 +0100
committerPeter Maydell <peter.maydell@linaro.org>2023-06-19 11:35:58 +0100
commitbd96e10071e4d44eea9b9c8888ed12d2f9d8fae9 (patch)
treee477ce61ea77c23cf3decfba11bac3e3e4f3ec44 /include/hw
parent93faf3b9c9396bc06da4a380de67637334b1143d (diff)
downloadqemu-bd96e10071e4d44eea9b9c8888ed12d2f9d8fae9.zip
qemu-bd96e10071e4d44eea9b9c8888ed12d2f9d8fae9.tar.gz
qemu-bd96e10071e4d44eea9b9c8888ed12d2f9d8fae9.tar.bz2
imx_serial: set wake bit when we receive a data byte
The Linux kernel added a flood check for RX data recently in commit 496a4471b7c3 ("serial: imx: work-around for hardware RX flood"). This check uses the wake bit in the UART status register 2. The wake bit indicates that the receiver detected a start bit on the RX line. If the kernel sees a number of RX interrupts without the wake bit being set, it treats this as spurious data and resets the UART port. imx_serial does never set the wake bit and triggers the kernel's flood check. This patch adds support for the wake bit. wake is set when we receive a new character (it's not set for break events). It seems that wake is cleared by the kernel driver, the hardware does not have to clear it automatically after data was read. The wake bit can be configured as an interrupt source. Support this mechanism as well. Co-developed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/char/imx_serial.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/hw/char/imx_serial.h b/include/hw/char/imx_serial.h
index 91c9894..b823f94 100644
--- a/include/hw/char/imx_serial.h
+++ b/include/hw/char/imx_serial.h
@@ -71,6 +71,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(IMXSerialState, IMX_SERIAL)
#define UCR4_DREN BIT(0) /* Receive Data Ready interrupt enable */
#define UCR4_TCEN BIT(3) /* TX complete interrupt enable */
+#define UCR4_WKEN BIT(7) /* WAKE interrupt enable */
#define UTS1_TXEMPTY (1<<6)
#define UTS1_RXEMPTY (1<<5)