driver/intel/fsp20: move lb_framebuffer function

move lb_framebuffer function in soc/intel/apollolake
to driver/intel/fsp20 so that fsp 2.0 bases soc's can
use common lb_framebuffer function.

Change-Id: If11bc7faa378a39cf7d4487f9095465a4df84853
Signed-off-by: Naresh G Solanki <naresh.solanki@intel.com>
Reviewed-on: https://review.coreboot.org/16549
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
This commit is contained in:
Naresh G Solanki
2016-09-08 22:27:04 +05:30
committed by Martin Roth
parent 5ff7390fcd
commit 16e9d459a0
4 changed files with 44 additions and 23 deletions

View File

@@ -22,37 +22,17 @@
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <soc/pci_devs.h>
#include <soc/pci_ids.h>
#include <soc/intel/common/opregion.h>
static uintptr_t framebuffer_bar = (uintptr_t)NULL;
void lb_framebuffer(struct lb_header *header)
uintptr_t fsp_soc_get_igd_bar(void)
{
enum cb_err ret;
struct lb_framebuffer *framebuffer;
framebuffer = (void *)lb_new_record(header);
ret = fsp_fill_lb_framebuffer(framebuffer);
if (ret != CB_SUCCESS) {
printk(BIOS_ALERT, "FSP did not return a valid framebuffer\n");
return;
}
if (!framebuffer_bar) {
printk(BIOS_ALERT, "Framebuffer BAR invalid (00:02.0 BAR2)\n");
return;
}
/* Resource allocator can move the BAR around after FSP configures it */
framebuffer->physical_address = framebuffer_bar;
printk(BIOS_DEBUG, "Graphics framebuffer located at 0x%llx\n",
framebuffer->physical_address);
return find_resource(IGD_DEV, PCI_BASE_ADDRESS_2)->base;
}
static void igd_set_resources(struct device *dev)
{
framebuffer_bar = find_resource(dev, PCI_BASE_ADDRESS_2)->base;
pci_dev_set_resources(dev);
}