gma: Move Legacy_VGA_Off() into Pipe_Setup

It's about the VGA plane and thus belongs into Pipe_Setup.

Change-Id: I2f59b027c47c06b01f36695c517ed0847617a472
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17762
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Nico Huber
2016-12-06 20:36:23 +01:00
committed by Nico Huber
parent f3e23668c6
commit 33912aa2a4
4 changed files with 24 additions and 27 deletions

View File

@@ -70,7 +70,10 @@ package body HW.GFX.GMA.Pipe_Setup is
SPCNTR_ENABLE : constant := 1 * 2 ** 31;
VGA_SR01_SCREEN_OFF : constant := 1 * 2 ** 5;
VGA_SR_INDEX : constant := 16#03c4#;
VGA_SR_DATA : constant := 16#03c5#;
VGA_SR01 : constant := 16#01#;
VGA_SR01_SCREEN_OFF : constant := 1 * 2 ** 5;
VGA_CONTROL_VGA_DISPLAY_DISABLE : constant := 1 * 2 ** 31;
VGA_CONTROL_BLINK_DUTY_CYCLE_MASK : constant := 16#0003# * 2 ** 6;
@@ -773,6 +776,18 @@ package body HW.GFX.GMA.Pipe_Setup is
Trans_Clk_Off (Controllers (Pipe));
end Off;
procedure Legacy_VGA_Off
is
use type HW.Word8;
Reg8 : Word8;
begin
Port_IO.OutB (VGA_SR_INDEX, VGA_SR01);
Port_IO.InB (Reg8, VGA_SR_DATA);
Port_IO.OutB (VGA_SR_DATA, Reg8 or VGA_SR01_SCREEN_OFF);
Time.U_Delay (100); -- PRM says 100us, Linux does 300
Registers.Set_Mask (Registers.VGACNTRL, VGA_CONTROL_VGA_DISPLAY_DISABLE);
end Legacy_VGA_Off;
procedure All_Off
is
EDP_Enabled, EDP_Piped : Boolean;
@@ -793,6 +808,8 @@ package body HW.GFX.GMA.Pipe_Setup is
begin
pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
Legacy_VGA_Off;
if Config.Has_EDP_Pipe then
Registers.Is_Set_Mask
(Registers.PIPE_EDP_CONF, PIPECONF_ENABLE, EDP_Enabled);

View File

@@ -30,6 +30,8 @@ is
procedure Off (Pipe : Pipe_Index; Port_Cfg : Port_Config);
procedure Legacy_VGA_Off;
procedure All_Off;
function Get_Pipe_Hint (Pipe : Pipe_Index) return Word32;

View File

@@ -28,7 +28,6 @@ with System;
with HW.Debug;
with GNAT.Source_Info;
use type HW.Word8;
use type HW.Int32;
package body HW.GFX.GMA
@@ -84,20 +83,6 @@ is
----------------------------------------------------------------------------
procedure Legacy_VGA_Off
is
Reg8 : Word8;
begin
-- disable legacy VGA plane, taking over control now
Port_IO.OutB (VGA_SR_INDEX, VGA_SR01);
Port_IO.InB (Reg8, VGA_SR_DATA);
Port_IO.OutB (VGA_SR_DATA, Reg8 or 1 * 2 ** 5);
Time.U_Delay (100); -- PRM says 100us, Linux does 300
Registers.Set_Mask (Registers.VGACNTRL, 1 * 2 ** 31);
end Legacy_VGA_Off;
----------------------------------------------------------------------------
procedure Update_Outputs (Configs : Pipe_Configs)
is
Did_Power_Up : Boolean := False;
@@ -354,9 +339,6 @@ is
Panel.Setup_PP_Sequencer;
Port_Detect.Initialize;
Legacy_VGA_Off; -- According to PRMs, VGA plane is the only
-- thing that's enabled by default after reset.
if Clean_State then
Power_And_Clocks.Pre_All_Off;
Connectors.Pre_All_Off;
@@ -364,6 +346,10 @@ is
Connectors.Post_All_Off;
PLLs.All_Off;
Power_And_Clocks.Post_All_Off;
else
-- According to PRMs, VGA plane is the only thing
-- that's enabled by default after reset.
Display_Controller.Legacy_VGA_Off;
end if;
-------------------- Now restart from a clean state ---------------------

View File

@@ -75,8 +75,6 @@ is
with
Global => (Input => Init_State);
procedure Legacy_VGA_Off;
procedure Update_Outputs (Configs : Pipe_Configs);
pragma Warnings (GNATprove, Off, "subprogram ""Dump_Configs"" has no effect",
@@ -134,10 +132,4 @@ private
type DP_Port is (DP_A, DP_B, DP_C, DP_D);
----------------------------------------------------------------------------
VGA_SR_INDEX : constant Port_IO.Port_Type := 16#03c4#;
VGA_SR_DATA : constant Port_IO.Port_Type := 16#03c5#;
VGA_SR01 : constant Word8 := 16#01#;
end HW.GFX.GMA;