Re: [edk2] [patch 0/4] Add EDKII SD/MMC stack to manage SD/EMMC device

2016-04-08 Thread Ard Biesheuvel
On 8 April 2016 at 06:59, Tian, Feng  wrote:
> Hi, Ard
>
> These two files are used to identify device type and set the corresponding 
> bus mode. It have to be in SdMmcPciHcDxe as it is not only related with cmd 
> execution but also related with host controller operation.
>
> As for why we don't extract is a lib, it's mainly because those helper 
> functions are used to support SD memory card and eMMC device. If there is 
> more device support request, the interface may be added/changed.
>

Thanks for the explanation. If it makes sense to pull this out into a
library for reuse in non-PCI host controllers, we will propose a patch
for it.

Thanks,
Ard.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch 0/4] Add EDKII SD/MMC stack to manage SD/EMMC device

2016-04-07 Thread Ard Biesheuvel
On 23 March 2016 at 03:51, Feng Tian  wrote:
> The EDKII SD/MMC stack includes:
> 1. Dxe phase support by:
>i.  SdMmcPciHcDxe driver to consume PciIo and produce SdMmcPassThru
>ii. SdDxe driver to consume SdMmcPassThru to produce BlkIo1/BlkIo2
>iii.EmmcDxe driver to consume SdMmcPassThru to produce BlkIo1/BlkIo2/SSP
>
> 2. Pei phase support
>i.  SdBlockIoPei driver to consume SdMmcHostController Ppi and produce 
> VirutalBlkIo1&2
>ii. EmmcBlockIoPei driver to consume SdMmcHostController Ppi and produce 
> VirutalBlkIo1&2
>iii.SdMmcPciHcPei driver to produce SdMmcHostController Ppi
>

Hello all,

I have a question about this series. I am looking at what we need to
do to switch our platforms from the MmcDxe driver in EmbeddedPkg to
this new standardised implementation.

What I don't understand is why these files:

>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c| 1096 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c  | 1166 

are part of the PCI host controller implementation, and not of the
respective EmmcDxe and SdDxe drivers? The code in there has nothing to
do with PCI, and refers to various MMC and SD specs, so it seems to me
that this code belongs elsewhere so that we can reuse it for non-PCI
host controllers. And if it must run in the context of this driver, it
should be at least factored out into a library.

Thanks,
Ard.


>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 1154 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h |  775 ++
>  .../Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf|   72 +
>  .../Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.uni|  Bin 0 -> 2216 bytes
>  .../Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxeExtra.uni   |  Bin 0 -> 1348 bytes
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c   | 1879 +
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h   |  544 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.c |  175 ++
>  MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.h |   86 +
>  .../Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.inf|   56 +
>  .../Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.uni|  Bin 0 -> 2096 bytes
>  .../Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPeiExtra.uni   |  Bin 0 -> 1378 bytes
>  .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.c |  779 ++
>  .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.h |  381 +++
>  .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.inf   |   62 +
>  .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.uni   |  Bin 0 -> 1696 bytes
>  .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPeiExtra.uni  |  Bin 0 -> 1362 bytes
>  MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c |  455 
>  MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHcMem.h |   61 +
>  MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c   | 2780 +++
>  MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.h   |  345 +++
>  MdeModulePkg/Bus/Sd/EmmcDxe/ComponentName.c|  241 ++
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c  | 1591 +++
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.h  |  466 
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c  | 1176 
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.h  |  495 
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.inf|   66 +
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.uni|  Bin 0 -> 2020 bytes
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxeExtra.uni   |  Bin 0 -> 1306 bytes
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c|  610 +
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.h|  377 +++
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.inf  |   62 +
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.uni  |  Bin 0 -> 1748 bytes
>  .../Bus/Sd/SdBlockIoPei/SdBlockIoPeiExtra.uni  |  Bin 0 -> 1354 bytes
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c |  455 
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.h |   61 +
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c   | 2869 
> 
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.h   |  354 +++
>  MdeModulePkg/Bus/Sd/SdDxe/ComponentName.c  |  240 ++
>  MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c  |  971 +++
>  MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.h  |  221 ++
>  MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c  |  883 ++
>  MdeModulePkg/Bus/Sd/SdDxe/SdDxe.h  |  469 
>  MdeModulePkg/Bus/Sd/SdDxe/SdDxe.inf|   65 +
>  MdeModulePkg/Bus/Sd/SdDxe/SdDxe.uni|  Bin 0 -> 2024 bytes
>  MdeModulePkg/Bus/Sd/SdDxe/SdDxeExtra.uni   |  Bin 0 -> 2036 bytes
>  MdeModulePkg/Include/Ppi/SdMmcHostController.h |   64 +
>  MdeModulePkg/MdeModulePkg.dec  |9 +
>  MdeModulePkg/MdeModulePkg.dsc  |6 +
>  MdePkg/Include/IndustryStandard/Emmc.h |  297 ++
>  MdePkg/Include/IndustryStandard/Sd.h   |  181 ++
>  MdePkg/Include/Protocol/DevicePath.h   |   11 

