diff options
author | Loh, Tien Hock <tien.hock.loh@intel.com> | 2019-02-22 15:58:03 +0800 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2019-03-15 12:21:02 +0100 |
commit | c49f298d28cb90c332f8d495a6dfb355bc4014f0 (patch) | |
tree | 304fed2b3cd4b9d54dc6a5c75aa4efba868f6853 /EmbeddedPkg/Universal | |
parent | b0189eac00a5a97ecf4697bfe22d49aa47e39162 (diff) | |
download | edk2-c49f298d28cb90c332f8d495a6dfb355bc4014f0.zip edk2-c49f298d28cb90c332f8d495a6dfb355bc4014f0.tar.gz edk2-c49f298d28cb90c332f8d495a6dfb355bc4014f0.tar.bz2 |
EmbeddedPkg/MmcDxe: Enable 4-bit mode even if SD_HIGH_SPEED is not supported
If SD doesn't support SD_HIGH_SPEED, function should still continue to
setup SD to go into 4 bits more if it is supported. Currently, the code
inadvertently exits early, but with a EFI_SUCCESS return code, and so
execution proceeds without ever attempting to enable 4-bit mode.
Since not having SD_HIGH_SPEED support is not an error, downgrade the
message that reports this to DEBUG_INFO.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Loh Tien Hock <tien.hock.loh@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Diffstat (limited to 'EmbeddedPkg/Universal')
-rwxr-xr-x | EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c index f661a0c..7079fa6 100755 --- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c +++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c @@ -473,28 +473,27 @@ InitializeSdMmcDevice ( }
if (!(Buffer[3] & SD_HIGH_SPEED_SUPPORTED)) {
- DEBUG ((DEBUG_ERROR, "%a : High Speed not supported by Card %r\n", __FUNCTION__, Status));
- return Status;
- }
-
- Speed = SD_HIGH_SPEED;
-
- /* SD Switch, Mode:1, Group:0, Value:1 */
- CmdArg = CreateSwitchCmdArgument(1, 0, 1);
- Status = MmcHost->SendCommand (MmcHost, MMC_CMD6, CmdArg);
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n", __FUNCTION__, Status));
- return Status;
+ DEBUG ((DEBUG_INFO, "%a : High Speed not supported by Card\n", __FUNCTION__));
} else {
- Status = MmcHost->ReadBlockData (MmcHost, 0, SWITCH_CMD_DATA_LENGTH, Buffer);
+ Speed = SD_HIGH_SPEED;
+
+ /* SD Switch, Mode:1, Group:0, Value:1 */
+ CmdArg = CreateSwitchCmdArgument(1, 0, 1);
+ Status = MmcHost->SendCommand (MmcHost, MMC_CMD6, CmdArg);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and Status = %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): Error and Status = %r\n", __FUNCTION__, Status));
return Status;
- }
+ } else {
+ Status = MmcHost->ReadBlockData (MmcHost, 0, SWITCH_CMD_DATA_LENGTH, Buffer);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "%a (MMC_CMD6): ReadBlockData Error and Status = %r\n", __FUNCTION__, Status));
+ return Status;
+ }
- if ((Buffer[4] & SWITCH_CMD_SUCCESS_MASK) != 0x01000000) {
- DEBUG((DEBUG_ERROR, "Problem switching SD card into high-speed mode\n"));
- return Status;
+ if ((Buffer[4] & SWITCH_CMD_SUCCESS_MASK) != 0x01000000) {
+ DEBUG((DEBUG_ERROR, "Problem switching SD card into high-speed mode\n"));
+ return Status;
+ }
}
}
}
|