[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 01/12] sdcard: reorder SDState struct members
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v3 01/12] sdcard: reorder SDState struct members |
Date: |
Tue, 23 Jan 2018 00:21:24 -0300 |
place card registers first, this will ease further code movements.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
---
hw/sd/sd.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index ab9be561d2..55d2ba2dd7 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -88,16 +88,21 @@ enum SDCardStates {
struct SDState {
DeviceState parent_obj;
- uint32_t mode; /* current card mode, one of SDCardModes */
- int32_t state; /* current card state, one of SDCardStates */
+ /* SD Memory Card Registers */
uint32_t ocr;
- QEMUTimer *ocr_power_timer;
uint8_t scr[8];
uint8_t cid[16];
uint8_t csd[16];
uint16_t rca;
uint32_t card_status;
uint8_t sd_status[64];
+
+ /* Configurable properties */
+ BlockBackend *blk;
+ bool spi;
+
+ uint32_t mode; /* current card mode, one of SDCardModes */
+ int32_t state; /* current card state, one of SDCardStates */
uint32_t vhs;
bool wp_switch;
unsigned long *wp_groups;
@@ -110,8 +115,6 @@ struct SDState {
uint8_t pwd[16];
uint32_t pwd_len;
uint8_t function_group[6];
-
- bool spi;
uint8_t current_cmd;
/* True if we will handle the next command as an ACMD. Note that this does
* *not* track the APP_CMD status bit!
@@ -123,8 +126,7 @@ struct SDState {
uint8_t data[512];
qemu_irq readonly_cb;
qemu_irq inserted_cb;
- BlockBackend *blk;
-
+ QEMUTimer *ocr_power_timer;
bool enable;
uint8_t dat_lines;
bool cmd_line;
--
2.15.1
- [Qemu-devel] [PATCH v3 00/12] SDCard: housekeeping, add tracing (part 4), Philippe Mathieu-Daudé, 2018/01/22
- [Qemu-devel] [PATCH v3 01/12] sdcard: reorder SDState struct members,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v3 02/12] sdcard: replace DPRINTF() by trace events, Philippe Mathieu-Daudé, 2018/01/22
- [Qemu-devel] [PATCH v3 03/12] sdcard: add a trace event for command responses, Philippe Mathieu-Daudé, 2018/01/22
- [Qemu-devel] [PATCH v3 04/12] sdcard: replace fprintf() by qemu_hexdump(), Philippe Mathieu-Daudé, 2018/01/22
- [Qemu-devel] [PATCH v3 05/12] sdcard: add more trace events, Philippe Mathieu-Daudé, 2018/01/22
- [Qemu-devel] [PATCH v3 06/12] sdcard: do not trace CMD55 when expecting ACMD, Philippe Mathieu-Daudé, 2018/01/22