Skip to content

hw/sd: Fix SD cards in SPI mode

Philippe Mathieu-Daudé qemu-arm qemu-devel qemu-riscv 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest11 patches 9 repliesIn review
  2. v111 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- new patch factoring sd_response_size() out (Richard)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11hw/sd/sdcard: Do not ignore errors in sd_cmd_to_sendingdata()hw/sd/sd.c+1 -10 replies
2/11hw/sd/sdcard: Factor sd_response_size() outhw/sd/sd.c+29 -71 reply
3/11hw/sd/sdbus: Provide buffer size to sdbus_do_command()hw/sd/allwinner-sdhost.c hw/sd/bcm2835_sdhost.c hw/sd/core.c +6 more+47 -301 reply
4/11hw/sd/sdcard: Fill SPI response bits in card codehw/sd/sd.c hw/sd/ssi-sd.c+35 -840 replies
5/11hw/sd/sdcard: Implement SPI R2 return valuehw/sd/sd.c hw/sd/ssi-sd.c+35 -60 replies
6/11hw/sd/sdcard: Use complete SEND_OP_COND implementation in SPI modehw/sd/sd.c+5 -100 replies
7/11hw/sd/sdcard: Allow using SWITCH_FUNCTION in more SPI stateshw/sd/sd.c+8 -20 replies
8/11hw/sd/sdcard: Factor spi_cmd_SEND_CxD() outhw/sd/sd.c+10 -90 replies
9/11hw/sd/sdcard: Disable checking STBY mode in SPI SEND_CSD/CIDhw/sd/sd.c+11 -00 replies
10/11hw/sd/sdcard: Remove SDState::mode fieldhw/sd/sd.c hw/sd/trace-events+19 -200 replies
11/11tests/functional: Test SD cards in SPI mode (using sifive_u machine)MAINTAINERS tests/functional/meson.build tests/functional/test_riscv64_sifive_u.py+53 -00 replies

Reviews trailers per patch

3 of 11 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchRichard HendersonGuenter RoeckBen Dooks
SeriesA-b
1/11R-b
2/11R-b
3/11R-b
4/11
5/11
6/11
7/11
8/11
9/11
10/11
11/11Inspired-by Inspired-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH-for-10.1 v2 00/11] hw/sd: Fix SD cards in SPI mode

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
Signature · 1 line
2.49.0