hw/sd/sdcard: Introduce sd_cmd_to_sendingdata and sd_generic_read_byte
commitf486bf7d1092bb9ec45dab123a3cdf6aaa18ea30
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 13 Jun 2024 14:21:12 +0000 (13 16:21 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 2 Jul 2024 08:08:32 +0000 (2 10:08 +0200)
treedc058a05d077e4fb40323d468cab19fd6f74a131
parentd45c3d7e1a3a530d39f7000e9c9259217b9a47ce
hw/sd/sdcard: Introduce sd_cmd_to_sendingdata and sd_generic_read_byte

All commands switching from TRANSFER state to (sending)DATA
do the same: send stream of data on the DAT lines. Instead
of duplicating the same code many times, introduce 2 helpers:
- sd_cmd_to_sendingdata() on the I/O line setup the data to
  be transferred,
- sd_generic_read_byte() on the DAT lines to fetch the data.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-Id: <4c9f7f51-83ee-421a-8690-9af2e80b134b@linaro.org>
hw/sd/sd.c