Skip to content

RFC Convert SD card model to AIO

Igor Mitsyanko qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7sd.c: introduce AIO related members in SD statehw/sd/sd.c+13 -00 replies
2/7sd.c: introduce variable for trekking valid datahw/sd/sd.c+1 -03 replies
3/7sd.c: introduce "start bit" and "busy deasserted" callbackshw/sd/omap_mmc.c hw/sd/pl181.c hw/sd/pxa2xx_mmci.c +3 more+30 -111 reply
4/7sd.c: use callbacks as a flag to use async IOhw/sd/sd.c+4 -00 replies
5/7sd.c: introduce async read operationhw/sd/sd.c+77 -81 reply
6/7sd.c: introduce async write interfacehw/sd/sd.c+133 -121 reply
7/7pl181.c: convert to async IO SD card interfacehw/sd/pl181.c+192 -1101 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [RFC 0/7] Convert SD card model to AIO

This is an initial attempt to change our SD card model to use asynchronious input/output API instead of synchronious one. This will require converting of every user also. Right now I've converted only PL181 model, and I'll wait for some feedback on taken approach before I'll continue with other users.

New async SD interface is built on two callbacks:
1 Callback which models arrival of start bit on DAT line from card (start bit) 2 Callback modeling deasserting of DAT0 line by card when it has finished programming data (data busy end)

This is based on SD card specification.
Start bit is issued for every new block of data coming from card. DAT0 line is kept low by card to signal busy state, while data block is being programmed by card and it can't receive new data.

Furthermore, I decided to drop data buffering on SD controller side. We already have two buffers in SD card model, no need to have another one in controller model. We can avoid intermediate copying from card's buffer to controller's buffer, and read/write directly from card.

Tested by running this Fedora image
https://fedoraproject.org/wiki/Architectures/ARM/F18/Versatile_Express
on versatile board.

Igor Mitsyanko (7):
sd.c: introduce AIO related members in SD state sd.c: introduce variable for trekking valid data sd.c: introduce "start bit" and "busy deasserted" callbacks sd.c: use callbacks as a flag to use async IO sd.c: introduce async read operation
sd.c: introduce async write interface
pl181.c: convert to async IO SD card interface

 hw/sd/omap_mmc.c    |   6 +-
 hw/sd/pl181.c       | 302 +++++++++++++++++++++++++++++++++-------------------
 hw/sd/pxa2xx_mmci.c |   2 +-
 hw/sd/sd.c          | 272 ++++++++++++++++++++++++++++++++++++++++++----
 hw/sd/sdhci.c       |   4 +-
 include/hw/sd.h     |   3 +-
 6 files changed, 449 insertions(+), 140 deletions(-)
Signature · 1 line
1.8.1.4