summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeng Tian <feng.tian@intel.com>2016-04-06 09:52:08 +0800
committerFeng Tian <feng.tian@intel.com>2016-04-21 16:07:27 +0800
commitac30e4c15dc51b4f22d56dcc7f3ce098b69ba399 (patch)
tree175072425470740a08cde9393742920cfab2934e
parent2e9107b87ed1350e2abe0bb777ef913a72eaff4a (diff)
downloadedk2-ac30e4c15dc51b4f22d56dcc7f3ce098b69ba399.tar.gz
edk2-ac30e4c15dc51b4f22d56dcc7f3ce098b69ba399.tar.bz2
edk2-ac30e4c15dc51b4f22d56dcc7f3ce098b69ba399.zip
MdeModulePkg/Sd: Fix wrong response type of SD Deselect cmd
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>
-rw-r--r--MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c6
-rw-r--r--MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
index 07bd07ad41..d05eb9e9e6 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
@@ -1,7 +1,7 @@
/** @file
This file provides some helper functions which are specific for SD card device.
- Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -464,7 +464,9 @@ SdCardSelect (
SdMmcCmdBlk.CommandIndex = SD_SELECT_DESELECT_CARD;
SdMmcCmdBlk.CommandType = SdMmcCommandTypeAc;
- SdMmcCmdBlk.ResponseType = SdMmcResponseTypeR1b;
+ if (Rca != 0) {
+ SdMmcCmdBlk.ResponseType = SdMmcResponseTypeR1b;
+ }
SdMmcCmdBlk.CommandArgument = (UINT32)Rca << 16;
Status = SdMmcPassThruPassThru (PassThru, Slot, &Packet, NULL);
diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
index 341d7885c2..b7a5fe49ae 100644
--- a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
+++ b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c
@@ -1,7 +1,7 @@
/** @file
The helper functions for BlockIo and BlockIo2 protocol.
- Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -133,7 +133,9 @@ SdSelect (
SdMmcCmdBlk.CommandIndex = SD_SELECT_DESELECT_CARD;
SdMmcCmdBlk.CommandType = SdMmcCommandTypeAc;
- SdMmcCmdBlk.ResponseType = SdMmcResponseTypeR1b;
+ if (Rca != 0) {
+ SdMmcCmdBlk.ResponseType = SdMmcResponseTypeR1b;
+ }
SdMmcCmdBlk.CommandArgument = (UINT32)Rca << 16;
Status = PassThru->PassThru (PassThru, Device->Slot, &Packet, NULL);