qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 18/25] sdcard: add an enum for the SD PHY Spec ve


From: Philippe Mathieu-Daudé
Subject: [Qemu-devel] [PATCH v2 18/25] sdcard: add an enum for the SD PHY Spec version
Date: Wed, 3 Jan 2018 18:24:29 -0300

So far this device intends to model the Spec v2.00

Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
 hw/sd/sd.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 024a9fa1df..ed5874e4d6 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -58,6 +58,11 @@ do { fprintf(stderr, "SD: " fmt , ## __VA_ARGS__); } while 
(0)
 
 #define SDCARD_CMD_MAX 64
 
+typedef enum {
+    SD_PHY_SPEC_VER_2_00 = 200,
+    SD_PHY_SPEC_VER_3_01 = 301, /* not yet supported */
+} sd_phy_spec_ver_t;
+
 typedef enum {
     sd_r0 = 0,    /* no response */
     sd_r1,        /* normal response command */
@@ -114,6 +119,7 @@ struct SDState {
     uint32_t pwd_len;
     uint8_t function_group[6];
 
+    int spec_version;
     bool spi;
 
     uint32_t mode;    /* current card mode, one of SDCardModes */
@@ -1977,6 +1983,7 @@ static void sd_realize(DeviceState *dev, Error **errp)
     int ret;
 
     sd->proto_name = sd->spi ? "SPI" : "SD";
+    sd->spec_version = SD_PHY_SPEC_VER_2_00;
 
     if (sd->blk && blk_is_read_only(sd->blk)) {
         error_setg(errp, "Cannot use read-only drive as SD card");
-- 
2.15.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]