aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/intel/fsp2_0/graphics.c
diff options
context:
space:
mode:
authorNaresh G Solanki <naresh.solanki@intel.com>2016-09-08 22:27:04 +0530
committerMartin Roth <martinroth@google.com>2016-09-15 01:16:41 +0200
commit16e9d459a09ae5833776e29926207d43d2fc9a02 (patch)
treeea81368489cb541e421a47a33baf873afded8b97 /src/drivers/intel/fsp2_0/graphics.c
parent5ff7390fcd74fe1cd94d2507cf7c04b1c1eff620 (diff)
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)
Diffstat (limited to 'src/drivers/intel/fsp2_0/graphics.c')
-rw-r--r--src/drivers/intel/fsp2_0/graphics.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/drivers/intel/fsp2_0/graphics.c b/src/drivers/intel/fsp2_0/graphics.c
index 039202faa4..caf7bfa807 100644
--- a/src/drivers/intel/fsp2_0/graphics.c
+++ b/src/drivers/intel/fsp2_0/graphics.c
@@ -103,3 +103,38 @@ uintptr_t fsp_load_vbt(void)
return (uintptr_t)vbt;
}
+
+void lb_framebuffer(struct lb_header *header)
+{
+ enum cb_err ret;
+ struct lb_framebuffer *framebuffer;
+ uintptr_t framebuffer_bar;
+
+ /* Pci enumeration happens after silicon init.
+ * After enumeration graphic framebuffer base may be relocated.
+ * Get framebuffer base from soc.
+ */
+ framebuffer_bar = fsp_soc_get_igd_bar();
+
+ if (!framebuffer_bar) {
+ printk(BIOS_ALERT, "Framebuffer BAR invalid\n");
+ return;
+ }
+
+ 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;
+ }
+
+ /* 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);
+}
+
+__attribute__((weak)) uintptr_t fsp_soc_get_igd_bar(void)
+{
+ return 0;
+} \ No newline at end of file