[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 13/15] sd: emmc: Subtract bootarea size from blk
From: |
Sai Pavan Boddu |
Subject: |
[RFC PATCH 13/15] sd: emmc: Subtract bootarea size from blk |
Date: |
Thu, 11 Feb 2021 13:47:24 +0530 |
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>
---
hw/sd/sd.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 55c1104..a2f39c9 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -658,6 +658,11 @@ static void sd_reset(DeviceState *dev)
}
size = sect << 9;
+ if (sd->emmc) {
+ unsigned int boot_capacity = sd->ext_csd[EXT_CSD_BOOT_MULT] << 17;
+ size -= boot_capacity * 2;
+ }
+
sect = sd_addr_to_wpnum(size) + 1;
sd->state = sd_idle_state;
--
2.7.4
- [RFC PATCH 00/15] eMMC support, Sai Pavan Boddu, 2021/02/11
- [RFC PATCH 01/15] block: add eMMC block device type, Sai Pavan Boddu, 2021/02/11
- [RFC PATCH 02/15] sd: add eMMC support, Sai Pavan Boddu, 2021/02/11
- [RFC PATCH 04/15] sd: emmc: Update CMD1 definition for eMMC, Sai Pavan Boddu, 2021/02/11
- [RFC PATCH 09/15] sd: emmc: Add support for emmc erase, Sai Pavan Boddu, 2021/02/11
- [RFC PATCH 12/15] sd: emmc: Support boot area in emmc image, Sai Pavan Boddu, 2021/02/11
- [RFC PATCH 13/15] sd: emmc: Subtract bootarea size from blk,
Sai Pavan Boddu <=
- [RFC PATCH 05/15] sd: emmc: support idle state in CMD2, Sai Pavan Boddu, 2021/02/11
- [RFC PATCH 03/15] sd: emmc: Dont not update CARD_CAPACITY for eMMC cards, Sai Pavan Boddu, 2021/02/11
- [RFC PATCH 06/15] sd: emmc: Add mmc switch function support, Sai Pavan Boddu, 2021/02/11
- [RFC PATCH 07/15] sd: emmc: add CMD21 tuning sequence, Sai Pavan Boddu, 2021/02/11
- [RFC PATCH 08/15] sd: emmc: Make ACMD41 illegal for mmc, Sai Pavan Boddu, 2021/02/11
- [RFC PATCH 10/15] sd: emmc: Update CID structure for eMMC, Sai Pavan Boddu, 2021/02/11