Re: [edk2] [patch 0/4] Add EDKII SD/MMC stack to manage SD/EMMC device

2016-03-29 Thread Wu, Hao A
Hi Feng,

Please convert the UNI files to UTF-8 format.
After the problem is settled and adding prefix according to Jiewen's comments,
Reviewed-by: Hao Wu 

Best Regards,
Hao Wu

> -Original Message-
> From: Tian, Feng
> Sent: Wednesday, March 23, 2016 10:51 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A; Zeng, Star
> Subject: [patch 0/4] Add EDKII SD/MMC stack to manage SD/EMMC device
> 
> The EDKII SD/MMC stack includes:
> 1. Dxe phase support by:
>i.  SdMmcPciHcDxe driver to consume PciIo and produce SdMmcPassThru
>ii. SdDxe driver to consume SdMmcPassThru to produce BlkIo1/BlkIo2
>iii.EmmcDxe driver to consume SdMmcPassThru to produce
> BlkIo1/BlkIo2/SSP
> 
> 2. Pei phase support
>i.  SdBlockIoPei driver to consume SdMmcHostController Ppi and produce
> VirutalBlkIo1&2
>ii. EmmcBlockIoPei driver to consume SdMmcHostController Ppi and
> produce VirutalBlkIo1&2
>iii.SdMmcPciHcPei driver to produce SdMmcHostController Ppi
> 
> Feng Tian (4):
>   MdePkg: Add EFI_SD_MMC_PASS_THRU_PROTOCOL definition
>   MdePkg/DevicePath: Add EMMC device path definition
>   MdePkg/IndustryStandard: Add SD/EMMC common definitions
>   MdeModulePkg/SdMmc: Add EDKII SD/MMC stack
> 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/ComponentName.c |  211 ++
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c| 1096
> 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c  | 1166 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 1154
> 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h |  775 ++
>  .../Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf|   72 +
>  .../Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.uni|  Bin 0 -> 2216 bytes
>  .../Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxeExtra.uni   |  Bin 0 -> 1348
> bytes
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c   | 1879
> +
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h   |  544 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.c |  175 ++
>  MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.h |   86 +
>  .../Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.inf|   56 +
>  .../Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.uni|  Bin 0 -> 2096 bytes
>  .../Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPeiExtra.uni   |  Bin 0 -> 1378 bytes
>  .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.c |  779 ++
>  .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.h |  381 +++
>  .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.inf   |   62 +
>  .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.uni   |  Bin 0 -> 1696 bytes
>  .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPeiExtra.uni  |  Bin 0 -> 1362 bytes
>  MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c |  455 
>  MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHcMem.h |   61 +
>  MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c   | 2780
> +++
>  MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.h   |  345 +++
>  MdeModulePkg/Bus/Sd/EmmcDxe/ComponentName.c|  241 ++
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c  | 1591
> +++
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.h  |  466 
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c  | 1176 
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.h  |  495 
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.inf|   66 +
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.uni|  Bin 0 -> 2020 bytes
>  MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxeExtra.uni   |  Bin 0 -> 1306
> bytes
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c|  610 +
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.h|  377 +++
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.inf  |   62 +
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.uni  |  Bin 0 -> 1748
> bytes
>  .../Bus/Sd/SdBlockIoPei/SdBlockIoPeiExtra.uni  |  Bin 0 -> 1354 bytes
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c |  455 
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.h |   61 +
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c   | 2869
> 
>  MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.h   |  354 +++
>  MdeModulePkg/Bus/Sd/SdDxe/ComponentName.c  |  240 ++
>  MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c  |  971 +++
>  MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.h  |  221 ++
>  MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c  |  883 ++
>  MdeModulePkg/Bus/Sd/SdDxe/SdDxe.h  |  469 
>  MdeModulePkg/Bus/Sd/SdDxe/SdDxe.inf|   65 +
>  MdeModulePkg/Bus/Sd/SdDxe/SdDxe.uni|  Bin 0 -> 2024 bytes
>  MdeModulePkg/Bus/Sd/SdDxe/SdDxeExtra.uni   |  Bin 0 -> 2036 bytes
>  MdeModulePkg/Include/Ppi/SdMmcHostController.h |   64 +
>  MdeModulePkg/MdeModulePkg.dec  |9 +
>  MdeModulePkg/MdeModulePkg.dsc  |6 +
>  MdePkg/Include/IndustryStandard/Emmc.h |  297 ++
>  MdePkg/Include/IndustryStandard/Sd.h   |  181 ++
>  

[edk2] [patch 0/4] Add EDKII SD/MMC stack to manage SD/EMMC device

