From: Bin Meng <bin.m...@windriver.com> The single block read (CMD17) codes are the same as the multiple block read (CMD18). Merge them into one. The same applies to single block write (CMD24) and multiple block write (CMD25).
Signed-off-by: Bin Meng <bin.m...@windriver.com> Acked-by: Alistair Francis <alistair.fran...@wdc.com> Tested-by: Philippe Mathieu-Daudé <f4...@amsat.org> --- (no changes since v1) hw/sd/sd.c | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index b3952514fe..09753359bb 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1181,24 +1181,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) break; case 17: /* CMD17: READ_SINGLE_BLOCK */ - switch (sd->state) { - case sd_transfer_state: - - if (addr + sd->blk_len > sd->size) { - sd->card_status |= ADDRESS_ERROR; - return sd_r1; - } - - sd->state = sd_sendingdata_state; - sd->data_start = addr; - sd->data_offset = 0; - return sd_r1; - - default: - break; - } - break; - case 18: /* CMD18: READ_MULTIPLE_BLOCK */ switch (sd->state) { case sd_transfer_state: @@ -1245,35 +1227,6 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) /* Block write commands (Class 4) */ case 24: /* CMD24: WRITE_SINGLE_BLOCK */ - switch (sd->state) { - case sd_transfer_state: - /* Writing in SPI mode not implemented. */ - if (sd->spi) - break; - - if (addr + sd->blk_len > sd->size) { - sd->card_status |= ADDRESS_ERROR; - return sd_r1; - } - - sd->state = sd_receivingdata_state; - sd->data_start = addr; - sd->data_offset = 0; - sd->blk_written = 0; - - if (sd_wp_addr(sd, sd->data_start)) { - sd->card_status |= WP_VIOLATION; - } - if (sd->csd[14] & 0x30) { - sd->card_status |= WP_VIOLATION; - } - return sd_r1; - - default: - break; - } - break; - case 25: /* CMD25: WRITE_MULTIPLE_BLOCK */ switch (sd->state) { case sd_transfer_state: -- 2.25.1