On 2016/7/21 19:24, Ard Biesheuvel wrote:
On 21 July 2016 at 13:17, Haojian Zhuang <haojian.zhu...@linaro.org> wrote:
On 2016/7/21 9:52, Haojian Zhuang wrote:


在 07/21/2016 09:51 AM, Haojian Zhuang 写道:
Hi Feng,

I think the main difference is who to handle the CRC bits. In the
designware emmc/sd controller, the whole 128-bit value is loaded into
the four response registers. There's no any shift on the 128-bit value
to remove CRC. (Refer to: drivers/mmc/host/dw_mmc.c).

I mean the implementation in linux. $Linux/drivers/mmc/host/dw_mmc.c

In the eMMC spec, it only mentions R2 response in table.

Bit position        [127:1]
Width (bits)        127
Value                  x
Description        CID or CSD register incl.
                             internal CRC7
It also doesn't mention that we need to shift response value for CSD
register.

So I did this fixing patch. I think that shifting isn't common to
support all eMMC/SD controller IP. Without this patch, the eMMC stack
will only get shifted CSD register value.
It results in parse error.

As I checked the SDHC driver in linux, there's the same logic as you
implemented in EmmcDxe.

Now the question is whether EmmcDxe is designed for common code of all
vendor's IP. If so, we need to provide a GetCsd() callback to handle
different implementations for different vendor. Do you mind that I append
the GetCsd() callback in EFI_SD_MMC_PASS_THRU_PROTOCOL to fix this issue?

Unfortunately, you cannot simply add methods to protocols that are
defined by the UEFI spec. If the passthru protocol is lacking in
functionality, we should work with the UEFI forum to get it amended.

OK. Maybe we can do the same thing by another way. Now only SDHC needs to

shift data for CSD register. We could parse EMMC_CID by EmmcGetCid() in EmmcGetCsd()

function. What's your opinion?


Best Regards

Haojian

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to