intel / FdtBusPkg

Device Tree-based Platform Device Driver Development for Tiano UEFI
https://wiki.riseproject.dev/display/HOME/EDK2_00_03+-+FdtBusDxe+support
Other
11 stars 1 forks source link

FdtBusDxe DMA API implementation: consider DT device iommu property #20

Open andreiw opened 9 months ago

andreiw commented 9 months ago

Need to figure this out. Basically could expect IOMMU device drivers to publish an IOMMU protocol that would be used by FdtBusDxe.

andreiw commented 9 months ago

https://cdrdv2-public.intel.com/671554/intel-whitepaper-using-iommu-for-dma-protection-in-uefi.pdf https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Include/Protocol/IoMmu.h

It's a bit unfortunate EDKII_IOMMU_MAP doesn't take the EFI_HANDLE. This basically assumes that all IOMMUs in a system have equal capabilities and that the computed bus address (or allocated CPU memory) is equally valid for any IOMMU. That's true for server-grade systems but it doesn't need to be true for any implementation, and certainly won't be true for hardware which provides I/O protection but not translation.

andreiw commented 9 months ago

As a stop gap can add support for EDII_IOMMU_MAP (as well as an example of a DT controller IOMMU), but it's not a bad idea to come up with a better API.