瀏覽代碼

EmbeddedPkg/MmcDxe: Implement the correct macro to get the device size of SD 2 High Density cards


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12131 6f19259b-4bc3-4df7-8a09-765794883524
oliviermartin 12 年之前
父節點
當前提交
36aa561136
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 0
      EmbeddedPkg/Universal/MmcDxe/Mmc.h
  2. 2 3
      EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c

+ 1 - 0
EmbeddedPkg/Universal/MmcDxe/Mmc.h

@@ -39,6 +39,7 @@
 #define MMC_CSD_GET_FILEFORMAT(Response)  ((Response[3] >> 10) & 0x3)
 #define MMC_CSD_GET_FILEFORMATGRP(Response)  ((Response[3] >> 15) & 0x1)
 #define MMC_CSD_GET_DEVICESIZE(csd)         (((Response[2] >> 30) & 0x3) | ((Response[1] & 0x3FF) << 2))
+#define HC_MMC_CSD_GET_DEVICESIZE(Response)    ((Response[1] >> 16) | ((Response[2] & 0x40) << 16));
 #define MMC_CSD_GET_DEVICESIZEMULT(csd)     ((Response[2] >> 15) & 0x7)
 
 #define MMC_R0_READY_FOR_DATA               (1 << 8)

+ 2 - 3
EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c

@@ -464,9 +464,8 @@ MmcIoBlocks (
     PrintCSD(Response);
 
     if (MmcHostInstance->CardInfo.CardType == SD_CARD_2_HIGH) {
-      ASSERT(0);  //TODO: Implementation needed
-      CardSize = MMC_CSD_GET_DEVICESIZE(Response);
-      NumBlocks = ((CardSize + 1) * 1024);;
+      CardSize = HC_MMC_CSD_GET_DEVICESIZE(Response);
+      NumBlocks = ((CardSize + 1) * 1024);
       BlockSize = 1 << MMC_CSD_GET_READBLLEN(Response);
     } else {
       CardSize = MMC_CSD_GET_DEVICESIZE(Response);