From dda7793e53f514c7502c0b51e350eb8730a357b8 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 16 Nov 2023 16:17:21 +0100 Subject: nb/amd/pi/00730F01: assign IOMMU ops in chipset devicetree Since the IOMMU is always function 2 of device 0 on bus 0, the device operations can be statically assigned in the devicetree and there's no need to bind the IOMMU device operations to the PCI device during runtime via a list of PCI IDs. TEST=PC Engines APU2 still boots and doesn't show any new problems Signed-off-by: Felix Held Change-Id: I84e949500ee86e0fcb2d15791502f5e3e7127703 Reviewed-on: https://review.coreboot.org/c/coreboot/+/79105 Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/northbridge/amd/pi/00730F01/chipset.cb | 4 +++- src/northbridge/amd/pi/00730F01/iommu.c | 8 +------- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src/northbridge/amd/pi') diff --git a/src/northbridge/amd/pi/00730F01/chipset.cb b/src/northbridge/amd/pi/00730F01/chipset.cb index b63d9fd649..c03882cc61 100644 --- a/src/northbridge/amd/pi/00730F01/chipset.cb +++ b/src/northbridge/amd/pi/00730F01/chipset.cb @@ -10,7 +10,9 @@ chip northbridge/amd/pi/00730F01 device pci 0.0 alias gnb on ops amd_pi_northbridge_ops end - device pci 0.2 alias iommu off end + device pci 0.2 alias iommu off + ops amd_pi_iommu_ops + end device pci 1.0 alias gfx off end device pci 1.1 alias gfx_hda off end device pci 2.0 on end # Dummy device function, do not disable diff --git a/src/northbridge/amd/pi/00730F01/iommu.c b/src/northbridge/amd/pi/00730F01/iommu.c index 3c31db49f0..986c6faa15 100644 --- a/src/northbridge/amd/pi/00730F01/iommu.c +++ b/src/northbridge/amd/pi/00730F01/iommu.c @@ -21,15 +21,9 @@ static void iommu_read_resources(struct device *dev) res->flags = IORESOURCE_MEM; } -static struct device_operations iommu_ops = { +struct device_operations amd_pi_iommu_ops = { .read_resources = iommu_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .ops_pci = &pci_dev_ops_pci, }; - -static const struct pci_driver iommu_driver __pci_driver = { - .ops = &iommu_ops, - .vendor = PCI_VID_AMD, - .device = PCI_DID_AMD_16H_MODEL_303F_NB_IOMMU, -}; -- cgit v1.2.3