[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 01/20] sdcard: Don't always set the high capacity
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v4 01/20] sdcard: Don't always set the high capacity bit |
Date: |
Thu, 15 Feb 2018 19:13:06 -0300 |
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 <address@hidden>
and Peter Ogden <address@hidden> from qemu/xilinx tag xilinx-v2015.4]
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
---
hw/sd/sd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index fbee87afef..9dfbd65ac8 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -291,6 +291,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)
@@ -395,7 +399,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 */
}
}
--
2.16.1
- [Qemu-devel] [PATCH v4 00/20] SDCard: bugfixes, support UHS-I (part 5), Philippe Mathieu-Daudé, 2018/02/15
- [Qemu-devel] [PATCH v4 01/20] sdcard: Don't always set the high capacity bit,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v4 02/20] sdcard: update the CSD CRC register regardless the CSD structure version, Philippe Mathieu-Daudé, 2018/02/15
- [Qemu-devel] [PATCH v4 03/20] sdcard: fix the 'maximum data transfer rate' to 25MHz, Philippe Mathieu-Daudé, 2018/02/15
- [Qemu-devel] [PATCH v4 04/20] sdcard: clean the SCR register and add few comments, Philippe Mathieu-Daudé, 2018/02/15
- [Qemu-devel] [PATCH v4 05/20] sdcard: remove commands from unsupported old MMC specification, Philippe Mathieu-Daudé, 2018/02/15
- [Qemu-devel] [PATCH v4 06/20] sdcard: simplify using the ldst API, Philippe Mathieu-Daudé, 2018/02/15
- [Qemu-devel] [PATCH v4 07/20] sdcard: use the correct masked OCR in the R3 reply, Philippe Mathieu-Daudé, 2018/02/15
- [Qemu-devel] [PATCH v4 08/20] sdcard: use the registerfields API for the CARD_STATUS register masks, Philippe Mathieu-Daudé, 2018/02/15
- [Qemu-devel] [PATCH v4 09/20] sdcard: handle CMD54 (SDIO), Philippe Mathieu-Daudé, 2018/02/15
- [Qemu-devel] [PATCH v4 10/20] sdcard: handle the Security Specification commands, Philippe Mathieu-Daudé, 2018/02/15