Attention is currently required from: Jason Glenesk, Raul Rangel, Matt DeVillier, Fred Reitberger, Felix Held.
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/68146 )
Change subject: soc/amd/*: Hook up iommu ops in devicetree ......................................................................
soc/amd/*: Hook up iommu ops in devicetree
This removed the need to maintain a PCI driver.
Change-Id: I43def81d615749008fcc9de8734fa2aca752aa9d Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/soc/amd/cezanne/chipset.cb M src/soc/amd/common/block/iommu/iommu.c M src/soc/amd/mendocino/chipset_mendocino.cb M src/soc/amd/mendocino/chipset_rembrandt.cb M src/soc/amd/picasso/chipset.cb 5 files changed, 17 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/68146/1
diff --git a/src/soc/amd/cezanne/chipset.cb b/src/soc/amd/cezanne/chipset.cb index 63cecd5..1e3b946 100644 --- a/src/soc/amd/cezanne/chipset.cb +++ b/src/soc/amd/cezanne/chipset.cb @@ -5,7 +5,7 @@ device domain 0 on ops cezanne_pci_domain_ops device pci 00.0 alias gnb on ops cezanne_root_complex_operations end - device pci 00.2 alias iommu off end + device pci 00.2 alias iommu off ops amd_iommu_ops end
device pci 01.0 on end # Dummy Host Bridge, do not disable device pci 01.1 alias gpp_gfx_bridge_0 off end diff --git a/src/soc/amd/common/block/iommu/iommu.c b/src/soc/amd/common/block/iommu/iommu.c index 4f20dd4..52861f2 100644 --- a/src/soc/amd/common/block/iommu/iommu.c +++ b/src/soc/amd/common/block/iommu/iommu.c @@ -2,7 +2,6 @@
#include <device/device.h> #include <device/pci.h> -#include <device/pci_ids.h> #include <lib.h>
static void iommu_read_resources(struct device *dev) @@ -28,7 +27,7 @@ } #endif
-static struct device_operations iommu_ops = { +struct device_operations amd_iommu_ops = { .read_resources = iommu_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, @@ -37,18 +36,3 @@ .acpi_name = iommu_acpi_name, #endif }; - -static const unsigned short pci_device_ids[] = { - PCI_DID_AMD_15H_MODEL_303F_NB_IOMMU, - PCI_DID_AMD_15H_MODEL_707F_NB_IOMMU, - PCI_DID_AMD_17H_MODEL_1020_NB_IOMMU, - PCI_DID_AMD_17H_MODEL_606F_NB_IOMMU, - PCI_DID_AMD_17H_MODEL_A0AF_NB_IOMMU, - 0 -}; - -static const struct pci_driver iommu_driver __pci_driver = { - .ops = &iommu_ops, - .vendor = PCI_VID_AMD, - .devices = pci_device_ids, -}; diff --git a/src/soc/amd/mendocino/chipset_mendocino.cb b/src/soc/amd/mendocino/chipset_mendocino.cb index 380e596..3715306 100644 --- a/src/soc/amd/mendocino/chipset_mendocino.cb +++ b/src/soc/amd/mendocino/chipset_mendocino.cb @@ -5,7 +5,7 @@ device domain 0 on ops mendocino_pci_domain_ops device pci 00.0 alias gnb on mendocino_root_complex_operations end - device pci 00.2 alias iommu off end + device pci 00.2 alias iommu off ops amd_iommu_ops end
device pci 01.0 on end # Dummy Host Bridge
diff --git a/src/soc/amd/mendocino/chipset_rembrandt.cb b/src/soc/amd/mendocino/chipset_rembrandt.cb index 56afb3d..b81890f 100644 --- a/src/soc/amd/mendocino/chipset_rembrandt.cb +++ b/src/soc/amd/mendocino/chipset_rembrandt.cb @@ -5,7 +5,7 @@ device domain 0 on ops mendocino_pci_domain_ops device pci 00.0 alias gnb on ops mendocino_root_complex_operations end - device pci 00.2 alias iommu off end + device pci 00.2 alias iommu off ops amd_iommu_ops end
device pci 01.0 on end # Dummy Host Bridge
diff --git a/src/soc/amd/picasso/chipset.cb b/src/soc/amd/picasso/chipset.cb index 07d7547..9a69189 100644 --- a/src/soc/amd/picasso/chipset.cb +++ b/src/soc/amd/picasso/chipset.cb @@ -7,7 +7,7 @@ device domain 0 on ops picasso_pci_domain_ops device pci 00.0 alias gnb on ops picasso_root_complex_operations end - device pci 00.2 alias iommu off end + device pci 00.2 alias iommu off ops amd_iommu_ops end device pci 01.0 on end # Dummy Host Bridge, do not disable device pci 01.1 alias gpp_bridge_0 off end device pci 01.2 alias gpp_bridge_1 off end