[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 18/25] hw/sd: ssi-sd: Bump up version ids of VMStateDescriptio
From: |
Bin Meng |
Subject: |
[PATCH v2 18/25] hw/sd: ssi-sd: Bump up version ids of VMStateDescription |
Date: |
Sat, 23 Jan 2021 18:40:09 +0800 |
From: Bin Meng <bin.meng@windriver.com>
With all these fixes and improvements, there is no way for the
VMStateDescription to keep backward compatibility. We will have
to bump up version ids.
The s->mode check in the post_load() hook is also updated.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
---
Changes in v2:
- new patch: bump up version ids of VMStateDescription
hw/sd/ssi-sd.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c
index ee4fbc3dfe..0c507f3ec5 100644
--- a/hw/sd/ssi-sd.c
+++ b/hw/sd/ssi-sd.c
@@ -4,6 +4,11 @@
* Copyright (c) 2007-2009 CodeSourcery.
* Written by Paul Brook
*
+ * Copyright (c) 2021 Wind River Systems, Inc.
+ * Improved by Bin Meng <bin.meng@windriver.com>
+ *
+ * Validated with U-Boot v2021.01 and Linux v5.10 mmc_spi driver
+ *
* This code is licensed under the GNU GPL v2.
*
* Contributions after 2012-01-13 are licensed under the terms of the
@@ -319,7 +324,7 @@ static int ssi_sd_post_load(void *opaque, int version_id)
{
ssi_sd_state *s = (ssi_sd_state *)opaque;
- if (s->mode > SSI_SD_DATA_READ) {
+ if (s->mode > SSI_SD_SKIP_CRC16) {
return -EINVAL;
}
if (s->mode == SSI_SD_CMDARG &&
@@ -337,8 +342,8 @@ static int ssi_sd_post_load(void *opaque, int version_id)
static const VMStateDescription vmstate_ssi_sd = {
.name = "ssi_sd",
- .version_id = 2,
- .minimum_version_id = 2,
+ .version_id = 3,
+ .minimum_version_id = 3,
.post_load = ssi_sd_post_load,
.fields = (VMStateField []) {
VMSTATE_UINT32(mode, ssi_sd_state),
--
2.25.1
- Re: [PATCH v2 06/25] util: Add CRC16 (CCITT) calculation routines, (continued)
[PATCH v2 10/25] hw/sd: ssi-sd: Support multiple block read, Bin Meng, 2021/01/23
[PATCH v2 12/25] hw/sd: sd: Remove duplicated codes in single/multiple block read/write, Bin Meng, 2021/01/23
[PATCH v2 11/25] hw/sd: ssi-sd: Use macros for the dummy value and tokens in the transfer, Bin Meng, 2021/01/23
[PATCH v2 08/25] hw/sd: ssi-sd: Add a state representing Nac, Bin Meng, 2021/01/23
[PATCH v2 18/25] hw/sd: ssi-sd: Bump up version ids of VMStateDescription,
Bin Meng <=
[PATCH v2 13/25] hw/sd: sd: Allow single/multiple block write for SPI mode, Bin Meng, 2021/01/23
[PATCH v2 14/25] hw/sd: sd.h: Cosmetic change of using spaces, Bin Meng, 2021/01/23
[PATCH v2 15/25] hw/sd: Introduce receive_ready() callback, Bin Meng, 2021/01/23
[PATCH v2 17/25] hw/sd: ssi-sd: Support multiple block write, Bin Meng, 2021/01/23