[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V4 04/12] hw/sd.c: favour SD card type (SDSC or
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH V4 04/12] hw/sd.c: favour SD card type (SDSC or SDHC) when performing erase |
Date: |
Tue, 31 Jul 2012 11:29:28 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
Igor Mitsyanko <address@hidden> writes:
> Standard capacity cards SDSC use byte unit address while SDHC and SDXC Cards
> use
> block unit address (512 bytes) when setting ERASE_START and ERASE_END with
> CMD32
> and CMD33, we have to account for this.
>
> Signed-off-by: Igor Mitsyanko <address@hidden>
> ---
> hw/sd.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/hw/sd.c b/hw/sd.c
> index d0674d5..f7aa580 100644
> --- a/hw/sd.c
> +++ b/hw/sd.c
> @@ -482,8 +482,10 @@ static void sd_erase(SDState *sd)
> return;
> }
>
> - start = sd_addr_to_wpnum(sd->erase_start);
> - end = sd_addr_to_wpnum(sd->erase_end);
> + start = sd_addr_to_wpnum(sd->ocr & (1 << 30) ?
> + (uint64_t)sd->erase_start * 512 : sd->erase_start);
> + end = sd_addr_to_wpnum(sd->ocr & (1 << 30) ?
> + (uint64_t)sd->erase_end * 512 : sd->erase_end);
> sd->erase_start = 0;
> sd->erase_end = 0;
> sd->csd[14] |= 0x40;
Is this a bug fix?
If yes, I recommend to state that clearly in the subject, say "hw/sd.c:
Fix erase for high capacity cards".
- [Qemu-devel] [PATCH V4 00/12] SD save/load support, SD qomification and bug fixes, Igor Mitsyanko, 2012/07/27
- [Qemu-devel] [PATCH V4 01/12] hw/sd.c: convert wp_groups in SDState to bitfield, Igor Mitsyanko, 2012/07/27
- [Qemu-devel] [PATCH V4 02/12] hw/sd.c: make sd_wp_addr() accept 64 bit address argument, Igor Mitsyanko, 2012/07/27
- [Qemu-devel] [PATCH V4 03/12] hw/sd.c: introduce wrapper for conversion address to wp group, Igor Mitsyanko, 2012/07/27
- [Qemu-devel] [PATCH V4 04/12] hw/sd.c: favour SD card type (SDSC or SDHC) when performing erase, Igor Mitsyanko, 2012/07/27
- [Qemu-devel] [PATCH V4 05/12] hw/sd.c: convert binary variables to bool, Igor Mitsyanko, 2012/07/27
- [Qemu-devel] [PATCH V4 09/12] hw/sd.c: convert SD state to QOM object, Igor Mitsyanko, 2012/07/27