[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] hw/char/pl011: check if UART is enabled before RX or TX
From: |
Peter Maydell |
Subject: |
Re: [PATCH 2/2] hw/char/pl011: check if UART is enabled before RX or TX operation |
Date: |
Tue, 17 Jan 2023 15:38:26 +0000 |
On Fri, 6 Jan 2023 at 17:29, Evgeny Iakovlev
<eiakovlev@linux.microsoft.com> wrote:
>
> UART should be enabled in general and have RX enabled specifically to be
> able to receive data from peripheral device. Same goes for transmitting
> data to peripheral device and a TXE flag.
>
> Check if UART CR register has EN and RXE or TXE bits enabled before
> trying to receive or transmit data.
I wonder if the real hardware lets you fill the TX fifo
when TXE or EN are clear (and then transmits it when
you enable tx later)? That seems kind of an odd corner
case to implement, though, and the TRM doesn't specifically
say one way or the other, so it doesn't seem worth the bother.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
I notice this device doesn't have a reset method, incidentally,
which is probably something we should fix.
thanks
-- PMM
[PATCH 2/2] hw/char/pl011: check if UART is enabled before RX or TX operation, Evgeny Iakovlev, 2023/01/06
- Re: [PATCH 2/2] hw/char/pl011: check if UART is enabled before RX or TX operation,
Peter Maydell <=