drivers/aspeed/common: Add support for high resolution framebuffer

* Implement reading EDID over software I2C.
* Fall back to VGA if no monitor connected for BMC KVM
* Copy the linux kernel code and add a bunch of wrapper structs to make it
  compile.
* Convert the EDID to a drm_display_mode, which is understood by the
  driver.
* Properly select HAVE_LINEAR_FRAMEBUFFER and HAVE_VGA_TEXT_FRAMEBUFFER

Tested on Supermicro X11SSH-TF using FullHD VGA monitor.
Initializes the graphics in about 1 second, which is twice as fast as the
VGA Option ROM.

The framebuffer is advertised and working in tianocore.

Change-Id: I7803566b64158405efc04a39f80a0ec98b44e646
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35726
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/drivers/aspeed/ast2050/ast2050.c b/src/drivers/aspeed/ast2050/ast2050.c
index b1bd276..67a1a80 100644
--- a/src/drivers/aspeed/ast2050/ast2050.c
+++ b/src/drivers/aspeed/ast2050/ast2050.c
@@ -48,13 +48,19 @@
 	outb(0xa6, 0x3d4); outb(0x2f, 0x3d5);
 	outb(0xa7, 0x3d4); outb(0x3f, 0x3d5);
 
-	/* Initialize standard VGA text mode */
-	vga_io_init();
-	vga_textmode_init();
-	printk(BIOS_INFO, "ASpeed VGA text mode initialized\n");
+	if (CONFIG(VGA_TEXT_FRAMEBUFFER)) {
+		/* Initialize standard VGA text mode */
+		vga_io_init();
 
-	/* if we don't have console, at least print something... */
-	vga_line_write(0, "ASpeed VGA text mode initialized");
+		vga_textmode_init();
+		printk(BIOS_INFO, "ASpeed VGA text mode initialized\n");
+
+		/* if we don't have console, at least print something... */
+		vga_line_write(0, "ASpeed VGA text mode initialized");
+	} else if (CONFIG(GENERIC_LINEAR_FRAMEBUFFER)) {
+		ast_driver_framebuffer_init(&drm_dev, 0);
+		printk(BIOS_INFO, "ASpeed high resolution framebuffer initialized\n");
+	}
 }
 
 static struct device_operations aspeed_ast2050_ops  = {