Furquan Shaikh | c82aabc | 2020-04-23 13:59:00 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | /* This file is part of the coreboot project. */ |
| 3 | |
Furquan Shaikh | f939df7 | 2020-04-23 14:13:02 -0700 | [diff] [blame] | 4 | #include <arch/acpi_device.h> |
Furquan Shaikh | c82aabc | 2020-04-23 13:59:00 -0700 | [diff] [blame] | 5 | #include <device/pci.h> |
| 6 | #include <device/pci_ids.h> |
| 7 | |
Furquan Shaikh | f939df7 | 2020-04-23 14:13:02 -0700 | [diff] [blame] | 8 | static void graphics_fill_ssdt(struct device *dev) |
| 9 | { |
| 10 | acpi_device_write_pci_dev(dev); |
| 11 | pci_rom_ssdt(dev); |
| 12 | } |
| 13 | |
Furquan Shaikh | c82aabc | 2020-04-23 13:59:00 -0700 | [diff] [blame] | 14 | static const char *graphics_acpi_name(const struct device *dev) |
| 15 | { |
| 16 | return "IGFX"; |
| 17 | } |
| 18 | |
| 19 | static const struct device_operations graphics_ops = { |
| 20 | .read_resources = pci_dev_read_resources, |
| 21 | .set_resources = pci_dev_set_resources, |
| 22 | .enable_resources = pci_dev_enable_resources, |
| 23 | .init = pci_dev_init, |
| 24 | .ops_pci = &pci_dev_ops_pci, |
| 25 | .write_acpi_tables = pci_rom_write_acpi_tables, |
Furquan Shaikh | f939df7 | 2020-04-23 14:13:02 -0700 | [diff] [blame] | 26 | .acpi_fill_ssdt = graphics_fill_ssdt, |
Furquan Shaikh | c82aabc | 2020-04-23 13:59:00 -0700 | [diff] [blame] | 27 | .acpi_name = graphics_acpi_name, |
| 28 | }; |
| 29 | |
| 30 | static const unsigned short pci_device_ids[] = { |
Furquan Shaikh | 9e1a49c | 2020-04-23 14:01:12 -0700 | [diff] [blame] | 31 | PCI_DEVICE_ID_AMD_FAM17H_GPU, |
Furquan Shaikh | c82aabc | 2020-04-23 13:59:00 -0700 | [diff] [blame] | 32 | 0, |
| 33 | }; |
| 34 | |
| 35 | static const struct pci_driver graphics_driver __pci_driver = { |
| 36 | .ops = &graphics_ops, |
| 37 | .vendor = PCI_VENDOR_ID_ATI, |
| 38 | .devices = pci_device_ids, |
| 39 | }; |