Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/libgfxinit/+/83601?usp=email )
Change subject: gma power: Allow to explicitly enable DDI/Aux power ......................................................................
gma power: Allow to explicitly enable DDI/Aux power
We used to enable power for DP-aux channels quite implicitly by faking configs that use a specific port. As Tiger Lake requires us to enable a DDI ports power late during the modesetting sequence, we introduce a new API for such cases, and also use it for the DP-aux case.
TODO: Needs testing on HSW+/SKL+/BXT systems because I'm unsure if the PDW needs to be enabled as well.
Change-Id: I1fd6348ff4855557166495613c6a181f85a818f4 Signed-off-by: Nico Huber nico.huber@secunet.com --- M common/broxton/hw-gfx-gma-power_and_clocks.adb M common/broxton/hw-gfx-gma-power_and_clocks.ads M common/g45/hw-gfx-gma-power_and_clocks.ads M common/haswell/hw-gfx-gma-power_and_clocks.adb M common/haswell/hw-gfx-gma-power_and_clocks.ads M common/hw-gfx-gma-display_probing.adb M common/ironlake/hw-gfx-gma-power_and_clocks.ads M common/skylake/hw-gfx-gma-power_and_clocks.adb M common/skylake/hw-gfx-gma-power_and_clocks.ads M common/tigerlake/hw-gfx-gma-power_and_clocks.adb M common/tigerlake/hw-gfx-gma-power_and_clocks.ads 11 files changed, 49 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/01/83601/1
diff --git a/common/broxton/hw-gfx-gma-power_and_clocks.adb b/common/broxton/hw-gfx-gma-power_and_clocks.adb index e719ba5..6dded16 100644 --- a/common/broxton/hw-gfx-gma-power_and_clocks.adb +++ b/common/broxton/hw-gfx-gma-power_and_clocks.adb @@ -192,6 +192,15 @@ end loop; end Power_Set_To;
+ procedure Power_Up (Port : Active_Port_Type; Aux_Only : Boolean := False) is + begin + case Port is + when eDP => PD_On (DDI_A); + when DP1 | HDMI1 | DP2 | HDMI2 => PD_On (DDI_BC); + when others => null; + end case; + end Power_Up; + procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs) is begin for PD in Dynamic_Domain loop diff --git a/common/broxton/hw-gfx-gma-power_and_clocks.ads b/common/broxton/hw-gfx-gma-power_and_clocks.ads index 36b145c..9f995d5 100644 --- a/common/broxton/hw-gfx-gma-power_and_clocks.ads +++ b/common/broxton/hw-gfx-gma-power_and_clocks.ads @@ -32,6 +32,10 @@ procedure Enable_CDClk;
procedure Power_Set_To (Configs : Pipe_Configs); + pragma Warnings + (GNATprove, Off, "unused variable ""Aux_Only""", + Reason => "Broxton makes no distinction."); + procedure Power_Up (Port : Active_Port_Type; Aux_Only : Boolean := False); procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs); procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Pipe_Configs);
diff --git a/common/g45/hw-gfx-gma-power_and_clocks.ads b/common/g45/hw-gfx-gma-power_and_clocks.ads index 313239b..6e235d8 100644 --- a/common/g45/hw-gfx-gma-power_and_clocks.ads +++ b/common/g45/hw-gfx-gma-power_and_clocks.ads @@ -34,6 +34,7 @@
procedure Power_Set_To (Configs : Pipe_Configs) is null;
+ procedure Power_Up (Port : Active_Port_Type; Aux_Only : Boolean := False) is null; procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs) is null;
procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Pipe_Configs) diff --git a/common/haswell/hw-gfx-gma-power_and_clocks.adb b/common/haswell/hw-gfx-gma-power_and_clocks.adb index 6a00a5f..bcb84f2 100644 --- a/common/haswell/hw-gfx-gma-power_and_clocks.adb +++ b/common/haswell/hw-gfx-gma-power_and_clocks.adb @@ -334,6 +334,13 @@ end if; end Power_Set_To;
+ procedure Power_Up (Port : Active_Port_Type; Aux_Only : Boolean := False) is + begin + if Port /= eDP then + PDW_On; + end if; + end Power_Up; + procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs) is begin if not Need_PDW (Old_Configs) and Need_PDW (New_Configs) then diff --git a/common/haswell/hw-gfx-gma-power_and_clocks.ads b/common/haswell/hw-gfx-gma-power_and_clocks.ads index e4f2611..34c5409 100644 --- a/common/haswell/hw-gfx-gma-power_and_clocks.ads +++ b/common/haswell/hw-gfx-gma-power_and_clocks.ads @@ -32,6 +32,10 @@ procedure Enable_CDClk is null;
procedure Power_Set_To (Configs : Pipe_Configs); + pragma Warnings + (GNATprove, Off, "unused variable ""Aux_Only""", + Reason => "Haswell makes no distinction."); + procedure Power_Up (Port : Active_Port_Type; Aux_Only : Boolean := False); procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs); procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Pipe_Configs);
diff --git a/common/hw-gfx-gma-display_probing.adb b/common/hw-gfx-gma-display_probing.adb index 3428bb9..4625322 100644 --- a/common/hw-gfx-gma-display_probing.adb +++ b/common/hw-gfx-gma-display_probing.adb @@ -65,13 +65,8 @@ for I in 1 .. 2 loop if Config_Helpers.To_Display_Type (Port) = DP then -- May need power and CDClk to read EDID - declare - Temp_Configs : Pipe_Configs := Cur_Configs; - begin - Temp_Configs (Primary).Port := Port; - Power_And_Clocks.Power_Up (Cur_Configs, Temp_Configs); - Power_And_Clocks.Enable_CDClk; - end; + Power_And_Clocks.Power_Up (Port, Aux_Only => True); + Power_And_Clocks.Enable_CDClk;
declare DP_Port : constant GMA.DP_Port := diff --git a/common/ironlake/hw-gfx-gma-power_and_clocks.ads b/common/ironlake/hw-gfx-gma-power_and_clocks.ads index 313239b..6e235d8 100644 --- a/common/ironlake/hw-gfx-gma-power_and_clocks.ads +++ b/common/ironlake/hw-gfx-gma-power_and_clocks.ads @@ -34,6 +34,7 @@
procedure Power_Set_To (Configs : Pipe_Configs) is null;
+ procedure Power_Up (Port : Active_Port_Type; Aux_Only : Boolean := False) is null; procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs) is null;
procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Pipe_Configs) diff --git a/common/skylake/hw-gfx-gma-power_and_clocks.adb b/common/skylake/hw-gfx-gma-power_and_clocks.adb index 2841208..e55c1d0 100644 --- a/common/skylake/hw-gfx-gma-power_and_clocks.adb +++ b/common/skylake/hw-gfx-gma-power_and_clocks.adb @@ -409,6 +409,17 @@ end loop; end Power_Set_To;
+ procedure Power_Up (Port : Active_Port_Type; Aux_Only : Boolean := False) is + begin + case Port is + when eDP => PD_On (DDI_AE); + when DP1 | HDMI1 => PD_On (DDI_B); + when DP2 | HDMI2 => PD_On (DDI_C); + when DP3 | HDMI3 => PD_On (DDI_D); + when others => null; + end case; + end Power_Up; + procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs) is begin for PD in Dynamic_Domain loop diff --git a/common/skylake/hw-gfx-gma-power_and_clocks.ads b/common/skylake/hw-gfx-gma-power_and_clocks.ads index e4f2611..d464493 100644 --- a/common/skylake/hw-gfx-gma-power_and_clocks.ads +++ b/common/skylake/hw-gfx-gma-power_and_clocks.ads @@ -32,6 +32,10 @@ procedure Enable_CDClk is null;
procedure Power_Set_To (Configs : Pipe_Configs); + pragma Warnings + (GNATprove, Off, "unused variable ""Aux_Only""", + Reason => "Skylake makes no distinction."); + procedure Power_Up (Port : Active_Port_Type; Aux_Only : Boolean := False); procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs); procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Pipe_Configs);
diff --git a/common/tigerlake/hw-gfx-gma-power_and_clocks.adb b/common/tigerlake/hw-gfx-gma-power_and_clocks.adb index 0a78217..77c879b 100644 --- a/common/tigerlake/hw-gfx-gma-power_and_clocks.adb +++ b/common/tigerlake/hw-gfx-gma-power_and_clocks.adb @@ -52,6 +52,11 @@ pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); end Power_Set_To;
+ procedure Power_Up (Port : Active_Port_Type; Aux_Only : Boolean := False) is + begin + null; + end Power_Up; + procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs) is begin pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); diff --git a/common/tigerlake/hw-gfx-gma-power_and_clocks.ads b/common/tigerlake/hw-gfx-gma-power_and_clocks.ads index 72854e8..5f98a89 100644 --- a/common/tigerlake/hw-gfx-gma-power_and_clocks.ads +++ b/common/tigerlake/hw-gfx-gma-power_and_clocks.ads @@ -37,6 +37,7 @@ procedure Enable_CDClk is null;
procedure Power_Set_To (Configs : Pipe_Configs); + procedure Power_Up (Port : Active_Port_Type; Aux_Only : Boolean := False); procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs); procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Pipe_Configs); pragma Warnings (On, "subprogram ""*"" has no effect");