qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Rob Herring <robherring2@gmail.com>
Cc: Rob Herring <rob.herring@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Christoffer Dall <christoffer.dall@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] pl011: fix corrupting the UARTCR value
Date: Fri, 28 Feb 2014 10:41:12 +0000	[thread overview]
Message-ID: <CAFEAcA8yQMTF-XUK3D6-UcD7KBtWxH2Q+xs++1VCjhYnN474sg@mail.gmail.com> (raw)
In-Reply-To: <1393551441-18041-1-git-send-email-robherring2@gmail.com>

On 28 February 2014 01:37, Rob Herring <robherring2@gmail.com> wrote:
> From: Rob Herring <rob.herring@linaro.org>
>
> Offset 4 is UARTRSR/UARTECR, not the UARTCR. As framing and parity errors
> will never occur, we can ignore writes to this register.

It's true that we'll never get framing or parity errors,
but we can get break (and we ought to get overrun if we
implemented it properly). This should be fairly easy to
implement:
 * add rsr to the state struct
 * clear it on reset [ideally, extra patch to pull reset out
   of the pl011_init fn into an actual device reset method]
 * writes to UARTRSR clear rsr
 * reads from UARTRSR return rsr
 * in the code for read of UARTDR, copy bits [10:8] of
   the value we're about to return into rsr [2:1]
   (break/parity/framing)
 * for overrun, we should set the rsr bit in pl011_put_fifo
   if the fifo is full; however, it looks from that function
   as if we don't properly implement the documented behaviour
   for a full fifo (s2.4.3 "UART operation" of the PL011 TRM
   is a pretty clear description) so I'd be OK with just adding
   a comment to pl011_put_fifo():
   /* FIXME: FIFO overrun handling of excess data and setting
    * overrun status bits is not correctly implemented:
    * see PL011 TRM s2.4.3 "UART operation".
    */
   (Of course if you want to implement overrun properly
   feel free ;-))

thanks
-- PMM

  reply	other threads:[~2014-02-28 10:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28  1:37 [Qemu-devel] [PATCH] pl011: fix corrupting the UARTCR value Rob Herring
2014-02-28 10:41 ` Peter Maydell [this message]
2014-02-28 13:41   ` Rob Herring
2014-02-28 13:43     ` Peter Maydell

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=CAFEAcA8yQMTF-XUK3D6-UcD7KBtWxH2Q+xs++1VCjhYnN474sg@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rob.herring@linaro.org \
    --cc=robherring2@gmail.com \
    /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).