aboutsummaryrefslogtreecommitdiff
path: root/hw/sd/sd.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2018-02-22 15:12:53 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-02-22 15:12:53 +0000
commit9b7ec55c5c66ca466a8e34f7780f13a8e77b8a99 (patch)
tree8fea707d9f5278b66c27b687759d3a788396990e /hw/sd/sd.c
parentd7ecb8675298fefdaea35f6d7a558e91ec0b4138 (diff)
downloadqemu-9b7ec55c5c66ca466a8e34f7780f13a8e77b8a99.zip
qemu-9b7ec55c5c66ca466a8e34f7780f13a8e77b8a99.tar.gz
qemu-9b7ec55c5c66ca466a8e34f7780f13a8e77b8a99.tar.bz2
sdcard: clean the SCR register and add few comments
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> Message-id: 20180215221325.7611-5-f4bug@amsat.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/sd/sd.c')
-rw-r--r--hw/sd/sd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 3526269..c87142d 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -298,10 +298,13 @@ static void sd_ocr_powerup(void *opaque)
static void sd_set_scr(SDState *sd)
{
- sd->scr[0] = 0x00; /* SCR Structure */
- sd->scr[1] = 0x2f; /* SD Security Support */
- sd->scr[2] = 0x00;
+ sd->scr[0] = (0 << 4) /* SCR version 1.0 */
+ | 0; /* Spec Versions 1.0 and 1.01 */
+ sd->scr[1] = (2 << 4) /* SDSC Card (Security Version 1.01) */
+ | 0b0101; /* 1-bit or 4-bit width bus modes */
+ sd->scr[2] = 0x00; /* Extended Security is not supported. */
sd->scr[3] = 0x00;
+ /* reserved for manufacturer usage */
sd->scr[4] = 0x00;
sd->scr[5] = 0x00;
sd->scr[6] = 0x00;