Hi, Marcin

You may misunderstand what I meant. Sorry for that.

At first, the SD_MMC_PASS_THRU protocol is defined by UEFI spec, you couldn't 
change its interfaces.

Secondly, the transfer mode judgement should be done at SdMmcPciHcDxe driver. 
This way could avoid introducing a new interface like you proposed. And we have 
done this at SdMmcCreateTrb(). (You can search Trb->Mode key word to find out 
the place).

Thirdly, I suppose your PIO mode doesn't work as I didn't add PIO full support. 
I thought DMA support is enough (of course now the assumption doesn't meet your 
requirement). I only force to do PIO for clock tuning cmd. So you would have to 
update the logic in SdMmcExecTrb() to support PIO mode.
1. line 1272 to line 1276 of SdMmcCreateTrb() to assign PIO mode for your cmds 
besides clock tuning cmd.
2. line 1815 to line 1839 of SdMmcCheckTrbResult() to read data till all blocks 
get read out. (see SD Host controller spec 3.0 figure 3-13)

Last, I am not sure why SetBlockLen() and StopTransmission() are needed for 
multiple block r/w. we always use 512 block size, and looks like we should use 
CMD12 or CMD23 for SD card to stop transmission whatever it's in DMA or PIO. Am 
I right?

Thanks
Feng

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Marcin 
Wojtas
Sent: Wednesday, June 22, 2016 11:09 PM
To: edk2-devel@lists.01.org
Cc: Tian, Feng <feng.t...@intel.com>; ha...@marvell.com; 
leif.lindh...@linaro.org; n...@marvell.com; Gao, Liming <liming....@intel.com>; 
Kinney, Michael D <michael.d.kin...@intel.com>
Subject: [edk2] [PATCH v2 0/6] MMC fixes and PIO mode

Hello,

We are sending v2 of the fixes and PIO mode support. The main change is 
replacing PCD introduction with new function added to 
EFI_SD_MMC_PASS_THRU_PROTOCOL, which allows obtaining information about DMA 
usage from host controller capabilities.

Any comments or remarks would be very welcome.

Changelog:
v1 -> v2
* fix EmmcPeimSwitchToHighSpeed argument order as well
* introduce IsDmaEnabled in EFI_SD_MMC_PASS_THRU_PROTOCOL and
  modify condition checks along the code
* improve commit logs

Jan Dąbroś (4):
  MdeModulePkg: SdMmc: Introduce IsDmaEnabled function
  MdeModulePkg/SdDxe: Add sending StopTransmission command
  MdeModulePkg/SdDxe: Add checking device status procedure
  MdeModulePkg/SdDxe: Add SetBlockLen command

Joe Zhou (2):
  MdeModulePkg: SdMmc: Fix parameters order in EmmcSwitch functions call
  MdeModulePkg: SdMmc: Add delay before eMMC reset

 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c    |   5 +-
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c |  39 +++++-  
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h |  21 +++
 MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c       |   2 +-
 MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c              | 150 +++++++++++++++++++++
 MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c                  |   3 +
 MdeModulePkg/Bus/Sd/SdDxe/SdDxe.h                  |   1 +
 MdePkg/Include/Protocol/SdMmcPassThru.h            |  22 +++
 8 files changed, 240 insertions(+), 3 deletions(-)  mode change 100644 => 
100755 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c

--
1.8.3.1

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

Reply via email to