[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Aspeed PATCH v47 17/19] hw/sd/sdcard: Subtract bootarea size from blk
From: |
Philippe Mathieu-Daudé |
Subject: |
[Aspeed PATCH v47 17/19] hw/sd/sdcard: Subtract bootarea size from blk |
Date: |
Tue, 9 Jul 2024 17:25:54 +0200 |
From: Joel Stanley <joel@jms.id.au>
The userdata size is derived from the file the user passes on the
command line, but we must take into account the boot areas.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
Squash in previous?
---
hw/sd/sd.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 5830725629..291497468f 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -814,6 +814,10 @@ static void sd_reset(DeviceState *dev)
}
size = sect << HWBLOCK_SHIFT;
+ if (sc->bootpart_offset) {
+ size -= sd_bootpart_offset(sd);
+ }
+
sect = sd_addr_to_wpnum(size) + 1;
sd->reset_time_ns = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
--
2.41.0
- [PATCH v47 10/19] hw/sd/sdcard: Add emmc_cmd_SEND_EXT_CSD handler (CMD8), (continued)
- [PATCH v47 10/19] hw/sd/sdcard: Add emmc_cmd_SEND_EXT_CSD handler (CMD8), Philippe Mathieu-Daudé, 2024/07/09
- [PATCH v47 11/19] hw/sd/sdcard: Add eMMC 'boot-size' property, Philippe Mathieu-Daudé, 2024/07/09
- [PATCH v47 12/19] hw/sd/sdcard: Simplify EXT_CSD values for spec v4.3, Philippe Mathieu-Daudé, 2024/07/09
- [PATCH v47 13/19] hw/sd/sdcard: Migrate ExtCSD 'modes' register, Philippe Mathieu-Daudé, 2024/07/09
- [PATCH v47 14/19] hw/sd/sdcard: Add mmc SWITCH function support (CMD6), Philippe Mathieu-Daudé, 2024/07/09
- [Aspeed PATCH v47 16/19] hw/sd/sdcard: Support boot area in emmc image, Philippe Mathieu-Daudé, 2024/07/09
- [Aspeed PATCH v47 17/19] hw/sd/sdcard: Subtract bootarea size from blk,
Philippe Mathieu-Daudé <=
- [PATCH v47 15/19] hw/sd/sdcard: Implement eMMC 'boot-mode', Philippe Mathieu-Daudé, 2024/07/09
- [Aspeed PATCH v47 18/19] hw/sd/sdcard: Add boot config support, Philippe Mathieu-Daudé, 2024/07/09
- [PATCH v47 19/19] hw/sd/sdcard: Enable TYPE_EMMC card model, Philippe Mathieu-Daudé, 2024/07/09
- Re: [PATCH v47 00/19] hw/sd/sdcard: Add eMMC support, Cédric Le Goater, 2024/07/09