Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107080862
D39182.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D39182.diff
View Options
diff --git a/sys/dev/pci/pci_host_generic_acpi.c b/sys/dev/pci/pci_host_generic_acpi.c
--- a/sys/dev/pci/pci_host_generic_acpi.c
+++ b/sys/dev/pci/pci_host_generic_acpi.c
@@ -412,6 +412,31 @@
return (0);
}
+static int
+generic_pcie_get_iommu(device_t pci, device_t child, uintptr_t *id)
+{
+ struct generic_pcie_acpi_softc *sc;
+ struct pci_id_ofw_iommu *iommu;
+ u_int iommu_sid, iommu_xref;
+ uintptr_t rid;
+ int err;
+
+ iommu = (struct pci_id_ofw_iommu *)id;
+
+ sc = device_get_softc(pci);
+ err = pcib_get_id(pci, child, PCI_ID_RID, &rid);
+ if (err != 0)
+ return (err);
+ err = acpi_iort_map_pci_smmuv3(sc->base.ecam, rid, &iommu_xref,
+ &iommu_sid);
+ if (err == 0) {
+ iommu->id = iommu_sid;
+ iommu->xref = iommu_xref;
+ }
+
+ return (err);
+}
+
static int
generic_pcie_acpi_alloc_msi(device_t pci, device_t child, int count,
int maxcount, int *irqs)
@@ -479,11 +504,13 @@
generic_pcie_acpi_get_id(device_t pci, device_t child, enum pci_id_type type,
uintptr_t *id)
{
+ if (type == PCI_ID_OFW_IOMMU)
+ return (generic_pcie_get_iommu(pci, child, id));
if (type == PCI_ID_MSI)
return (generic_pcie_map_id(pci, child, id));
- else
- return (pcib_get_id(pci, child, type, id));
+
+ return (pcib_get_id(pci, child, type, id));
}
static device_method_t generic_pcie_acpi_methods[] = {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 7:49 PM (15 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15745878
Default Alt Text
D39182.diff (1 KB)
Attached To
Mode
D39182: Add PCI_ID_OFW_IOMMU to the pci ecam ACPI driver
Attached
Detach File
Event Timeline
Log In to Comment