qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eden Mikitas <e.mikitas@gmail.com>
To: peter.maydell@linaro.org
Cc: qemu-trivial@nongnu.org, alistair@alistair23.me,
	qemu-devel@nongnu.org, jcd@tribudubois.net, qemu-arm@nongnu.org,
	peter.chubb@nicta.com.au, e.mikitas@gmail.com
Subject: [PATCH 2/2] hw/ssi/imx_spi: Removed unnecessary cast of rx data received from slave
Date: Fri, 22 May 2020 14:50:36 +0300	[thread overview]
Message-ID: <20200522115036.31516-3-e.mikitas@gmail.com> (raw)
In-Reply-To: <20200522115036.31516-1-e.mikitas@gmail.com>

When inserting the value retrieved (rx) from the spi slave, rx is pushed to
rx_fifo after being cast to uint8_t. rx_fifo is a fifo32, and the rx
register the driver uses is also 32 bit. This zeroes the 24 most
significant bits of rx. This proved problematic with devices that expect to
use the whole 32 bits of the rx register.

Signed-off-by: Eden Mikitas <e.mikitas@gmail.com>
---
 hw/ssi/imx_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c
index 6fef5c7958..43b2f14dd2 100644
--- a/hw/ssi/imx_spi.c
+++ b/hw/ssi/imx_spi.c
@@ -206,7 +206,7 @@ static void imx_spi_flush_txfifo(IMXSPIState *s)
         if (fifo32_is_full(&s->rx_fifo)) {
             s->regs[ECSPI_STATREG] |= ECSPI_STATREG_RO;
         } else {
-            fifo32_push(&s->rx_fifo, (uint8_t)rx);
+            fifo32_push(&s->rx_fifo, rx);
         }
 
         if (s->burst_length <= 0) {
-- 
2.17.1



  parent reply	other threads:[~2020-05-22 11:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20 14:32 [PATCH] ssi/imx_spi: Removed unnecessary cast and fixed condition in while statement Eden Mikitas
2020-05-21 16:41 ` Peter Maydell
2020-05-21 18:49   ` Eden Mikitas
2020-05-21 18:56     ` Peter Maydell
2020-05-22 11:50       ` [PATCH 0/2] hw/ssi/imx_spi: 2 Fixes to flush txfifo function in imx_spi Eden Mikitas
2020-05-22 11:50         ` [PATCH 1/2] hw/ssi/imx_spi: changed while statement to prevent underflow Eden Mikitas
2020-05-22 15:34           ` Alistair Francis
2020-05-22 11:50         ` Eden Mikitas [this message]
2020-05-22 15:36           ` [PATCH 2/2] hw/ssi/imx_spi: Removed unnecessary cast of rx data received from slave Alistair Francis
2020-05-29 13:03         ` [PATCH 0/2] hw/ssi/imx_spi: 2 Fixes to flush txfifo function in imx_spi 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=20200522115036.31516-3-e.mikitas@gmail.com \
    --to=e.mikitas@gmail.com \
    --cc=alistair@alistair23.me \
    --cc=jcd@tribudubois.net \
    --cc=peter.chubb@nicta.com.au \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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).