Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/75829?usp=email )
Change subject: soc/amd/common/iommu.c: Make sure iommu is enabled ......................................................................
soc/amd/common/iommu.c: Make sure iommu is enabled
Don't rely on vendorcode to set enable bit on IOMMU.
Signed-off-by: Arthur Heymans arthur@aheymans.xyz Change-Id: I1805a20656b7fb3915f8cc93c618ee074461840f --- M src/soc/amd/common/block/iommu/iommu.c 1 file changed, 11 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/29/75829/1
diff --git a/src/soc/amd/common/block/iommu/iommu.c b/src/soc/amd/common/block/iommu/iommu.c index 52861f2..c6ff67b 100644 --- a/src/soc/amd/common/block/iommu/iommu.c +++ b/src/soc/amd/common/block/iommu/iommu.c @@ -20,6 +20,16 @@ res->flags = IORESOURCE_MEM; }
+ +static void iommu_enable_resources(struct device *dev) +{ + uint32_t base = pci_read_config32(dev, 0x44); + base |= 1; + pci_write_config32(dev, 0x44, base); + printk(BIOS_DEBUG, "%s -> mmio enable: %08X", __func__, pci_read_config32(dev, 0x44)); + pci_dev_enable_resources(dev); +} + #if CONFIG(HAVE_ACPI_TABLES) static const char *iommu_acpi_name(const struct device *dev) { @@ -30,7 +40,7 @@ struct device_operations amd_iommu_ops = { .read_resources = iommu_read_resources, .set_resources = pci_dev_set_resources, - .enable_resources = pci_dev_enable_resources, + .enable_resources = iommu_enable_resources, .ops_pci = &pci_dev_ops_pci, #if CONFIG(HAVE_ACPI_TABLES) .acpi_name = iommu_acpi_name,