[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/20] sdcard: Rename the SDRequest as SDFrame48
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH 03/20] sdcard: Rename the SDRequest as SDFrame48 |
Date: |
Fri, 4 May 2018 12:59:01 -0300 |
SD requests are 48-bit SD frames, while SD responses can be
48-bit or 136-bit frames. The 48-bit response frames share
the same CRC logic than request frames.
Unify the 48-bit framing to reuse the same CRC logic between
requests and responses.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
include/hw/sd/sd.h | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h
index 9bdb3c9285..f0b41232f7 100644
--- a/include/hw/sd/sd.h
+++ b/include/hw/sd/sd.h
@@ -76,11 +76,22 @@ typedef enum {
sd_adtc, /* addressed with data transfer */
} sd_cmd_type_t;
-typedef struct {
+/**
+ * SDFrame48: 48 bits commands or responses
+ *
+ * @cmd: request: command
+ * response: mirrored command
+ * @arg: request: address information or parameter
+ * response: status information, OCR register, RCA
+ * @crc: 7-bit CRC checksum
+ */
+typedef struct SDFrame48 {
uint8_t cmd;
uint32_t arg;
uint8_t crc;
-} SDRequest;
+} SDFrame48;
+
+typedef struct SDFrame48 SDRequest;
typedef struct SDState SDState;
typedef struct SDBus SDBus;
--
2.17.0
- [Qemu-devel] [PATCH 00/20] sdcard: proper implementation of CRC, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 03/20] sdcard: Rename the SDRequest as SDFrame48,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 02/20] sdcard: Extract sd_calc_frame48_crc7() from sd_req_crc_validate(), Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 01/20] sdcard: Use the ldst API, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 04/20] sdcard: Add sd_prepare_request[_with_crc](), Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 06/20] sdcard: Add a "validate-crc" property, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 05/20] sdcard: Use the sd_prepare_request*() functions, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 07/20] sdcard: Constify sd_crc*()'s message argument, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 08/20] sdcard: Fix sd_crc*() style, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 09/20] sdcard: Expose sd_crc*() functions for QTest use, Philippe Mathieu-Daudé, 2018/05/04