Debian Codegraph @

src/northbridge/amd/pi/00730F01/iommu.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <device/device.h>
4 #include <device/pci.h>
5 #include <device/pci_ids.h>
6 #include <lib.h>
7
8 static void iommu_read_resources(struct device *dev)
9 {
10 struct resource *res;
11
12 /* Get the normal pci resources of this device */
13 pci_dev_read_resources(dev);
14
15 /* IOMMU MMIO registers */
16 res = new_resource(dev, 0x44);
17 res->size = 512 * 1024;
18 res->align = log2(res->size);
19 res->gran = log2(res->size);
20 res->limit = 0xffffffff; /* 4G */
21 res->flags = IORESOURCE_MEM;
22 }
23
24 struct device_operations amd_pi_iommu_ops = {
25 .read_resources = iommu_read_resources,
26 .set_resources = pci_dev_set_resources,
27 .enable_resources = pci_dev_enable_resources,
28 .ops_pci = &pci_dev_ops_pci,
29 };