Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/libgfxinit/+/83599?usp=email )
Change subject: gma: Re-structure TC port types ......................................................................
gma: Re-structure TC port types
The `USBC1_DP/_HDMI' names did not draw an accurate picture. If they are implemented as legacy ports (for HDMI always the case), they don't show as USBC in schematics, the OS or anywhere else. We also couldn't tell if a `USBCx_DP' was implemented as legacy or USB-C.
We split them by actual, physical connector type now: HDMI, DP, and USBC (for DP-Alt mode). The `_TCx' suffixes should provide an idea where they are connected to a socket or SoC.
Tiger Lake and Alder Lake differ where the TC ports are connec- ted to the display engine. Tiger Lake uses the first 4 TC regis- ter sets, while Alder Lake seems to use the last 4.
Also, as any of the 3 Combo-PHYs (DP1..3) can be used as eDP, we map that to the port, that is used with the first set of panel- control lines. This should hopefully match most board designs.
Change-Id: If9755fe8e1f9252e6e77e22fe910964ad3c3743b Signed-off-by: Nico Huber nico.huber@secunet.com --- M common/hw-gfx-gma-config.ads.template M common/hw-gfx-gma-config_helpers.adb M common/hw-gfx-gma.adb M common/hw-gfx-gma.ads M configs/tigerlake 5 files changed, 89 insertions(+), 75 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/99/83599/1
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template index dd6c2f8..39a6f71 100644 --- a/common/hw-gfx-gma-config.ads.template +++ b/common/hw-gfx-gma-config.ads.template @@ -316,7 +316,8 @@ (Disabled => False, eDP => False, LVDS => Gen_Ironlake, - DP1 .. HDMI3 => Gen_Ironlake, + DP1 .. DP3 => Gen_Ironlake, + HDMI1 .. HDMI3 => Gen_Ironlake, Analog => Has_PCH_DAC, others => False);
diff --git a/common/hw-gfx-gma-config_helpers.adb b/common/hw-gfx-gma-config_helpers.adb index 868d514..5a3ba7e 100644 --- a/common/hw-gfx-gma-config_helpers.adb +++ b/common/hw-gfx-gma-config_helpers.adb @@ -26,6 +26,12 @@ Port : Active_Port_Type) return GPU_Port is + function Combo_PHY (Port : Port_Type) return GPU_Port is + (case Port is + when HDMI1 | DP1 => DIGI_A, + when HDMI2 | DP2 => DIGI_B, + when HDMI3 | DP3 => DIGI_C, + when others => LVDS); -- n/a, actually begin return (case Config.Gen is @@ -47,18 +53,28 @@ when Secondary => DIGI_C, when Tertiary => DIGI_D)), when Tigerlake => - (case Port is - when eDP => DIGI_A, - when HDMI1 | DP1 => DIGI_A, - when HDMI2 | DP2 => DIGI_B, - when HDMI3 | DP3 => DIGI_C, - when USBC1_DP | USBC1_HDMI => DDI_TC1, - when USBC2_DP | USBC2_HDMI => DDI_TC2, - when USBC3_DP | USBC3_HDMI => DDI_TC3, - when USBC4_DP | USBC4_HDMI => DDI_TC4, - when USBC5_DP | USBC5_HDMI => DDI_TC5, - when USBC6_DP | USBC6_HDMI => DDI_TC6, - when others => LVDS), -- n/a, actually + (case CPU_Type (Config.CPU) is + when Tigerlake => + (case Port is + when DP_TC1 | HDMI_TC1 | USBC1 => DDI_TC1, + when DP_TC2 | HDMI_TC2 | USBC2 => DDI_TC2, + when DP_TC3 | HDMI_TC3 | USBC3 => DDI_TC3, + when DP_TC4 | HDMI_TC4 | USBC4 => DDI_TC4, + when eDP => + Combo_PHY (Config.Panel_Ports (Panel_1)), + when others => + Combo_PHY (Port)), + when Alderlake => + (case Port is + when DP_TC1 | HDMI_TC1 | USBC1 => DDI_TC3, + when DP_TC2 | HDMI_TC2 | USBC2 => DDI_TC4, + when DP_TC3 | HDMI_TC3 | USBC3 => DDI_TC5, + when DP_TC4 | HDMI_TC4 | USBC4 => DDI_TC6, + when eDP => + Combo_PHY (Config.Panel_Ports (Panel_1)), + when others => + Combo_PHY (Port)), + when others => LVDS), -- unreachable when others => -- everything but VGA directly on CPU (case Port is when LVDS => LVDS, -- n/a, actually @@ -76,21 +92,20 @@ return (if Config.Has_Type_C_Ports then - (case Port is - when HDMI1 => PCH_HDMI_A, - when HDMI2 => PCH_HDMI_B, - when HDMI3 => PCH_HDMI_C, - when USBC1_HDMI | USBC1_DP => PCH_TC1, - when USBC2_HDMI | USBC2_DP => PCH_TC2, - when USBC3_HDMI | USBC3_DP => PCH_TC3, - when USBC4_HDMI | USBC4_DP => PCH_TC4, - when USBC5_HDMI | USBC5_DP => PCH_TC5, - when USBC6_HDMI | USBC6_DP => PCH_TC6, - when others => PCH_LVDS) -- n/a, actually + (case To_GPU_Port (Pipe_Index'First, Port) is + when DIGI_A => PCH_HDMI_A, + when DIGI_B => PCH_HDMI_B, + when DIGI_C => PCH_HDMI_C, + when DDI_TC1 => PCH_TC1, + when DDI_TC2 => PCH_TC2, + when DDI_TC3 => PCH_TC3, + when DDI_TC4 => PCH_TC4, + when DDI_TC5 => PCH_TC5, + when DDI_TC6 => PCH_TC6, + when others => PCH_LVDS) -- n/a, actually else (case Port is when LVDS => PCH_LVDS, - when eDP => PCH_LVDS, -- n/a, actually when Analog => PCH_DAC, when HDMI1 => PCH_HDMI_B, when HDMI2 => PCH_HDMI_C, @@ -106,15 +121,12 @@ begin return Display_Type' (case Port is - when LVDS => LVDS, - when eDP => DP, - when Analog => VGA, - when HDMI1 .. HDMI3 => HDMI, - when DP1 .. DP3 => DP, - when USBC1_DP | USBC2_DP | USBC3_DP | - USBC4_DP | USBC5_DP | USBC6_DP => DP, - when USBC1_HDMI | USBC2_HDMI | USBC3_HDMI | - USBC4_HDMI | USBC5_HDMI | USBC6_HDMI => HDMI); + when LVDS => LVDS, + when eDP => DP, + when Analog => VGA, + when Physical_HDMI_Ports'Range => HDMI, + when Physical_DP_Ports'Range => DP, + when Physical_USBC_Ports'Range => DP); end To_Display_Type;
function To_Panel (Port : Active_Port_Type) return Panel_Control diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb index c3073d3..88a9760 100644 --- a/common/hw-gfx-gma.adb +++ b/common/hw-gfx-gma.adb @@ -52,31 +52,31 @@ is pragma Disable_Atomic_Synchronization;
- subtype Port_Name is String (1 .. 10); + subtype Port_Name is String (1 .. 8); type Port_Name_Array is array (Port_Type) of Port_Name; Port_Names : constant Port_Name_Array := - (Disabled => "Disabled ", - LVDS => "LVDS ", - eDP => "eDP ", - DP1 => "DP1 ", - DP2 => "DP2 ", - DP3 => "DP3 ", - HDMI1 => "HDMI1 ", - HDMI2 => "HDMI2 ", - HDMI3 => "HDMI3 ", - Analog => "Analog ", - USBC1_DP => "USBC1-DP ", - USBC2_DP => "USBC2-DP ", - USBC3_DP => "USBC3-DP ", - USBC4_DP => "USBC4-DP ", - USBC5_DP => "USBC5-DP ", - USBC6_DP => "USBC6-DP ", - USBC1_HDMI => "USBC1-HDMI", - USBC2_HDMI => "USBC2-HDMI", - USBC3_HDMI => "USBC3-HDMI", - USBC4_HDMI => "USBC4-HDMI", - USBC5_HDMI => "USBC5-HDMI", - USBC6_HDMI => "USBC6-HDMI"); + (Disabled => "Disabled", + LVDS => "LVDS ", + eDP => "eDP ", + DP1 => "DP1 ", + DP2 => "DP2 ", + DP3 => "DP3 ", + DP_TC1 => "DP_TC1 ", + DP_TC2 => "DP_TC2 ", + DP_TC3 => "DP_TC3 ", + DP_TC4 => "DP_TC4 ", + HDMI1 => "HDMI1 ", + HDMI2 => "HDMI2 ", + HDMI3 => "HDMI3 ", + HDMI_TC1 => "HDMI_TC1", + HDMI_TC2 => "HDMI_TC2", + HDMI_TC3 => "HDMI_TC3", + HDMI_TC4 => "HDMI_TC4", + Analog => "Analog ", + USBC1 => "USBC1 ", + USBC2 => "USBC2 ", + USBC3 => "USBC3 ", + USBC4 => "USBC4 ");
package Dev is new HW.PCI.Dev (PCI.Address'(0, 2, 0));
diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads index 43e88e1..1065d21 100644 --- a/common/hw-gfx-gma.ads +++ b/common/hw-gfx-gma.ads @@ -70,27 +70,28 @@ DP1, DP2, DP3, - HDMI1, -- or DVI - HDMI2, -- or DVI - HDMI3, -- or DVI + DP_TC1, + DP_TC2, + DP_TC3, + DP_TC4, + HDMI1, -- or DVI + HDMI2, -- or DVI + HDMI3, -- or DVI + HDMI_TC1, -- or DVI + HDMI_TC2, -- or DVI + HDMI_TC3, -- or DVI + HDMI_TC4, -- or DVI Analog, - USBC1_DP, - USBC2_DP, - USBC3_DP, - USBC4_DP, - USBC5_DP, - USBC6_DP, - USBC1_HDMI, - USBC2_HDMI, - USBC3_HDMI, - USBC4_HDMI, - USBC5_HDMI, - USBC6_HDMI); + USBC1, + USBC2, + USBC3, + USBC4); subtype Active_Port_Type is Port_Type range Port_Type'Succ (Disabled) .. Port_Type'Last; subtype Internal_Port_Type is Port_Type range LVDS .. eDP; - subtype Combo_Port_Type is Port_Type range DP1 .. HDMI3; - subtype USBC_Port_Type is Port_Type range USBC1_DP .. USBC6_HDMI; + subtype Physical_DP_Ports is Port_Type range DP1 .. DP_TC4; + subtype Physical_HDMI_Ports is Port_Type range HDMI1 .. HDMI_TC4; + subtype Physical_USBC_Ports is Port_Type range USBC1 .. USBC4;
type Cursor_Mode is (No_Cursor, ARGB_Cursor); type Cursor_Size is (Cursor_64x64, Cursor_128x128, Cursor_256x256); diff --git a/configs/tigerlake b/configs/tigerlake index e28e818..a24fb39 100644 --- a/configs/tigerlake +++ b/configs/tigerlake @@ -1,6 +1,6 @@ CONFIG_GFX_GMA_DYN_CPU = y CONFIG_GFX_GMA_GENERATION = Tigerlake CONFIG_GFX_GMA_PCH = Tiger_Point -CONFIG_GFX_GMA_PANEL_1_PORT = eDP +CONFIG_GFX_GMA_PANEL_1_PORT = DP1 CONFIG_GFX_GMA_ANALOG_I2C_PORT = PCH_DAC # N/A CONFIG_GFX_GMA_DEFAULT_MMIO = 16#e000_0000#