2016-03-22 Thread Feng Tian
The EDKII SD/MMC stack includes:
1. Dxe phase support by:
   i.  SdMmcPciHcDxe driver to consume PciIo and produce SdMmcPassThru
   ii. SdDxe driver to consume SdMmcPassThru to produce BlkIo1/BlkIo2
   iii.EmmcDxe driver to consume SdMmcPassThru to produce BlkIo1/BlkIo2/SSP

2. Pei phase support
   i.  SdBlockIoPei driver to consume SdMmcHostController Ppi and produce 
VirutalBlkIo1&2
   ii. EmmcBlockIoPei driver to consume SdMmcHostController Ppi and produce 
VirutalBlkIo1&2
   iii.SdMmcPciHcPei driver to produce SdMmcHostController Ppi

Feng Tian (4):
  MdePkg: Add EFI_SD_MMC_PASS_THRU_PROTOCOL definition
  MdePkg/DevicePath: Add EMMC device path definition
  MdePkg/IndustryStandard: Add SD/EMMC common definitions
  MdeModulePkg/SdMmc: Add EDKII SD/MMC stack

 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/ComponentName.c |  211 ++
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c| 1096 
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c  | 1166 
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 1154 
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h |  775 ++
 .../Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf|   72 +
 .../Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.uni|  Bin 0 -> 2216 bytes
 .../Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxeExtra.uni   |  Bin 0 -> 1348 bytes
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c   | 1879 +
 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h   |  544 
 MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.c |  175 ++
 MdeModulePkg/Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.h |   86 +
 .../Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.inf|   56 +
 .../Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPei.uni|  Bin 0 -> 2096 bytes
 .../Bus/Pci/SdMmcPciHcPei/SdMmcPciHcPeiExtra.uni   |  Bin 0 -> 1378 bytes
 .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.c |  779 ++
 .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.h |  381 +++
 .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.inf   |   62 +
 .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPei.uni   |  Bin 0 -> 1696 bytes
 .../Bus/Sd/EmmcBlockIoPei/EmmcBlockIoPeiExtra.uni  |  Bin 0 -> 1362 bytes
 MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHcMem.c |  455 
 MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHcMem.h |   61 +
 MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.c   | 2780 +++
 MdeModulePkg/Bus/Sd/EmmcBlockIoPei/EmmcHci.h   |  345 +++
 MdeModulePkg/Bus/Sd/EmmcDxe/ComponentName.c|  241 ++
 MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.c  | 1591 +++
 MdeModulePkg/Bus/Sd/EmmcDxe/EmmcBlockIo.h  |  466 
 MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.c  | 1176 
 MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.h  |  495 
 MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.inf|   66 +
 MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.uni|  Bin 0 -> 2020 bytes
 MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxeExtra.uni   |  Bin 0 -> 1306 bytes
 MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c|  610 +
 MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.h|  377 +++
 MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.inf  |   62 +
 MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.uni  |  Bin 0 -> 1748 bytes
 .../Bus/Sd/SdBlockIoPei/SdBlockIoPeiExtra.uni  |  Bin 0 -> 1354 bytes
 MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.c |  455 
 MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHcMem.h |   61 +
 MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.c   | 2869 
 MdeModulePkg/Bus/Sd/SdBlockIoPei/SdHci.h   |  354 +++
 MdeModulePkg/Bus/Sd/SdDxe/ComponentName.c  |  240 ++
 MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c  |  971 +++
 MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.h  |  221 ++
 MdeModulePkg/Bus/Sd/SdDxe/SdDxe.c  |  883 ++
 MdeModulePkg/Bus/Sd/SdDxe/SdDxe.h  |  469 
 MdeModulePkg/Bus/Sd/SdDxe/SdDxe.inf|   65 +
 MdeModulePkg/Bus/Sd/SdDxe/SdDxe.uni|  Bin 0 -> 2024 bytes
 MdeModulePkg/Bus/Sd/SdDxe/SdDxeExtra.uni   |  Bin 0 -> 2036 bytes
 MdeModulePkg/Include/Ppi/SdMmcHostController.h |   64 +
 MdeModulePkg/MdeModulePkg.dec  |9 +
 MdeModulePkg/MdeModulePkg.dsc  |6 +
 MdePkg/Include/IndustryStandard/Emmc.h |  297 ++
 MdePkg/Include/IndustryStandard/Sd.h   |  181 ++
 MdePkg/Include/Protocol/DevicePath.h   |   11 +
 MdePkg/Include/Protocol/SdMmcPassThru.h|  264 ++
 .../Library/UefiDevicePathLib/DevicePathFromText.c |   29 +
 .../Library/UefiDevicePathLib/DevicePathToText.c   |   32 +
 MdePkg/MdePkg.dec  |3 +
 59 files changed, 24645 insertions(+)
 create mode 100644 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/ComponentName.c
 create mode 100644 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
 create mode 100644 MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
 create mode 100644