soc/amd/common/block/iommu: move ACPI name to common code
Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I0f1dce92475ce0ee05a8d090fc3b3d1e613f62c3 Reviewed-on: https://review.coreboot.org/c/coreboot/+/50821 Reviewed-by: Raul Rangel <rrangel@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
@@ -21,11 +21,21 @@ static void iommu_read_resources(struct device *dev)
|
|||||||
res->flags = IORESOURCE_MEM;
|
res->flags = IORESOURCE_MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG(HAVE_ACPI_TABLES)
|
||||||
|
static const char *iommu_acpi_name(const struct device *dev)
|
||||||
|
{
|
||||||
|
return "IOMM";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct device_operations iommu_ops = {
|
static struct device_operations iommu_ops = {
|
||||||
.read_resources = iommu_read_resources,
|
.read_resources = iommu_read_resources,
|
||||||
.set_resources = pci_dev_set_resources,
|
.set_resources = pci_dev_set_resources,
|
||||||
.enable_resources = pci_dev_enable_resources,
|
.enable_resources = pci_dev_enable_resources,
|
||||||
.ops_pci = &pci_dev_ops_pci,
|
.ops_pci = &pci_dev_ops_pci,
|
||||||
|
#if CONFIG(HAVE_ACPI_TABLES)
|
||||||
|
.acpi_name = iommu_acpi_name,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static const unsigned short pci_device_ids[] = {
|
static const unsigned short pci_device_ids[] = {
|
||||||
|
@@ -35,8 +35,6 @@ static const char *soc_acpi_name(const struct device *dev)
|
|||||||
|
|
||||||
if (dev->bus->dev->path.type == DEVICE_PATH_DOMAIN) {
|
if (dev->bus->dev->path.type == DEVICE_PATH_DOMAIN) {
|
||||||
switch (dev->path.pci.devfn) {
|
switch (dev->path.pci.devfn) {
|
||||||
case IOMMU_DEVFN:
|
|
||||||
return "IOMM";
|
|
||||||
default:
|
default:
|
||||||
printk(BIOS_WARNING, "Unknown root PCI device: dev: %d, fn: %d\n",
|
printk(BIOS_WARNING, "Unknown root PCI device: dev: %d, fn: %d\n",
|
||||||
PCI_SLOT(dev->path.pci.devfn), PCI_FUNC(dev->path.pci.devfn));
|
PCI_SLOT(dev->path.pci.devfn), PCI_FUNC(dev->path.pci.devfn));
|
||||||
|
Reference in New Issue
Block a user