Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/22616
Change subject: soc/intel/apollolake: Make use of Intel common Graphics block ......................................................................
soc/intel/apollolake: Make use of Intel common Graphics block
TEST=Build and boot reef.
Change-Id: I0edd7454912201598c43e35990e470ec18a32638 Signed-off-by: Subrata Banik subrata.banik@intel.com --- M src/soc/intel/apollolake/Kconfig M src/soc/intel/apollolake/graphics.c 2 files changed, 9 insertions(+), 44 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/16/22616/1
diff --git a/src/soc/intel/apollolake/Kconfig b/src/soc/intel/apollolake/Kconfig index f568799..ada9f53 100644 --- a/src/soc/intel/apollolake/Kconfig +++ b/src/soc/intel/apollolake/Kconfig @@ -71,6 +71,7 @@ select SOC_INTEL_COMMON_BLOCK_GPIO_MULTI_ACPI_DEVICES select SOC_INTEL_COMMON_BLOCK_GPIO_ITSS_POL_CFG select SOC_INTEL_COMMON_BLOCK_GPIO_IOSTANDBY + select SOC_INTEL_COMMON_BLOCK_GRAPHICS select SOC_INTEL_COMMON_BLOCK_ITSS select SOC_INTEL_COMMON_BLOCK_I2C select SOC_INTEL_COMMON_BLOCK_LPC diff --git a/src/soc/intel/apollolake/graphics.c b/src/soc/intel/apollolake/graphics.c index 90859d5..d7158cc 100644 --- a/src/soc/intel/apollolake/graphics.c +++ b/src/soc/intel/apollolake/graphics.c @@ -1,7 +1,7 @@ /* * This file is part of the coreboot project. * - * Copyright (C) 2015-2016 Intel Corp. + * Copyright (C) 2015-2017 Intel Corp. * (Written by Alexandru Gagniuc alexandrux.gagniuc@intel.com for Intel Corp.) * * This program is free software; you can redistribute it and/or modify @@ -15,34 +15,21 @@ * GNU General Public License for more details. */
-#include <arch/acpi.h> #include <arch/acpigen.h> #include <console/console.h> #include <fsp/util.h> #include <device/device.h> #include <device/pci.h> -#include <device/pci_ids.h> -#include <soc/pci_devs.h> +#include <intelblocks/graphics.h> #include <soc/intel/common/opregion.h>
uintptr_t fsp_soc_get_igd_bar(void) { - device_t dev = SA_DEV_IGD; - - /* Check if IGD PCI device is disabled */ - if (!dev->enabled) - return 0; - - return find_resource(dev, PCI_BASE_ADDRESS_2)->base; + return graphics_get_memory_base(); }
-static void igd_set_resources(struct device *dev) -{ - pci_dev_set_resources(dev); -} - -static unsigned long igd_write_opregion(device_t dev, unsigned long current, - struct acpi_rsdp *rsdp) +uintptr_t graphics_soc_write_acpi_opregion(device_t device, + uintptr_t current, struct acpi_rsdp *rsdp) { igd_opregion_t *opregion; uint16_t reg16; @@ -77,34 +64,11 @@ * Maybe it should move to the finalize handler. */
- pci_write_config32(dev, ASLS, (uintptr_t)opregion); - reg16 = pci_read_config16(dev, SWSCI); + pci_write_config32(device, ASLS, (uintptr_t)opregion); + reg16 = pci_read_config16(device, SWSCI); reg16 &= ~(1 << 0); reg16 |= (1 << 15); - pci_write_config16(dev, SWSCI, reg16); + pci_write_config16(device, SWSCI, reg16);
return acpi_align_current(current); } - -static const struct device_operations igd_ops = { - .read_resources = pci_dev_read_resources, - .set_resources = igd_set_resources, - .enable_resources = pci_dev_enable_resources, - .init = pci_dev_init, - .write_acpi_tables = igd_write_opregion, - .enable = DEVICE_NOOP -}; - -static const unsigned short pci_device_ids[] = { - PCI_DEVICE_ID_INTEL_APL_IGD_HD_505, - PCI_DEVICE_ID_INTEL_APL_IGD_HD_500, - PCI_DEVICE_ID_INTEL_GLK_IGD, - PCI_DEVICE_ID_INTEL_GLK_IGD_EU12, - 0, -}; - -static const struct pci_driver integrated_graphics_driver __pci_driver = { - .ops = &igd_ops, - .vendor = PCI_VENDOR_ID_INTEL, - .devices = pci_device_ids, -};