[coreboot-gerrit] New patch to review for coreboot: WIP: nb/haswell: Hook up SPARK native gfx init

Nico Huber (nico.h@gmx.de) gerrit at coreboot.org
Thu Jun 16 06:16:06 CEST 2016


Nico Huber (nico.h at gmx.de) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15212

-gerrit

commit 892a7593cea7d12639d5b94edea02c54ac844b2d
Author: Nico Huber <nico.h at gmx.de>
Date:   Thu Jun 16 06:04:28 2016 +0200

    WIP: nb/haswell: Hook up SPARK native gfx init
    
    Hardcoded to 1920x1080...
    
    Change-Id: Iad7ba81e7afab068f4f799ecbe1934ef0f2703f1
    Signed-off-by: Nico Huber <nico.h at gmx.de>
---
 src/northbridge/intel/haswell/gma.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/northbridge/intel/haswell/gma.c b/src/northbridge/intel/haswell/gma.c
index 4449ffc..15c9c0b 100644
--- a/src/northbridge/intel/haswell/gma.c
+++ b/src/northbridge/intel/haswell/gma.c
@@ -216,7 +216,7 @@ static void power_well_enable(void)
 {
 	gtt_write(HSW_PWR_WELL_CTL1, HSW_PWR_WELL_ENABLE);
 	gtt_poll(HSW_PWR_WELL_CTL1, HSW_PWR_WELL_STATE, HSW_PWR_WELL_STATE);
-#if CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT
+#if CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT && !IS_ENABLED(CONFIG_INTEL_GMA_SPARKINIT)
 	/* In the native graphics case, we've got about 20 ms.
 	 * after we power up the the AUX channel until we can talk to it.
 	 * So get that going right now. We can't turn on the panel, yet, just VDD.
@@ -420,9 +420,11 @@ static void gma_pm_init_post_vbios(struct device *dev)
 	gtt_write(0x0a188, 0x00000001);
 }
 
+void hw_gfx_gma_oneshot(uint32_t mmio, uint32_t phys_fb, uint32_t linear_fb);
+
 static void gma_func0_init(struct device *dev)
 {
-#if CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT
+#if CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT && !IS_ENABLED(CONFIG_INTEL_GMA_SPARKINIT)
 	struct northbridge_intel_haswell_config *conf = dev->chip_info;
 	struct intel_dp dp;
 #endif
@@ -441,6 +443,25 @@ static void gma_func0_init(struct device *dev)
 	gma_setup_panel(dev);
 
 #if CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT
+#if IS_ENABLED(CONFIG_INTEL_GMA_SPARKINIT)
+	const struct resource *const mmio_res =
+		find_resource(dev, PCI_BASE_ADDRESS_0);
+	const struct resource *const stolen_res =
+		find_resource(dev, PCI_BASE_ADDRESS_1);
+	if (mmio_res && stolen_res) {
+		hw_gfx_gma_oneshot(
+			mmio_res->base,
+			pci_read_config32(dev, 0x5c) & ~0xf,
+			stolen_res->base);
+		const struct edid edid = {
+			.framebuffer_bits_per_pixel = 32,
+			.x_resolution = 1920,
+			.y_resolution = 1080,
+			.bytes_per_line = 2048,
+		};
+		set_vbe_mode_info_valid(&edid, stolen_res->base);
+	}
+#else
 	printk(BIOS_SPEW, "NATIVE graphics, run native enable\n");
 	/* Default set to 1 since it might be required for
 	   stuff like seabios */
@@ -462,6 +483,7 @@ static void gma_func0_init(struct device *dev)
 	lightup_ok = panel_lightup(&dp, init_fb);
 		gfx_set_init_done(1);
 #endif
+#endif
 	if (! lightup_ok) {
 		printk(BIOS_SPEW, "FUI did not run; using VBIOS\n");
 		mdelay(CONFIG_PRE_GRAPHICS_DELAY);



More information about the coreboot-gerrit mailing list