Patchwork hw/sd.c: Don't complain about SDIO commands CMD52/CMD53

login
register
mail settings
Submitter Peter Maydell
Date May 20, 2011, 9:11 a.m.
Message ID <1305882713-24997-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/96566/
State New
Headers show

Comments

Peter Maydell - May 20, 2011, 9:11 a.m.
The SDIO specification introduces new commands 52 and 53.
Handle as illegal command but do not complain on stderr,
as SDIO-aware OSes (including Linux) may legitimately use
these in their probing for presence of an SDIO card.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/sd.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
Stefan Hajnoczi - May 20, 2011, 2:46 p.m.
On Fri, May 20, 2011 at 10:11 AM, Peter Maydell
<peter.maydell@linaro.org> wrote:
> The SDIO specification introduces new commands 52 and 53.
> Handle as illegal command but do not complain on stderr,
> as SDIO-aware OSes (including Linux) may legitimately use
> these in their probing for presence of an SDIO card.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/sd.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)

Thanks, added to the trivial patches tree:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/trivial-patches

Stefan

Patch

diff --git a/hw/sd.c b/hw/sd.c
index f44a970..cedfb20 100644
--- a/hw/sd.c
+++ b/hw/sd.c
@@ -1104,6 +1104,17 @@  static sd_rsp_type_t sd_normal_command(SDState *sd,
         }
         break;
 
+    case 52:
+    case 53:
+        /* CMD52, CMD53: reserved for SDIO cards
+         * (see the SDIO Simplified Specification V2.0)
+         * Handle as illegal command but do not complain
+         * on stderr, as some OSes may use these in their
+         * probing for presence of an SDIO card.
+         */
+        sd->card_status |= ILLEGAL_COMMAND;
+        return sd_r0;
+
     /* Application specific commands (Class 8) */
     case 55:	/* CMD55:  APP_CMD */
         if (sd->rca != rca)