All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: "open list:RISC-V" <qemu-riscv@nongnu.org>,
	 "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Alistair Francis <Alistair.Francis@wdc.com>,
	 Palmer Dabbelt <palmer@sifive.com>,
	Bastian Koppelmann <kbastian@mail.uni-paderborn.de>,
	 Sagar Karandikar <sagark@eecs.berkeley.edu>
Subject: Re: [Qemu-riscv] [Qemu-devel] [PATCH 1/2] riscv: sifive_uart: Generate TX interrupt
Date: Mon, 18 Mar 2019 10:58:20 -0700	[thread overview]
Message-ID: <CAKmqyKOQNWOf6RSse2o9qHvwvZPdBzkwShTc81YWpBT3mQBwWA@mail.gmail.com> (raw)
In-Reply-To: <1552809791-7714-1-git-send-email-bmeng.cn@gmail.com>

On Sun, Mar 17, 2019 at 1:24 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> At present the sifive uart model only generates RX interrupt. This
> updates it to generate TX interrupt so that it is more useful.
>
> Note the TX fifo is still unimplemented.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>
>  hw/riscv/sifive_uart.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/riscv/sifive_uart.c b/hw/riscv/sifive_uart.c
> index 456a3d3..3b3f94f 100644
> --- a/hw/riscv/sifive_uart.c
> +++ b/hw/riscv/sifive_uart.c
> @@ -51,7 +51,8 @@ static uint64_t uart_ip(SiFiveUARTState *s)
>  static void update_irq(SiFiveUARTState *s)
>  {
>      int cond = 0;
> -    if ((s->ie & SIFIVE_UART_IE_RXWM) && s->rx_fifo_len) {
> +    if ((s->ie & SIFIVE_UART_IE_TXWM) ||
> +        ((s->ie & SIFIVE_UART_IE_RXWM) && s->rx_fifo_len)) {
>          cond = 1;
>      }
>      if (cond) {
> @@ -108,6 +109,7 @@ uart_write(void *opaque, hwaddr addr,
>      switch (addr) {
>      case SIFIVE_UART_TXFIFO:
>          qemu_chr_fe_write(&s->chr, &ch, 1);
> +        update_irq(s);
>          return;
>      case SIFIVE_UART_IE:
>          s->ie = val64;
> --
> 2.7.4
>
>


      parent reply	other threads:[~2019-03-18 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-17  8:03 [Qemu-riscv] [PATCH 1/2] riscv: sifive_uart: Generate TX interrupt Bin Meng
2019-03-17  8:03 ` [Qemu-riscv] [PATCH 2/2] riscv: sifive_u: Correct UART0's IRQ in the device tree Bin Meng
2019-03-18 17:57   ` [Qemu-riscv] [Qemu-devel] " Alistair Francis
2019-03-18 17:58 ` Alistair Francis [this message]

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=CAKmqyKOQNWOf6RSse2o9qHvwvZPdBzkwShTc81YWpBT3mQBwWA@mail.gmail.com \
    --to=alistair23@gmail.com \
    --cc=Alistair.Francis@wdc.com \
    --cc=bmeng.cn@gmail.com \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=palmer@sifive.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=sagark@eecs.berkeley.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.