qemu-devel
[Top][All Lists]
Advanced

[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".



reply via email to

[Prev in Thread] Current Thread [Next in Thread]