OSDN Git Service

hw/sd: Add SDHC support for SD card SPI-mode
authorFrank Chang <frank.chang@sifive.com>
Tue, 28 Dec 2021 12:57:17 +0000 (20:57 +0800)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tue, 4 Jan 2022 07:50:28 +0000 (08:50 +0100)
commitb66f73a0cb312c81470433dfd5275d2824bb89de
tree9511c1061bfbbed6cab3587bf67a25792944c5aa
parent6947feca588670a0443d3e8892e6e20c6acb491c
hw/sd: Add SDHC support for SD card SPI-mode

In SPI-mode, SD card's OCR register: Card Capacity Status (CCS) bit
is not set to 1 correclty when the assigned SD image size is larger
than 2GB (SDHC). This will cause the SD card to be indentified as SDSC
incorrectly. CCS bit should be set to 1 if we are using SDHC.

Also, as there's no power up emulation in SPI-mode.
The OCR register: Card power up status bit bit (busy) should also
be set to 1 when reset. (busy bit is set to LOW if the card has not
finished the power up routine.)

Signed-off-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Jim Shu <jim.shu@sifive.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20211228125719.14712-1-frank.chang@sifive.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
hw/sd/sd.c