On Tue, Dec 06, 2016 at 02:29:17PM +0800, Haojian Zhuang wrote:
On 30 November 2016 at 04:01, Leif Lindholm leif.lindholm@linaro.org wrote:
On Wed, Nov 23, 2016 at 03:12:28PM +0800, Haojian Zhuang wrote:
Support designware emmc controller.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang haojian.zhuang@linaro.org
Drivers/Mmc/DwEmmcDxe/DwEmmc.h | 128 +++++++ Drivers/Mmc/DwEmmcDxe/DwEmmcDxe.c | 651 ++++++++++++++++++++++++++++++++++++ Drivers/Mmc/DwEmmcDxe/DwEmmcDxe.dec | 42 +++ Drivers/Mmc/DwEmmcDxe/DwEmmcDxe.inf | 55 +++ 4 files changed, 876 insertions(+) create mode 100644 Drivers/Mmc/DwEmmcDxe/DwEmmc.h create mode 100644 Drivers/Mmc/DwEmmcDxe/DwEmmcDxe.c create mode 100644 Drivers/Mmc/DwEmmcDxe/DwEmmcDxe.dec create mode 100644 Drivers/Mmc/DwEmmcDxe/DwEmmcDxe.inf
- // Setup clock that could not be higher than 400KHz.
- Status = DwEmmcSetClock (400000);
- ASSERT (!EFI_ERROR (Status));
- MicroSecondDelay (100);
Why the delay? Does this also need a barrier?
It's used to wait clock stable. It's not related to memory barrier. I'll add comments.
Thanks!
+[Guids.common]
- gDwEmmcDxeTokenSpaceGuid = { 0x6fdd76a9, 0xf220, 0x4f1d, { 0x9c, 0xcf, 0xbc, 0x2d, 0x68, 0x29, 0xab, 0x9c }}
Again, this looks a bit funky to me. Is this working around some missing [Protocols] dependency?
I also need to quote two PCD values in DSC file. If I removed gDwEmmcDxeTokenSpaceGuid, how could I quote PCD values in DSC file?
No, sorry, this was me being confused. I interpreted this as being another case of what I commented on in 1/3, but this is completely correct.
Regards,
Leif
+[PcdsFixedAtBuild.common]
- # DwEmmc Driver PCDs
- gDwEmmcDxeTokenSpaceGuid.PcdDwEmmcDxeBaseAddress|0x0|UINT32|0x00000001
- gDwEmmcDxeTokenSpaceGuid.PcdDwEmmcDxeClockFrequencyInHz|0x0|UINT32|0x00000002
Best Regards Haojian