Hi all,

I have a few questions on eMMC/SD driver when I'm working on my driver.

In my hikey platform, there's no PCI bus. So I create my own DwMmc driver to do the same thing as SdMmcPciHcDxe driver. There's one controller for eMMC and one controller for SD.

1. How to support both eMMC and SD driver in the same driver? The IP is designed for both
eMMC/SD. If we could share the same driver, we could use common code.
I tried to follow SdMmcPciHcDxe driver. I use "Emmc(0)/Ctrl(0)" to indicate the device path of eMMC controller. And I should use "Sd(0)/Ctrl(1)" to indicate the device path of SD controller. Is it right?

When I tried to access one partition, I use this device path "Emmc(0)/Ctrl(0)/HD(5,GPT,00354BCD-BBCB-4CB3-B5AE-CDEFCB5DAC43)". Is it right?


2. When RemainingDevicePath variable is valid, GetSlotNumber() is called in both EmmcDxe and SdDxe. But how could DwMmc driver knows which stack is calling it? Does it mean that I need to implement two different EFI_SD_MMC_PASS_THRU_PROTOCOL interfaces? One is for eMMC, and the other one is for SD.


3. How to create the connection DiskIo and eMMC?
When RemainingDevicePath variable is valid, GetSlotNumber() is invoked in EmmcDxeDriverBindingStart(). But where RemainingDevicePath is set?
When I debug code, I got this debug message in below.
#EmmcDxeDriverBindingStart, 909, Remain path:VenHw(CE660500-824D-11E0-AC72-0002A5D5C51B)

The CE660500 belongs to LcdGraphicsOutputDxe. And I didn't build it into the firmware at all. I don't know where it comes from. If I check the eMMC device path in GetSlotNumber(), I'll skip it and DiskIo won't run successfully. So partition checking won't run in DiskIo. If I force the GetSlotNumber() empty to pass this RemainingDevicePath, partition checking could run in DiskIo. I guess that something is missing between DiskIo and eMMC driver. Do you have any idea on this? This issue blocks me to enable multiple slots.


4. Driver dependency. EmmcDxe and SdDxe are both UEFI_DRIVER. VariableRuntimeDxe Driver is DXE_RUNTIME_DRIVER. But the dependency is in below.

EmmcDxe --->  DwMmcDxe ---> BlockVariableDxe ---> VariableRuntimeDxe

Now I hack EmmcDxe from UEFI_DRIVER to DXE_RUNTIME to make this dependency working. Is there any other solution without hacking?

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

Reply via email to