summaryrefslogtreecommitdiff
path: root/EmbeddedPkg/Universal
diff options
context:
space:
mode:
Diffstat (limited to 'EmbeddedPkg/Universal')
-rw-r--r--EmbeddedPkg/Universal/MmcDxe/Mmc.h2
-rw-r--r--EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c21
2 files changed, 18 insertions, 5 deletions
diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
index a77ba41..62de2c8 100644
--- a/EmbeddedPkg/Universal/MmcDxe/Mmc.h
+++ b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
@@ -70,6 +70,8 @@
#define SD_HIGH_SPEED 50000000
#define SWITCH_CMD_SUCCESS_MASK 0x0f000000
+#define SD_CARD_CAPACITY 0x00000002
+
#define BUSWIDTH_4 4
typedef enum {
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
index a2b9232..1dea7d3 100644
--- a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
+++ b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
@@ -148,12 +148,23 @@ MmcTransferBlock (
MmcHostInstance = MMC_HOST_INSTANCE_FROM_BLOCK_IO_THIS (This);
MmcHost = MmcHostInstance->MmcHost;
- //Set command argument based on the card access mode (Byte mode or Block mode)
- if ((MmcHostInstance->CardInfo.OCRData.AccessMode & MMC_OCR_ACCESS_MASK) ==
- MMC_OCR_ACCESS_SECTOR) {
- CmdArg = Lba;
+ if (MmcHostInstance->CardInfo.CardType != EMMC_CARD) {
+ //Set command argument based on the card capacity
+ //if 0 : SDSC card
+ //if 1 : SDXC/SDHC
+ if (MmcHostInstance->CardInfo.OCRData.AccessMode & SD_CARD_CAPACITY) {
+ CmdArg = Lba;
+ } else {
+ CmdArg = Lba * This->Media->BlockSize;
+ }
} else {
- CmdArg = Lba * This->Media->BlockSize;
+ //Set command argument based on the card access mode (Byte mode or Block mode)
+ if ((MmcHostInstance->CardInfo.OCRData.AccessMode & MMC_OCR_ACCESS_MASK) ==
+ MMC_OCR_ACCESS_SECTOR) {
+ CmdArg = Lba;
+ } else {
+ CmdArg = Lba * This->Media->BlockSize;
+ }
}
Status = MmcHost->SendCommand (MmcHost, Cmd, CmdArg);