diff options
author | Haojian Zhuang <haojian.zhuang@linaro.org> | 2016-11-13 14:47:51 +0800 |
---|---|---|
committer | Leif Lindholm <leif.lindholm@linaro.org> | 2016-11-14 15:45:23 +0000 |
commit | 36bec33a999388c460e32413e5e9ddf554d2ec78 (patch) | |
tree | bb6f0eccbe1192eb148be47786a050153e720788 /EmbeddedPkg/Universal | |
parent | 3201075377f80af632465361155f7498c177bad1 (diff) | |
download | edk2-36bec33a999388c460e32413e5e9ddf554d2ec78.tar.gz edk2-36bec33a999388c460e32413e5e9ddf554d2ec78.tar.bz2 edk2-36bec33a999388c460e32413e5e9ddf554d2ec78.zip |
EmbeddedPkg: MmcDxe: move ECSD into CardInfo structure
Since ECSD also describes the information of card, move it into
structure CardInfo.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'EmbeddedPkg/Universal')
-rw-r--r-- | EmbeddedPkg/Universal/MmcDxe/Mmc.h | 1 | ||||
-rw-r--r-- | EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h index 46a156cecf..f4e0aa0366 100644 --- a/EmbeddedPkg/Universal/MmcDxe/Mmc.h +++ b/EmbeddedPkg/Universal/MmcDxe/Mmc.h @@ -138,6 +138,7 @@ typedef struct { OCR OCRData;
CID CIDData;
CSD CSDData;
+ UINT32 ECSD[128]; // MMC V4 extended card specific
} CARD_INFO;
typedef struct _MMC_HOST_INSTANCE {
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c index 0b0a044540..3531fb4786 100644 --- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c +++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c @@ -39,7 +39,6 @@ EmmcIdentificationMode ( EFI_BLOCK_IO_MEDIA *Media;
EFI_STATUS Status;
UINT32 RCA;
- UINT32 ECSD[128];
Host = MmcHostInstance->MmcHost;
Media = MmcHostInstance->BlockIo.Media;
@@ -91,7 +90,7 @@ EmmcIdentificationMode ( DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): ECSD fetch error, Status=%r.\n", Status));
}
- Status = Host->ReadBlockData (Host, 0, 512, ECSD);
+ Status = Host->ReadBlockData (Host, 0, 512, (UINT32 *)&(MmcHostInstance->CardInfo.ECSD));
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): ECSD read error, Status=%r.\n", Status));
return Status;
@@ -104,7 +103,7 @@ EmmcIdentificationMode ( Media->LogicalBlocksPerPhysicalBlock = 1;
Media->IoAlign = 4;
// Compute last block using bits [215:212] of the ECSD
- Media->LastBlock = ECSD[EMMC_ECSD_SIZE_OFFSET] - 1; // eMMC isn't supposed to report this for
+ Media->LastBlock = MmcHostInstance->CardInfo.ECSD[EMMC_ECSD_SIZE_OFFSET] - 1; // eMMC isn't supposed to report this for
// Cards <2GB in size, but the model does.
// Setup card type
|