[Qemu-devel] [PATCH] imx_serial: Generate interrupt on receive data ready if enabled

Hans-Erik Floryd posted 1 patch 7 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1534341354-11956-1-git-send-email-hans-erik.floryd@rt-labs.com
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test docker-quick@centos7 passed
hw/char/imx_serial.c         | 3 ++-
include/hw/char/imx_serial.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
[Qemu-devel] [PATCH] imx_serial: Generate interrupt on receive data ready if enabled
Posted by Hans-Erik Floryd 7 years, 2 months ago
Generate an interrupt if USR2_RDR and UCR4_DREN are both set.

Signed-off-by: Hans-Erik Floryd <hans-erik.floryd@rt-labs.com>
---
 hw/char/imx_serial.c         | 3 ++-
 include/hw/char/imx_serial.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c
index 0747db9..1e36319 100644
--- a/hw/char/imx_serial.c
+++ b/hw/char/imx_serial.c
@@ -74,8 +74,9 @@ static void imx_update(IMXSerialState *s)
     mask = (s->ucr1 & UCR1_TXMPTYEN) ? USR2_TXFE : 0;
     /*
      * TCEN and TXDC are both bit 3
+     * RDR and DREN are both bit 0
      */
-    mask |= s->ucr4 & UCR4_TCEN;
+    mask |= s->ucr4 & (UCR4_TCEN | UCR4_DREN);
 
     usr2 = s->usr2 & mask;
 
diff --git a/include/hw/char/imx_serial.h b/include/hw/char/imx_serial.h
index ee80da1..c8b7428 100644
--- a/include/hw/char/imx_serial.h
+++ b/include/hw/char/imx_serial.h
@@ -68,6 +68,7 @@
 #define UCR2_RXEN       (1<<1)    /* Receiver enable */
 #define UCR2_SRST       (1<<0)    /* Reset complete */
 
+#define UCR4_DREN       BIT(0)    /* Receive Data Ready interrupt enable */
 #define UCR4_TCEN       BIT(3)    /* TX complete interrupt enable */
 
 #define UTS1_TXEMPTY    (1<<6)
-- 
2.7.4


Re: [Qemu-devel] [PATCH] imx_serial: Generate interrupt on receive data ready if enabled
Posted by Peter Maydell 7 years, 2 months ago
On 15 August 2018 at 14:55, Hans-Erik Floryd
<hans-erik.floryd@rt-labs.com> wrote:
> Generate an interrupt if USR2_RDR and UCR4_DREN are both set.
>
> Signed-off-by: Hans-Erik Floryd <hans-erik.floryd@rt-labs.com>
> ---
>  hw/char/imx_serial.c         | 3 ++-
>  include/hw/char/imx_serial.h | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)



Applied to target-arm.next, thanks.

-- PMM