soc: Remove copyright notices
[coreboot.git] / src / soc / amd / common / block / iommu / iommu.c
blob18d91059595165c07d1877a3a0ee605e32cfca02
1 /*
2 * This file is part of the coreboot project.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #include <device/device.h>
16 #include <device/pci.h>
17 #include <device/pci_ids.h>
18 #include <lib.h>
20 static void iommu_read_resources(struct device *dev)
22 struct resource *res;
24 /* Get the normal pci resources of this device */
25 pci_dev_read_resources(dev);
27 /* Add an extra subtractive resource for both memory and I/O. */
28 res = new_resource(dev, 0x44);
29 res->size = 512 * 1024;
30 res->align = log2(res->size);
31 res->gran = log2(res->size);
32 res->limit = 0xffffffff; /* 4G */
33 res->flags = IORESOURCE_MEM;
36 static struct pci_operations lops_pci = {
37 .set_subsystem = pci_dev_set_subsystem,
40 static struct device_operations iommu_ops = {
41 .read_resources = iommu_read_resources,
42 .set_resources = pci_dev_set_resources,
43 .enable_resources = pci_dev_enable_resources,
44 .ops_pci = &lops_pci,
47 static const unsigned short pci_device_ids[] = {
48 PCI_DEVICE_ID_AMD_15H_MODEL_303F_NB_IOMMU,
49 PCI_DEVICE_ID_AMD_15H_MODEL_707F_NB_IOMMU,
50 PCI_DEVICE_ID_AMD_17H_MODEL_101F_NB_IOMMU,
54 static const struct pci_driver iommu_driver __pci_driver = {
55 .ops = &iommu_ops,
56 .vendor = PCI_VENDOR_ID_AMD,
57 .devices = pci_device_ids,