]> git.proxmox.com Git - mirror_qemu.git/commit
hw/sd: ssi-sd: Suffix a data block with CRC16
authorBin Meng <bin.meng@windriver.com>
Sat, 23 Jan 2021 10:39:58 +0000 (18:39 +0800)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Sun, 24 Jan 2021 19:11:05 +0000 (20:11 +0100)
commit2d174cc38bf1e86ff0cf534510c0d097e3b23680
tree344723b2ed668bc1816f2667ab4f4d787e39ec26
parent0b73ce30604c4fc9a004338cac6a28bc3f3e2fab
hw/sd: ssi-sd: Suffix a data block with CRC16

Per the SD spec, a valid data block is suffixed with a 16-bit CRC
generated by the standard CCITT polynomial x16+x12+x5+1. This part
is currently missing in the ssi-sd state machine. Without it, all
data block transfer fails in guest software because the expected
CRC16 is missing on the data out line.

Fixes: 775616c3ae8c ("Partial SD card SPI mode support")
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210123104016.17485-8-bmeng.cn@gmail.com>
[PMD: Change VMState version id 3 -> 4,
      check s->mode validity in post_load()]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
hw/sd/ssi-sd.c