]> Git Repo - qemu.git/commitdiff
sdcard: Don't always set the high capacity bit
authorPhilippe Mathieu-Daudé <[email protected]>
Thu, 22 Feb 2018 15:12:52 +0000 (15:12 +0000)
committerPeter Maydell <[email protected]>
Thu, 22 Feb 2018 15:12:52 +0000 (15:12 +0000)
Don't set the high capacity bit by default as it will be set if required
in the sd_set_csd() function.

[based on a patch from Alistair Francis <[email protected]>
 and Peter Ogden <[email protected]> from qemu/xilinx tag xilinx-v2015.4]
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-id: 20180215221325[email protected]
Signed-off-by: Peter Maydell <[email protected]>
hw/sd/sd.c

index 706cb526680199d0a349f519c0bd785477fe1e4d..cc347ff782af0b190c1cf71e9236f91588f0db2c 100644 (file)
@@ -290,6 +290,10 @@ static void sd_ocr_powerup(void *opaque)
 
     /* card power-up OK */
     sd->ocr = FIELD_DP32(sd->ocr, OCR, CARD_POWER_UP, 1);
+
+    if (sd->size > 1 * G_BYTE) {
+        sd->ocr = FIELD_DP32(sd->ocr, OCR, CARD_CAPACITY, 1);
+    }
 }
 
 static void sd_set_scr(SDState *sd)
@@ -394,7 +398,6 @@ static void sd_set_csd(SDState *sd, uint64_t size)
         sd->csd[13] = 0x40;
         sd->csd[14] = 0x00;
         sd->csd[15] = 0x00;
-        sd->ocr |= 1 << 30;     /* High Capacity SD Memory Card */
     }
 }
 
This page took 0.030366 seconds and 4 git commands to generate.