Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/acpica/acpi_iort.c
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | for (i = 0; i < node->nentries; i++, entry++) { | ||||
if (i == id_map) | if (i == id_map) | ||||
continue; | continue; | ||||
if (entry->base <= id && id <= entry->end) | if (entry->base <= id && id <= entry->end) | ||||
break; | break; | ||||
} | } | ||||
if (i == node->nentries) | if (i == node->nentries) | ||||
return (NULL); | return (NULL); | ||||
if ((entry->flags & ACPI_IORT_ID_SINGLE_MAPPING) == 0) | if ((entry->flags & ACPI_IORT_ID_SINGLE_MAPPING) == 0) | ||||
*outid = entry->outbase + (id - entry->base); | *outid = entry->outbase + (id - entry->base); | ||||
else | else | ||||
*outid = entry->outbase; | *outid = entry->outbase; | ||||
return (entry->out_node); | return (entry->out_node); | ||||
} | } | ||||
/* | /* | ||||
* Map a PCI RID to a SMMU node or an ITS node, based on outtype. | * Map a PCI RID to a SMMU node or an ITS node, based on outtype. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 387 Lines • ▼ Show 20 Lines | acpi_iort_map_pci_msi(u_int seg, u_int rid, u_int *xref, u_int *devid) | ||||
/* This should be an ITS node */ | /* This should be an ITS node */ | ||||
KASSERT(node->type == ACPI_IORT_NODE_ITS_GROUP, ("bad group")); | KASSERT(node->type == ACPI_IORT_NODE_ITS_GROUP, ("bad group")); | ||||
/* return first node, we don't handle more than that now. */ | /* return first node, we don't handle more than that now. */ | ||||
*xref = node->entries.its[0].xref; | *xref = node->entries.its[0].xref; | ||||
return (0); | return (0); | ||||
} | } | ||||
int | |||||
acpi_iort_map_pci_smmuv3(u_int seg, u_int rid, u_int *xref, u_int *sid) | |||||
{ | |||||
ACPI_IORT_SMMU_V3 *smmu; | |||||
struct iort_node *node; | |||||
node = iort_pci_rc_map(seg, rid, ACPI_IORT_NODE_SMMU_V3, sid); | |||||
if (node == NULL) | |||||
return (ENOENT); | |||||
/* This should be an SMMU node. */ | |||||
KASSERT(node->type == ACPI_IORT_NODE_SMMU_V3, ("bad node")); | |||||
smmu = (ACPI_IORT_SMMU_V3 *)&node->data.smmu_v3; | |||||
*xref = smmu->BaseAddress; | |||||
return (0); | |||||
} |