1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/device.h>
4 #include <device/pci.h>
5 #include <device/pci_ids.h>
8 static void iommu_read_resources(struct device
*dev
)
12 /* Get the normal pci resources of this device */
13 pci_dev_read_resources(dev
);
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
;
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
,