[RFC PATCH 05/15] sd: emmc: support idle state in CMD2

Sai Pavan Boddu posted 15 patches 4 years, 12 months ago
Maintainers: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Alistair Francis <alistair@alistair23.me>, Peter Maydell <peter.maydell@linaro.org>
There is a newer version of this series
[RFC PATCH 05/15] sd: emmc: support idle state in CMD2
Posted by Sai Pavan Boddu 4 years, 12 months ago
eMMC is expected to be in idle-state post CMD1. Ready state is an
intermediate stage which we don't come across in Device identification
mode.

Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
 hw/sd/sd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index e3738b2..69289e0 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1051,6 +1051,10 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
         if (sd->spi)
             goto bad_cmd;
         switch (sd->state) {
+        case sd_idle_state:
+            if (!sd->emmc) {
+                break;
+            }
         case sd_ready_state:
             sd->state = sd_identification_state;
             return sd_r2_i;
-- 
2.7.4


Re: [RFC PATCH 05/15] sd: emmc: support idle state in CMD2
Posted by Alistair Francis 4 years, 12 months ago
On Thu, Feb 11, 2021 at 12:18 AM Sai Pavan Boddu
<sai.pavan.boddu@xilinx.com> wrote:
>
> eMMC is expected to be in idle-state post CMD1. Ready state is an
> intermediate stage which we don't come across in Device identification
> mode.
>
> Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>

Acked-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/sd/sd.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> index e3738b2..69289e0 100644
> --- a/hw/sd/sd.c
> +++ b/hw/sd/sd.c
> @@ -1051,6 +1051,10 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req)
>          if (sd->spi)
>              goto bad_cmd;
>          switch (sd->state) {
> +        case sd_idle_state:
> +            if (!sd->emmc) {
> +                break;
> +            }
>          case sd_ready_state:
>              sd->state = sd_identification_state;
>              return sd_r2_i;
> --
> 2.7.4
>
>