[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 4/4] sdcard: Add a 'uhs' property, update the OCR
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v2 4/4] sdcard: Add a 'uhs' property, update the OCR register ACCEPT_SWITCH_1V8 bit |
Date: |
Wed, 9 May 2018 03:01:04 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
---
hw/sd/sd.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index d8dd88f872..a0e8a1b46a 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -94,6 +94,10 @@ struct SDState {
BlockBackend *blk;
bool spi;
+ /**
+ * The UHS mode the card supports if any, else #UHS_NOT_SUPPORTED
+ */
+ uint8_t uhs_mode_supported;
/* Runtime changeables */
@@ -300,6 +304,9 @@ static void sd_set_ocr(SDState *sd)
{
/* All voltages OK */
sd->ocr = R_OCR_VDD_VOLTAGE_WIN_HI_MASK;
+
+ sd->ocr = FIELD_DP32(sd->ocr, OCR, ACCEPT_SWITCH_1V8,
+ sd->uhs_mode_supported != UHS_NOT_SUPPORTED);
}
static void sd_ocr_powerup(void *opaque)
@@ -2240,6 +2247,7 @@ static Property sd_properties[] = {
* board to ensure that ssi transfers only occur when the chip select
* is asserted. */
DEFINE_PROP_BOOL("spi", SDState, spi, false),
+ DEFINE_PROP_UINT8("uhs", SDState, uhs_mode_supported, UHS_NOT_SUPPORTED),
DEFINE_PROP_END_OF_LIST()
};
--
2.17.0
- Re: [Qemu-devel] [PATCH v2 2/4] sdcard: Correct CRC16 offset in sd_function_switch(), (continued)
[Qemu-devel] [PATCH v2 3/4] sdcard: Implement the UHS-I SWITCH_FUNCTION entries (Spec v3), Philippe Mathieu-Daudé, 2018/05/09
[Qemu-devel] [PATCH v2 4/4] sdcard: Add a 'uhs' property, update the OCR register ACCEPT_SWITCH_1V8 bit,
Philippe Mathieu-Daudé <=