[PATCH 0/7] hw/sd: Use sdbus_read_data/sdbus_write_data for multiple bytes access

Philippe Mathieu-Daudé posted 7 patches 3 years, 8 months ago
Test docker-quick@centos7 passed
Test docker-mingw@fedora passed
Test checkpatch passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200814092346.21825-1-f4bug@amsat.org
include/hw/sd/sd.h            | 56 ++++++++++++++++++++++++++++++++---
include/hw/sd/sdcard_legacy.h |  4 +--
hw/sd/allwinner-sdhost.c      | 24 +++++----------
hw/sd/bcm2835_sdhost.c        |  4 +--
hw/sd/core.c                  | 38 +++++++++++++++++++++---
hw/sd/milkymist-memcard.c     | 14 ++++-----
hw/sd/omap_mmc.c              |  8 ++---
hw/sd/pl181.c                 |  4 +--
hw/sd/pxa2xx_mmci.c           |  4 +--
hw/sd/sd.c                    | 16 +++++-----
hw/sd/sdhci.c                 | 46 ++++++++--------------------
hw/sd/ssi-sd.c                |  2 +-
12 files changed, 132 insertions(+), 88 deletions(-)
[PATCH 0/7] hw/sd: Use sdbus_read_data/sdbus_write_data for multiple bytes access
Posted by Philippe Mathieu-Daudé 3 years, 8 months ago
Introduce sdbus_read_data() and sdbus_write_data() methods to
access multiple bytes on the data line of a SD bus.

I haven't named then sdbus_access_block() because I expect a
block to be a power of 2, while there is no such restriction
on the SD bus (think of SPI).

We can also simplify the bcm2835_sdhost and pl181 models, but
it is simpler to first let them use the Fifo32 API.

Based-on: <20200705204630.4133-1-f4bug@amsat.org>
"hw/sd: convert legacy SDHCI devices to the SDBus API"
https://www.mail-archive.com/qemu-devel@nongnu.org/msg720136.html

Philippe Mathieu-Daudé (7):
  hw/sd: Rename read/write_data() as read/write_byte()
  hw/sd: Rename sdbus_write_data() as sdbus_write_byte()
  hw/sd: Rename sdbus_read_data() as sdbus_read_byte()
  hw/sd: Add sdbus_write_data() to write multiples bytes on the data
    line
  hw/sd: Use sdbus_write_data() instead of sdbus_write_byte when
    possible
  hw/sd: Add sdbus_read_data() to read multiples bytes on the data line
  hw/sd: Use sdbus_read_data() instead of sdbus_read_byte() when
    possible

 include/hw/sd/sd.h            | 56 ++++++++++++++++++++++++++++++++---
 include/hw/sd/sdcard_legacy.h |  4 +--
 hw/sd/allwinner-sdhost.c      | 24 +++++----------
 hw/sd/bcm2835_sdhost.c        |  4 +--
 hw/sd/core.c                  | 38 +++++++++++++++++++++---
 hw/sd/milkymist-memcard.c     | 14 ++++-----
 hw/sd/omap_mmc.c              |  8 ++---
 hw/sd/pl181.c                 |  4 +--
 hw/sd/pxa2xx_mmci.c           |  4 +--
 hw/sd/sd.c                    | 16 +++++-----
 hw/sd/sdhci.c                 | 46 ++++++++--------------------
 hw/sd/ssi-sd.c                |  2 +-
 12 files changed, 132 insertions(+), 88 deletions(-)

-- 
2.21.3


Re: [PATCH 0/7] hw/sd: Use sdbus_read_data/sdbus_write_data for multiple bytes access
Posted by Richard Henderson 3 years, 8 months ago
On 8/14/20 2:23 AM, Philippe Mathieu-Daudé wrote:
> Introduce sdbus_read_data() and sdbus_write_data() methods to
> access multiple bytes on the data line of a SD bus.
> 
> I haven't named then sdbus_access_block() because I expect a
> block to be a power of 2, while there is no such restriction
> on the SD bus (think of SPI).
> 
> We can also simplify the bcm2835_sdhost and pl181 models, but
> it is simpler to first let them use the Fifo32 API.
> 
> Based-on: <20200705204630.4133-1-f4bug@amsat.org>
> "hw/sd: convert legacy SDHCI devices to the SDBus API"
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg720136.html
> 
> Philippe Mathieu-Daudé (7):
>   hw/sd: Rename read/write_data() as read/write_byte()
>   hw/sd: Rename sdbus_write_data() as sdbus_write_byte()
>   hw/sd: Rename sdbus_read_data() as sdbus_read_byte()
>   hw/sd: Add sdbus_write_data() to write multiples bytes on the data
>     line
>   hw/sd: Use sdbus_write_data() instead of sdbus_write_byte when
>     possible
>   hw/sd: Add sdbus_read_data() to read multiples bytes on the data line
>   hw/sd: Use sdbus_read_data() instead of sdbus_read_byte() when
>     possible

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


Re: [PATCH 0/7] hw/sd: Use sdbus_read_data/sdbus_write_data for multiple bytes access
Posted by Philippe Mathieu-Daudé 3 years, 8 months ago
On 8/14/20 11:23 AM, Philippe Mathieu-Daudé wrote:
> Introduce sdbus_read_data() and sdbus_write_data() methods to
> access multiple bytes on the data line of a SD bus.
> 
> I haven't named then sdbus_access_block() because I expect a
> block to be a power of 2, while there is no such restriction
> on the SD bus (think of SPI).
> 
> We can also simplify the bcm2835_sdhost and pl181 models, but
> it is simpler to first let them use the Fifo32 API.
> 
> Based-on: <20200705204630.4133-1-f4bug@amsat.org>
> "hw/sd: convert legacy SDHCI devices to the SDBus API"
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg720136.html
> 
> Philippe Mathieu-Daudé (7):
>   hw/sd: Rename read/write_data() as read/write_byte()
>   hw/sd: Rename sdbus_write_data() as sdbus_write_byte()
>   hw/sd: Rename sdbus_read_data() as sdbus_read_byte()
>   hw/sd: Add sdbus_write_data() to write multiples bytes on the data
>     line
>   hw/sd: Use sdbus_write_data() instead of sdbus_write_byte when
>     possible
>   hw/sd: Add sdbus_read_data() to read multiples bytes on the data line
>   hw/sd: Use sdbus_read_data() instead of sdbus_read_byte() when
>     possible

Thanks, series applied to the sd-next tree.