qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/sd: sd: Bypass the RCA check for CMD13 in SPI mode


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] hw/sd: sd: Bypass the RCA check for CMD13 in SPI mode
Date: Fri, 29 Jan 2021 15:11:15 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

Hi Bin,

On 1/29/21 9:51 AM, Bin Meng wrote:
> From: Bin Meng <bin.meng@windriver.com>
> 
> Unlike SD mode, when SD card is working in SPI mode, the argument
> of CMD13 is stuff bits. Hence we should bypass the RCA check.

Is this for detecting events by polling? From spec v8:

  5.7.5 Event Indication Method
  5.7.5.1 FX_EVENT (Bit06 of Card Status)

    An event indication method is introduced from Version 4.20.
    Card may use Bit06 of R1 (R1b) response of any SD command
    to indicate event generation.

  F.2 Concept of Event Detection Method
  F.2.2 Host Implementation to use Event Detection Method

> 
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> 
> ---
> Based-on: http://patchwork.ozlabs.org/project/qemu-devel/list/?series=226787
> 
>  hw/sd/sd.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> index 8c397d4ad7..4f902d0b72 100644
> --- a/hw/sd/sd.c
> +++ b/hw/sd/sd.c
> @@ -1166,8 +1166,9 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, 
> SDRequest req)
>      case 13: /* CMD13:  SEND_STATUS */
>          switch (sd->mode) {
>          case sd_data_transfer_mode:
> -            if (sd->rca != rca)
> +            if (!sd->spi && sd->rca != rca) {
>                  return sd_r0;
> +            }
>  
>              return sd_r1;
>  
> 



reply via email to

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