Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/libgfxinit/+/34471 )
Change subject: TEST: gma panel: Remove manual delays ......................................................................
TEST: gma panel: Remove manual delays
These were added to ensure timings on allegedly misbehaving hardware. However, it's possible that we checked the wrong bits and the hardware actually did its job.
Let's remove them for the moment to be able to trace what the hardware does.
Change-Id: Ifc8b8a50918323843f7c9d6fb0f11b18b0463acf Signed-off-by: Nico Huber nico.h@gmx.de --- M common/hw-gfx-gma-panel.adb M common/hw-gfx-gma-panel.ads M common/hw-gfx-gma.adb 3 files changed, 8 insertions(+), 80 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/71/34471/1
diff --git a/common/hw-gfx-gma-panel.adb b/common/hw-gfx-gma-panel.adb index 8ccbbb9..ba91254 100644 --- a/common/hw-gfx-gma-panel.adb +++ b/common/hw-gfx-gma-panel.adb @@ -19,10 +19,6 @@ with GNAT.Source_Info;
package body HW.GFX.GMA.Panel -with - Refined_State => - (Panel_State => - (Delays_US, Power_Cycle_Timer, Power_Up_Timer)) is type Delays_Enum is (Power_Up_Delay, @@ -39,24 +35,6 @@ BL_Off_To_Power_Down => 50_000, Power_Cycle_Delay => 510_000);
- Delays_US : Panel_Power_Delays; - - ---------------------------------------------------------------------------- - - -- And here the mess starts: We have this pretty hardware power sequencer - -- that should ensure the panel's timing constraints are satisfied. But - -- (at least on some generations) it doesn't do it's job. On Haswell, it - -- seems to ignore the Power_Cycle_Delay, so we ensure the delay in soft- - -- ware. On at least Ivy Bridge and Broadwell Power_Up_Delay is ignored. - -- - -- If we ever do all delays in software, there are two ways: Either confi- - -- gure the hardware to zero delays or wait for both the software timeout - -- and the hardware power sequencer. The latter option would be less error - -- prone, as the hardware might just don't work as expected. - - Power_Cycle_Timer : Time.T; - Power_Up_Timer : Time.T; - ----------------------------------------------------------------------------
function Div_Round_Up32 (Num : Natural; Denom : Positive) return Word32 is @@ -155,21 +133,6 @@
----------------------------------------------------------------------------
- procedure Static_Init - with - Refined_Global => - (Output => (Power_Cycle_Timer, Power_Up_Timer, Delays_US), - Input => (Time.State)) - is - begin - Power_Cycle_Timer := Time.Now; - Power_Up_Timer := Power_Cycle_Timer; - - Delays_US := Default_EDP_Delays_US; - end Static_Init; - - ---------------------------------------------------------------------------- - procedure Check_PP_Delays (Delays : in out Panel_Power_Delays; Override : in out Boolean) is @@ -187,11 +150,10 @@ Power_Delay, Port_Select : Word32;
Override_Delays : Boolean := False; + Delays_US : Panel_Power_Delays := Default_EDP_Delays_US; begin pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
- Static_Init; - if Default_Delays then Override_Delays := True; else @@ -279,21 +241,11 @@ On; end VDD_Override;
- procedure On (Wait : Boolean := True) - is - Was_On : Boolean; + procedure On (Wait : Boolean := True) is begin pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
- Registers.Is_Set_Mask (Panel_PP_Regs.CONTROL, PCH_PP_CONTROL_TARGET_ON, Was_On); - if not Was_On then - Time.Delay_Until (Power_Cycle_Timer); - end if; - Registers.Set_Mask (Panel_PP_Regs.CONTROL, PCH_PP_CONTROL_TARGET_ON); - if not Was_On then - Power_Up_Timer := Time.US_From_Now (Delays_US (Power_Up_Delay)); - end if; if Wait then Wait_On; end if; @@ -303,7 +255,6 @@ begin pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
- Time.Delay_Until (Power_Up_Timer); Registers.Wait_Unset_Mask (Register => Panel_PP_Regs.STATUS, Mask => PCH_PP_STATUS_PWR_SEQ_PROGRESS_MASK or @@ -313,28 +264,19 @@ Registers.Unset_Mask (Panel_PP_Regs.CONTROL, PCH_PP_CONTROL_VDD_OVERRIDE); end Wait_On;
- procedure Off - is - Was_On : Boolean; + procedure Off is begin pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
- Registers.Is_Set_Mask (Panel_PP_Regs.CONTROL, PCH_PP_CONTROL_TARGET_ON, Was_On); Registers.Unset_Mask (Register => Panel_PP_Regs.CONTROL, Mask => PCH_PP_CONTROL_TARGET_ON or PCH_PP_CONTROL_VDD_OVERRIDE); - if Was_On then - Time.U_Delay (Delays_US (Power_Down_Delay)); - end if; Registers.Wait_Unset_Mask (Register => Panel_PP_Regs.STATUS, Mask => PCH_PP_STATUS_PWR_SEQ_PROGRESS_MASK or PCH_PP_STATUS_PWR_CYC_DELAY_ACTIVE, TOut_MS => 820 + 3_100 + 820); -- theoretical max: on + cycle + off - if Was_On then - Power_Cycle_Timer := Time.US_From_Now (Delays_US (Power_Cycle_Delay)); - end if; end Off;
---------------------------------------------------------------------------- diff --git a/common/hw-gfx-gma-panel.ads b/common/hw-gfx-gma-panel.ads index b968e29..643dd9c 100644 --- a/common/hw-gfx-gma-panel.ads +++ b/common/hw-gfx-gma-panel.ads @@ -16,25 +16,14 @@ with HW.GFX.GMA.Registers;
private package HW.GFX.GMA.Panel -with - Abstract_State => (Panel_State with Part_Of => GMA.State) is
- procedure Static_Init - with - Global => - (Output => Panel_State, - Input => Time.State); - procedure Setup_PP_Sequencer (Default_Delays : Boolean := False) with - Global => - (Input => Time.State, - In_Out => Registers.Register_State, - Output => Panel_State), + Global => (In_Out => Registers.Register_State), Depends => - ((Panel_State, Registers.Register_State) => - (Time.State, Registers.Register_State, Default_Delays)), + ((Registers.Register_State) => + (Registers.Register_State, Default_Delays)), Pre => True, Post => True;
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb index 15d234a..938f8aa 100644 --- a/common/hw-gfx-gma.adb +++ b/common/hw-gfx-gma.adb @@ -39,7 +39,7 @@ (State => (Dev.Address_State, Registers.Address_State, - PLLs.State, Panel.Panel_State, + PLLs.State, Cur_Configs, Allocated_PLLs, HPD_Delay, Wait_For_HPD, Linear_FB_Base), @@ -376,7 +376,7 @@ (Config.Variable, Dev.Address_State, Registers.Address_State, - PLLs.State, Panel.Panel_State, + PLLs.State, Cur_Configs, Allocated_PLLs, HPD_Delay, Wait_For_HPD, Linear_FB_Base, Initialized)) @@ -475,9 +475,6 @@
if not Success then pragma Debug (Debug.Put_Line ("ERROR: Incompatible CPU or PCH.")); - - Panel.Static_Init; -- for flow analysis - Initialized := False; return; end if;