gma: Implement Ivy Bridge VGA plane workaround
It's a documented requirement, even though it doesn't seem necessary.
Change-Id: Id4f579c1ca34633ee00c771b39e6ff45cdcfbf69
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17277
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
diff --git a/common/hw-gfx-gma-pipe_setup.adb b/common/hw-gfx-gma-pipe_setup.adb
index 1f13c86..4176ffe 100644
--- a/common/hw-gfx-gma-pipe_setup.adb
+++ b/common/hw-gfx-gma-pipe_setup.adb
@@ -25,6 +25,11 @@
package body HW.GFX.GMA.Pipe_Setup is
+ ILK_DISPLAY_CHICKEN1_VGA_MASK : constant := 7 * 2 ** 29;
+ ILK_DISPLAY_CHICKEN1_VGA_ENABLE : constant := 5 * 2 ** 29;
+ ILK_DISPLAY_CHICKEN2_VGA_MASK : constant := 1 * 2 ** 25;
+ ILK_DISPLAY_CHICKEN2_VGA_ENABLE : constant := 0 * 2 ** 25;
+
DSPCNTR_ENABLE : constant := 1 * 2 ** 31;
DSPCNTR_GAMMA_CORRECTION : constant := 1 * 2 ** 30;
DSPCNTR_DISABLE_TRICKLE_FEED : constant := 1 * 2 ** 14;
@@ -416,6 +421,17 @@
end if;
if Framebuffer.Offset = VGA_PLANE_FRAMEBUFFER_OFFSET then
+ if Config.VGA_Plane_Workaround then
+ Registers.Unset_And_Set_Mask
+ (Register => Registers.ILK_DISPLAY_CHICKEN1,
+ Mask_Unset => ILK_DISPLAY_CHICKEN1_VGA_MASK,
+ Mask_Set => ILK_DISPLAY_CHICKEN1_VGA_ENABLE);
+ Registers.Unset_And_Set_Mask
+ (Register => Registers.ILK_DISPLAY_CHICKEN2,
+ Mask_Unset => ILK_DISPLAY_CHICKEN2_VGA_MASK,
+ Mask_Set => ILK_DISPLAY_CHICKEN2_VGA_ENABLE);
+ end if;
+
Registers.Unset_And_Set_Mask
(Register => Registers.VGACNTRL,
Mask_Unset => VGA_CONTROL_VGA_DISPLAY_DISABLE or