From 3e47fc9e94089476fcef4fcafa8547cbb693316b Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Wed, 7 Jun 2017 09:44:07 +0200 Subject: nb/intel/sandybridge: Fill in acpi_name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fill in acpi_name to return proper ACPI names. To be used with SSDT generators. The ACPI names have to match those already used in ASL code. By providing the ACPI name it can be retrieved by the acpi_device_name() method and doesn't need to be hardcoded in SSDT generators any more. GFX0 is used in drivers/intel/gma/acpi/pch.asl. MCHC is used in nb/intel/sandybridge/acpi/hostbridge.asl. Change-Id: I19526e334a9c5435fdb19419a671b86c5f6b2be9 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/20085 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber Reviewed-by: Philippe Mathieu-Daudé --- src/northbridge/intel/sandybridge/gma.c | 6 ++++++ src/northbridge/intel/sandybridge/northbridge.c | 19 ++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/northbridge/intel/sandybridge/gma.c b/src/northbridge/intel/sandybridge/gma.c index f53493096f..9611e64797 100644 --- a/src/northbridge/intel/sandybridge/gma.c +++ b/src/northbridge/intel/sandybridge/gma.c @@ -700,6 +700,11 @@ gma_write_acpi_tables(struct device *const dev, return current; } +static const char *gma_acpi_name(device_t dev) +{ + return "GFX0"; +} + /* called by pci set_vga_bridge function */ static void gma_func0_disable(struct device *dev) { @@ -727,6 +732,7 @@ static struct device_operations gma_func0_ops = { .enable = 0, .disable = gma_func0_disable, .ops_pci = &gma_pci_ops, + .acpi_name = gma_acpi_name, .write_acpi_tables = gma_write_acpi_tables, }; diff --git a/src/northbridge/intel/sandybridge/northbridge.c b/src/northbridge/intel/sandybridge/northbridge.c index 5c5f41ad4a..635e321c77 100644 --- a/src/northbridge/intel/sandybridge/northbridge.c +++ b/src/northbridge/intel/sandybridge/northbridge.c @@ -242,6 +242,22 @@ static void pci_domain_set_resources(device_t dev) assign_resources(dev->link_list); } +static const char *northbridge_acpi_name(struct device *dev) +{ + if (dev->path.type == DEVICE_PATH_DOMAIN) + return "PCI0"; + + if (dev->path.type != DEVICE_PATH_PCI) + return NULL; + + switch (dev->path.pci.devfn) { + case PCI_DEVFN(0, 0): + return "MCHC"; + } + + return NULL; +} + /* TODO We could determine how many PCIe busses we need in * the bar. For now that number is hardcoded to a max of 64. * See e7525/northbridge.c for an example. @@ -252,8 +268,9 @@ static struct device_operations pci_domain_ops = { .enable_resources = NULL, .init = NULL, .scan_bus = pci_domain_scan_bus, - .ops_pci_bus = pci_bus_default_ops, + .ops_pci_bus = pci_bus_default_ops, .write_acpi_tables = northbridge_write_acpi_tables, + .acpi_name = northbridge_acpi_name, }; static void mc_read_resources(device_t dev) -- cgit v1.2.3