diff options
author | Furquan Shaikh <furquan@google.com> | 2020-04-23 13:59:00 -0700 |
---|---|---|
committer | Furquan Shaikh <furquan@google.com> | 2020-04-28 19:12:16 +0000 |
commit | c82aabca0122c5a118f6ab988768bd05eefc3a05 (patch) | |
tree | 94887d6977df58cc71f9530c6d1a886a51b45a02 /src/soc/amd/common/block/graphics/graphics.c | |
parent | a1cd7eb93ed2b2f9a2351399a2036f84d9dfb9ff (diff) |
soc/amd/common: Add a common graphics block device driver for AMD SoCs
This change adds a common graphics block device driver for AMD
SoCs. In follow-up CLs, this driver will be utilized for Picasso.
This driver is added to enable ACPI name and SSDT generation for
graphics controller.
BUG=b:153858769
Change-Id: I45e2b98fede41e49158d9ff9f93785a34c392c22
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40675
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/soc/amd/common/block/graphics/graphics.c')
-rw-r--r-- | src/soc/amd/common/block/graphics/graphics.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/graphics/graphics.c b/src/soc/amd/common/block/graphics/graphics.c new file mode 100644 index 0000000000..6d40f7c757 --- /dev/null +++ b/src/soc/amd/common/block/graphics/graphics.c @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* This file is part of the coreboot project. */ + +#include <device/pci.h> +#include <device/pci_ids.h> + +static const char *graphics_acpi_name(const struct device *dev) +{ + return "IGFX"; +} + +static const struct device_operations graphics_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .init = pci_dev_init, + .ops_pci = &pci_dev_ops_pci, + .write_acpi_tables = pci_rom_write_acpi_tables, + .acpi_fill_ssdt = pci_rom_ssdt, + .acpi_name = graphics_acpi_name, +}; + +static const unsigned short pci_device_ids[] = { + 0, +}; + +static const struct pci_driver graphics_driver __pci_driver = { + .ops = &graphics_ops, + .vendor = PCI_VENDOR_ID_ATI, + .devices = pci_device_ids, +}; |