All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
	"Bin Meng" <bin.meng@processmission.com>,
	QEMU <qemu-devel@nongnu.org>
Cc: Alistair Francis <alistair@alistair23.me>,
	Hanna Reitz <hreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org
Subject: Re: [PATCH v2 04/10] hw/block: m25p80: Fix dummy byte handling for Spansion flash
Date: Tue, 7 Jul 2026 16:26:14 +0200	[thread overview]
Message-ID: <20d58663-a8d1-41ff-9348-cae4982c30f0@redhat.com> (raw)
In-Reply-To: <a13c292e-fa89-4953-9893-d09629ac9872@redhat.com>

Bin, Philippe,

On 7/7/26 16:05, Cédric Le Goater wrote:
> 
>>> This breaks the test_arm_emcraft_sf2 functional test:
>>>
>>> not ok 1 test_emcraft_sf2.EmcraftSf2Machine.test_arm_emcraft_sf2
>>>
>>
>>
>> No problem on my side.
>>
> Sorry. you are right ! It fails too.
> 
> So we have a machine using a Spansion flash.
> 
>      spi_flash = qdev_new("s25sl12801"); /* Spansion S25FL128SDPBHICO */
> 
> 
> C.


Here is the fix. Feel free to merge in patch 4.

Thanks,

C.

 From 17ae23e5bc3629a5a301f14f47125f6f685ca9d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= <clg@redhat.com>
Date: Tue, 7 Jul 2026 16:23:29 +0200
Subject: [PATCH] hw/arm/msf2-som: Fix spansion-cr2nv value for S25FL128S
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The emcraft-sf2 board set spansion-cr2nv to 1, which the old m25p80
code treated as a byte count. With the dummy cycle to byte conversion
fix, CR2V=1 at SPI x1 is 1 bit, not byte-aligned, and triggers an
assertion. Use the S25FL128S default of 0x8 (8 cycles = 1 byte at
SPI x1), preserving the same runtime behavior.

Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
  hw/arm/msf2-som.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c
index caf6e7e1ad7d..1ada1a136130 100644
--- a/hw/arm/msf2-som.c
+++ b/hw/arm/msf2-som.c
@@ -84,7 +84,7 @@ static void emcraft_sf2_s2s010_init(MachineState *machine)
      /* Attach SPI flash to SPI0 controller */
      spi_bus = qdev_get_child_bus(dev, "spi0");
      spi_flash = qdev_new("s25sl12801"); /* Spansion S25FL128SDPBHICO */
-    qdev_prop_set_uint8(spi_flash, "spansion-cr2nv", 1);
+    qdev_prop_set_uint8(spi_flash, "spansion-cr2nv", 0x8);
      if (dinfo) {
          qdev_prop_set_drive_err(spi_flash, "drive",
                                  blk_by_legacy_dinfo(dinfo), &error_fatal);
-- 
2.54.0



  reply	other threads:[~2026-07-07 14:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07  8:34 [PATCH v2 00/10] hw/{block, ssi}: Fix spi-nor flash dummy byte handling Bin Meng via qemu development
2026-07-07  8:34 ` Bin Meng via
2026-07-07  8:34 ` [PATCH v2 01/10] hw/block: m25p80: Fix dummy byte handling for Winbond flash Bin Meng
2026-07-07  8:34 ` [PATCH v2 02/10] hw/block: m25p80: Fix dummy byte handling for Numonyx/Micron flash Bin Meng
2026-07-07  8:34 ` [PATCH v2 03/10] hw/block: m25p80: Fix dummy byte handling for Macronix flash Bin Meng
2026-07-07  8:34 ` [PATCH v2 04/10] hw/block: m25p80: Fix dummy byte handling for Spansion flash Bin Meng
2026-07-07 12:34   ` Philippe Mathieu-Daudé
2026-07-07 12:51     ` Cédric Le Goater
2026-07-07 14:00       ` Philippe Mathieu-Daudé
2026-07-07 14:05       ` Cédric Le Goater
2026-07-07 14:26         ` Cédric Le Goater [this message]
2026-07-07 14:49           ` Bin Meng
2026-07-07 15:05           ` Philippe Mathieu-Daudé
2026-07-07  8:34 ` [PATCH v2 05/10] hw/ssi: npcm7xx_fiu: Correct the dummy cycle emulation logic Bin Meng
2026-07-07  8:34 ` [PATCH v2 06/10] hw/ssi: xilinx_spips: Fix dummy phase handling Bin Meng
2026-07-07  8:34 ` [PATCH v2 07/10] hw/ssi: aspeed_smc: Fix direct-read dummy bytes Bin Meng
2026-07-07  8:34 ` [PATCH v2 08/10] Revert "aspeed/smc: Fix number of dummy cycles for FAST_READ_4 command" Bin Meng
2026-07-07  8:34 ` [PATCH v2 09/10] Revert "aspeed/smc: snoop SPI transfers to fake dummy cycles" Bin Meng
2026-07-07  8:34 ` [PATCH v2 10/10] docs/devel: Document SSI dummy-cycle ownership Bin Meng
2026-07-07 13:10   ` Philippe Mathieu-Daudé
2026-07-07  9:11 ` [PATCH v2 00/10] hw/{block,ssi}: Fix spi-nor flash dummy byte handling Cédric Le Goater

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=20d58663-a8d1-41ff-9348-cae4982c30f0@redhat.com \
    --to=clg@redhat.com \
    --cc=alistair@alistair23.me \
    --cc=bin.meng@processmission.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=qemu-block@nongnu.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 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.