aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/intel/gma/text_fb
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2016-11-07 17:24:47 +0100
committerNico Huber <nico.h@gmx.de>2016-12-19 16:00:22 +0100
commit66203df660ad2230389597a942f5252074a33aac (patch)
treef31617883aa0d7e18d9cc705cde37d28c6ffa58a /src/drivers/intel/gma/text_fb
parentdcd2f17ff47cc1a4b26f253fb11a991cfe4ff6f5 (diff)
drivers/intel/gma: Add textmode support with libgfxinit
Add an alternative gfxinit implementation for textmode. The legacy VGA plane and textmode is configured through coreboot provided functions. libgfxinit uses this plane as alternative to the usual high resolution plane. Change-Id: Iad0754c50fc6faec35f49583fe1c7cb50ac6c0c5 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/17279 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/drivers/intel/gma/text_fb')
-rw-r--r--src/drivers/intel/gma/text_fb/gma.adb75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/drivers/intel/gma/text_fb/gma.adb b/src/drivers/intel/gma/text_fb/gma.adb
new file mode 100644
index 0000000000..bbb6d74e3d
--- /dev/null
+++ b/src/drivers/intel/gma/text_fb/gma.adb
@@ -0,0 +1,75 @@
+with HW.GFX;
+with HW.GFX.GMA;
+
+use HW.GFX;
+use HW.GFX.GMA;
+
+with GMA.Mainboard;
+
+package body GMA
+is
+
+ function vbe_mode_info_valid return Interfaces.C.int
+ is
+ begin
+ return 0;
+ end vbe_mode_info_valid;
+
+ procedure fill_lb_framebuffer (framebuffer : out lb_framebuffer)
+ is
+ begin
+ null;
+ end fill_lb_framebuffer;
+
+ ----------------------------------------------------------------------------
+
+ procedure gfxinit
+ (mmio_base : in word64;
+ linear_fb : in word64;
+ phys_fb : in word32;
+ lightup_ok : out Interfaces.C.int)
+ is
+ ports : Port_List;
+ configs : Configs_Type;
+
+ success : boolean;
+
+ -- from pc80/vga driver
+ procedure vga_io_init;
+ pragma Import (C, vga_io_init, "vga_io_init");
+ procedure vga_textmode_init;
+ pragma Import (C, vga_textmode_init, "vga_textmode_init");
+ begin
+ lightup_ok := 0;
+
+ HW.GFX.GMA.Initialize
+ (MMIO_Base => mmio_base,
+ Success => success);
+
+ if success then
+ ports := Mainboard.ports;
+ HW.GFX.GMA.Scan_Ports
+ (Configs => configs,
+ Ports => ports,
+ Max_Pipe => Primary);
+
+ if configs (Primary).Port /= Disabled then
+ vga_io_init;
+ vga_textmode_init;
+
+ configs (Primary).Framebuffer :=
+ (Width => 640,
+ Height => 400,
+ BPC => Auto_BPC, -- ignored for VGA plane
+ Stride => 320, -- ignored
+ Offset => VGA_PLANE_FRAMEBUFFER_OFFSET);
+
+ HW.GFX.GMA.Dump_Configs (configs);
+ HW.GFX.GMA.Update_Outputs (configs);
+
+ lightup_ok := 1;
+ end if;
+ end if;
+ end gfxinit;
+
+end GMA;