Skip to content

Commit

Permalink
imx_serial: Generate interrupt on receive data ready if enabled
Browse files Browse the repository at this point in the history
Generate an interrupt if USR2_RDR and UCR4_DREN are both set.

Signed-off-by: Hans-Erik Floryd <hans-erik.floryd@rt-labs.com>
Message-id: 1534341354-11956-1-git-send-email-hans-erik.floryd@rt-labs.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
hefloryd authored and pm215 committed Aug 20, 2018
1 parent 84be3ef commit 3c54cf7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hw/char/imx_serial.c
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions include/hw/char/imx_serial.h
Expand Up @@ -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)
Expand Down

0 comments on commit 3c54cf7

Please sign in to comment.