]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Sd: Fix wrong response type of SD Deselect cmd
authorFeng Tian <feng.tian@intel.com>
Wed, 6 Apr 2016 01:52:08 +0000 (09:52 +0800)
committerFeng Tian <feng.tian@intel.com>
Thu, 21 Apr 2016 08:07:27 +0000 (16:07 +0800)
The SD CMD7 deselect cmd have no response according to SD
physical layer simplified spec.

Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c

index 07bd07ad410ab9c0994978dd5d7c8013cc114f05..d05eb9e9e651cdfd5dd6633a1847435a1bf17bb5 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   This file provides some helper functions which are specific for SD card device.\r
 \r
-  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -464,7 +464,9 @@ SdCardSelect (
 \r
   SdMmcCmdBlk.CommandIndex = SD_SELECT_DESELECT_CARD;\r
   SdMmcCmdBlk.CommandType  = SdMmcCommandTypeAc;\r
-  SdMmcCmdBlk.ResponseType = SdMmcResponseTypeR1b;\r
+  if (Rca != 0) {\r
+    SdMmcCmdBlk.ResponseType = SdMmcResponseTypeR1b;\r
+  }\r
   SdMmcCmdBlk.CommandArgument = (UINT32)Rca << 16;\r
 \r
   Status = SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL);\r
index 341d7885c22f382c041543e14086739f4b40397a..b7a5fe49ae1c2dc89a4c2a9dbd954afd9a16d0e3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The helper functions for BlockIo and BlockIo2 protocol.\r
 \r
-  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -133,7 +133,9 @@ SdSelect (
 \r
   SdMmcCmdBlk.CommandIndex = SD_SELECT_DESELECT_CARD;\r
   SdMmcCmdBlk.CommandType  = SdMmcCommandTypeAc;\r
-  SdMmcCmdBlk.ResponseType = SdMmcResponseTypeR1b;\r
+  if (Rca != 0) {\r
+    SdMmcCmdBlk.ResponseType = SdMmcResponseTypeR1b;\r
+  }\r
   SdMmcCmdBlk.CommandArgument = (UINT32)Rca << 16;\r
 \r
   Status = PassThru->PassThru (PassThru, Device->Slot, &Packet, NULL);\r