From: Richard Braun <rbraun@sceen.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Alistair Francis <alistair@alistair23.me>
Subject: Re: [Qemu-devel] [PATCH] hw/char/stm32f2xx_usart: improve TXE/TC bit handling
Date: Fri, 9 Feb 2018 10:23:13 +0100 [thread overview]
Message-ID: <20180209092313.GA27456@shattrath> (raw)
In-Reply-To: <CAFEAcA_XagA3SuqNTHd06nH4nTXTNztRBAYOQxF8cJmaVXBhoQ@mail.gmail.com>
On Thu, Feb 08, 2018 at 02:58:29PM +0000, Peter Maydell wrote:
> On 4 February 2018 at 20:41, Richard Braun <rbraun@sceen.net> wrote:
> > Consider that data is always immediately sent. As a result, keep
> > the SR_TXE and SR_TC bits always set. In addition, fix the reset value
> > of the USART status register.
>
> Do you know what the data sheet means when it says that TC
> can be cleared by "a read from the USART_SR register followed
> by a write to the USART_DR register" ?
It's meant for software either polling the TC bit or waiting for a
transmission complete interrupt. Once the bit is seen, the next
transmission automatically clears it.
> If we supported interrupts properly (which we don't seem to)
> I suspect we'd need something more than "TXE and TC are always set",
> or the guest would probably never clear the TXE and TC interrupts.
That's the idea of the patch. Since everything is currently synchronous,
there is no need for these transient states to even exist.
> The guest can clear the TC and TXE bits by writing to the USART_SR
> directly, so this code should set both of them, I think ?
Right, nice catch.
--
Richard Braun
next prev parent reply other threads:[~2018-02-09 9:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-04 20:41 [Qemu-devel] [PATCH] hw/char/stm32f2xx_usart: improve TXE/TC bit handling Richard Braun
2018-02-08 14:58 ` Peter Maydell
2018-02-08 23:33 ` Alistair Francis
2018-02-09 9:36 ` Richard Braun
2018-02-13 20:54 ` [Qemu-devel] [PATCH v2] hw/char/stm32f2xx_usart: fix " Richard Braun
2018-02-15 22:27 ` Alistair Francis
2018-02-22 11:18 ` Peter Maydell
2018-02-09 9:23 ` Richard Braun [this message]
2018-02-09 9:35 ` [Qemu-devel] [PATCH] hw/char/stm32f2xx_usart: improve " Richard Braun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180209092313.GA27456@shattrath \
--to=rbraun@sceen.net \
--cc=alistair@alistair23.me \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).