Skip to content

hw/sd: sd: Erase operation and other fixes

Bin Meng qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 8 repliesIn review
  2. v13 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- new patch: sd: Only SDSC cards support CMD28/29/30
- new patch: sd: Fix CMD30 response type
- new patch: sd: Skip write protect groups check in sd_erase() for high capacity card
- honor the write protection bits for SDSC cards
- new patch: sd: Skip write protect groups check in CMD24/25 for high capacity cards
- update commit message to include the reference in the spec

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8hw/sd: sd: Fix address check in sd_erase()hw/sd/sd.c+1 -10 replies
2/8hw/sd: sd: Only SDSC cards support CMD28/29/30hw/sd/sd.c+12 -01 reply
3/8hw/sd: sd: Fix CMD30 response typehw/sd/sd.c+1 -11 reply
4/8hw/sd: sd: Move the sd_block_{read, write} and macros aheadhw/sd/sd.c+21 -210 replies
5/8hw/sd: sd: Skip write protect groups check in sd_erase() for high capacity cardshw/sd/sd.c+12 -61 reply
6/8hw/sd: sd: Actually perform the erase operationhw/sd/sd.c+14 -82 replies
7/8hw/sd: sd: Skip write protect groups check in CMD24/25 for high capacity cardshw/sd/sd.c+9 -51 reply
8/8hw/sd: sd: Bypass the RCA check for CMD13 in SPI modehw/sd/sd.c+2 -11 reply

Reviews trailers per patch

7 of 8 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-Daudé
1/8R-b
2/8R-b
3/8R-b
4/8R-b
5/8R-b
6/8
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/8] hw/sd: sd: Erase operation and other fixes

From: Bin Meng <[email protected]>

This includes several fixes related to erase operation of a SD card.

Currently sd_erase() does not perform the actual erase operation to reset the requested block contents to 0xFFs. When trying to add such functionality, one issue was spotted that the write protection is only supported by SDSC cards. This seems to be missed when adding high capability card support to the SD model.

The write groups check is now bypassed in the erase and block write handling codes for high capacity cards.

The last patch was previously sent as a standalone patch [1], and is now included in this v2 series. It was about SD card in SPI mode that CMD13 argument should be ignored.

[1] http://patchwork.ozlabs.org/project/qemu-devel/patch/[email protected]/

Based-on:
http://patchwork.ozlabs.org/project/qemu-devel/list/?series=226785

Changes in v2:
- new patch: sd: Only SDSC cards support CMD28/29/30
- new patch: sd: Fix CMD30 response type
- new patch: sd: Skip write protect groups check in sd_erase() for high capacity card
- honor the write protection bits for SDSC cards
- new patch: sd: Skip write protect groups check in CMD24/25 for high capacity cards
- update commit message to include the reference in the spec

Bin Meng (8):
hw/sd: sd: Fix address check in sd_erase()
hw/sd: sd: Only SDSC cards support CMD28/29/30
hw/sd: sd: Fix CMD30 response type
hw/sd: sd: Move the sd_block_{read,write} and macros ahead hw/sd: sd: Skip write protect groups check in sd_erase() for high
capacity cards
hw/sd: sd: Actually perform the erase operation
hw/sd: sd: Skip write protect groups check in CMD24/25 for high
capacity cards
hw/sd: sd: Bypass the RCA check for CMD13 in SPI mode

 hw/sd/sd.c | 99 +++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 64 insertions(+), 35 deletions(-)
Signature · 1 line
2.25.1