Hi, Eugene
The EDKII XhciDxe driver doesn't use PciIo.AllocateBuffer()/Map() to allocate
DMA buffers. It's mainly because EDKII is 1:1 mapping on Pci physical address
and Cpu logical address for IA architecture. AllocateBuffer() is enough for
current case.
We only implement this feature at EHCI driver as Andrew from Apple was trying
to use this driver at an ARM based board "Beagle Board".
For which buffers to be mapped, I think all MMIO buffers specified in XHCI spec
are required. For how to do this, please refer to EhciDxe driver.
We ever constructed an non 1:1 mapping env at DUET, we mapped 0~1M to
FFF00000~FFFFFFFF, other memory regions are shifted downwards with 1M offset.
You can try this way.
Thanks
Feng
From: Cohen, Eugene [mailto:eug...@hp.com]
Sent: Thursday, July 25, 2013 4:29 AM
To: edk2-devel@lists.sourceforge.net
Subject: [edk2] XHCI DMA Buffer Issues
Dear XhciDxe Maintainer,
I'm currently reviewing the XhciDxe driver and I'm trying to figure out how DMA
buffers are allocated. I see a number of pool and page allocations but I do
not see any called to PCI_IO Map()/Unmap() or to AllocateBuffer()/FreeBuffer().
This appears to be violating the rules for PCI DMA buffers since they are not
being mapped (and if common buffers are desired then they are also not being
allocated with AllocateBuffer as required).
Can someone more familiar with XHCI help me determine which buffers need to be
mapped and how (BusMasterRead, BusMasterWrite, CommonBuffer)?
It would be useful if we had a test environment that could catch driver DMA
buffer mapping issues earlier. I think one way to do this would be set up the
MMU in a non-identity mode so that anyone trying to use a processor virtual
address for DMA would see a failure.
Thanks,
Eugene
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel