Hi, Haojian

Why I didn't get the lowest byte data is because it's CRC field. I thought 
nobody will care about it. My assumption is incorrect for your usage model?

Thanks
Feng

-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Haojian 
Zhuang
Sent: Tuesday, July 19, 2016 3:38 PM
To: Tian, Feng <[email protected]>
Cc: Haojian Zhuang <[email protected]>; [email protected]; 
[email protected]; [email protected]; [email protected]
Subject: [edk2] [PATCH] EmmcBlockIo: fix to get CSD data

The CSD structure is a 128-bit structure. But EmmcGetCsd() only loads
120 bits with 8-bit offset. Now fix it.

Signed-off-by: Haojian Zhuang <[email protected]>
---
 MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c 
b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c
index fc705e1..fe85627 100644
--- a/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c
+++ b/MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c
@@ -191,9 +191,9 @@ EmmcGetCsd (
   Status = PassThru->PassThru (PassThru, Device->Slot, &Packet, NULL);
   if (!EFI_ERROR (Status)) {
     //
-    // For details, refer to SD Host Controller Simplified Spec 3.0 Table 2-12.
+    // Copy 128bit data for CSD structure.
     //
-    CopyMem (((UINT8*)Csd) + 1, &SdMmcStatusBlk.Resp0, sizeof (EMMC_CSD) - 1);
+    CopyMem ((VOID*)Csd, &SdMmcStatusBlk.Resp0, sizeof (EMMC_CSD));
   }
 
   return Status;
-- 
1.9.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to