qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-for-10.1 v2 00/11] hw/sd: Fix SD cards in SPI mode
@ 2025-08-04 13:33 Philippe Mathieu-Daudé
  2025-08-04 13:33 ` [PATCH-for-10.1 v2 01/11] hw/sd/sdcard: Do not ignore errors in sd_cmd_to_sendingdata() Philippe Mathieu-Daudé
                   ` (13 more replies)
  0 siblings, 14 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-08-04 13:33 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Philippe Mathieu-Daudé, Ben Dooks, qemu-riscv, qemu-block,
	qemu-arm, Guenter Roeck, Bin Meng

Since v1:
- new patch factoring sd_response_size() out (Richard)

This series fix a pair of issues with SD cards used wired
via a SPI link / controller.

Such mode implementation was minimal. I was testing it with
the ARM Gumstix machines, but we remove them in the v9.2.0
release (commit a2ccff4d2bc ), so they bit-rotted.

Although the series looks big, I shrinked it a lot to have
the minimum amount of meaningful changes. Other changes
added during debugging will be shared later, as I believe
they will still be useful to debug other future issues.

The last patch add testing coverage, to avoid further bitrot.

Regards,

Phil.

Philippe Mathieu-Daudé (11):
  hw/sd/sdcard: Do not ignore errors in sd_cmd_to_sendingdata()
  hw/sd/sdcard: Factor sd_response_size() out
  hw/sd/sdbus: Provide buffer size to sdbus_do_command()
  hw/sd/sdcard: Fill SPI response bits in card code
  hw/sd/sdcard: Implement SPI R2 return value
  hw/sd/sdcard: Use complete SEND_OP_COND implementation in SPI mode
  hw/sd/sdcard: Allow using SWITCH_FUNCTION in more SPI states
  hw/sd/sdcard: Factor spi_cmd_SEND_CxD() out
  hw/sd/sdcard: Disable checking STBY mode in SPI SEND_CSD/CID
  hw/sd/sdcard: Remove SDState::mode field
  tests/functional: Test SD cards in SPI mode (using sifive_u machine)

 MAINTAINERS                               |   1 +
 include/hw/sd/sd.h                        |  23 ++-
 hw/sd/allwinner-sdhost.c                  |   7 +-
 hw/sd/bcm2835_sdhost.c                    |   7 +-
 hw/sd/core.c                              |   5 +-
 hw/sd/omap_mmc.c                          |   5 +-
 hw/sd/pl181.c                             |   6 +-
 hw/sd/sd.c                                | 198 ++++++++++++++++------
 hw/sd/sdhci.c                             |   6 +-
 hw/sd/ssi-sd.c                            | 100 ++---------
 hw/sd/trace-events                        |   4 +-
 tests/functional/meson.build              |   1 +
 tests/functional/test_riscv64_sifive_u.py |  51 ++++++
 13 files changed, 249 insertions(+), 165 deletions(-)
 create mode 100755 tests/functional/test_riscv64_sifive_u.py

-- 
2.49.0



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2025-08-08 13:35 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-04 13:33 [PATCH-for-10.1 v2 00/11] hw/sd: Fix SD cards in SPI mode Philippe Mathieu-Daudé
2025-08-04 13:33 ` [PATCH-for-10.1 v2 01/11] hw/sd/sdcard: Do not ignore errors in sd_cmd_to_sendingdata() Philippe Mathieu-Daudé
2025-08-04 13:33 ` [PATCH-for-10.1 v2 02/11] hw/sd/sdcard: Factor sd_response_size() out Philippe Mathieu-Daudé
2025-08-04 22:55   ` Richard Henderson
2025-08-04 13:33 ` [PATCH-for-10.1 v2 03/11] hw/sd/sdbus: Provide buffer size to sdbus_do_command() Philippe Mathieu-Daudé
2025-08-04 22:56   ` Richard Henderson
2025-08-04 13:33 ` [PATCH-for-10.1 v2 04/11] hw/sd/sdcard: Fill SPI response bits in card code Philippe Mathieu-Daudé
2025-08-04 13:33 ` [PATCH-for-10.1 v2 05/11] hw/sd/sdcard: Implement SPI R2 return value Philippe Mathieu-Daudé
2025-08-04 13:34 ` [PATCH-for-10.1 v2 06/11] hw/sd/sdcard: Use complete SEND_OP_COND implementation in SPI mode Philippe Mathieu-Daudé
2025-08-04 13:34 ` [PATCH-for-10.1 v2 07/11] hw/sd/sdcard: Allow using SWITCH_FUNCTION in more SPI states Philippe Mathieu-Daudé
2025-08-04 13:34 ` [PATCH-for-10.1 v2 08/11] hw/sd/sdcard: Factor spi_cmd_SEND_CxD() out Philippe Mathieu-Daudé
2025-08-04 13:34 ` [PATCH-for-10.1 v2 09/11] hw/sd/sdcard: Disable checking STBY mode in SPI SEND_CSD/CID Philippe Mathieu-Daudé
2025-08-04 13:34 ` [PATCH-for-10.1 v2 10/11] hw/sd/sdcard: Remove SDState::mode field Philippe Mathieu-Daudé
2025-08-04 13:34 ` [PATCH-for-10.1 v2 11/11] tests/functional: Test SD cards in SPI mode (using sifive_u machine) Philippe Mathieu-Daudé
2025-08-04 23:03 ` [PATCH-for-10.1 v2 00/11] hw/sd: Fix SD cards in SPI mode Richard Henderson
2025-08-04 23:09   ` Philippe Mathieu-Daudé
2025-08-05 14:29 ` Philippe Mathieu-Daudé
2025-08-06  6:39 ` Michael Tokarev
2025-08-06  7:22   ` Philippe Mathieu-Daudé
2025-08-07 16:06     ` Guenter Roeck
2025-08-08 13:34       ` Philippe Mathieu-Daudé

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).