Nico Huber has submitted this change. ( https://review.coreboot.org/c/libgfxinit/+/67491?usp=email )
Change subject: gma: Update PCH Rawclk programming for TGL ......................................................................
gma: Update PCH Rawclk programming for TGL
Tigerlake onwards needs the Rawclk numerator programmed into the RAWCLK register in addition the fields from to prior generations.
Signed-off-by: Tim Wawrzynczak twawrzynczak@chromium.org Change-Id: Iad36221a44db4128332392bd6610132ea08c0e35 Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/67491 Reviewed-by: Nico Huber nico.h@gmx.de Tested-by: Nico Huber nico.h@gmx.de --- M common/hw-gfx-gma-config.ads.template M common/hw-gfx-gma.adb 2 files changed, 21 insertions(+), 2 deletions(-)
Approvals: Nico Huber: Verified; Looks good to me, approved
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template index e759a0c..a2bc2e8 100644 --- a/common/hw-gfx-gma-config.ads.template +++ b/common/hw-gfx-gma-config.ads.template @@ -293,6 +293,9 @@ ----------- Type-C: ---------- Has_Type_C_Ports : <genbool> := Tigerlake_On;
+ ----------- Rawclk ----------- + Need_Rawclk_Numerator : <genbool> := Tigerlake_On; + ----------------------------------------------------------------------------
Max_Pipe : <ilkvar> Pipe_Index := diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb index 83ded92..cacafd3 100644 --- a/common/hw-gfx-gma.adb +++ b/common/hw-gfx-gma.adb @@ -97,8 +97,20 @@
----------------------------------------------------------------------------
- PCH_RAWCLK_FREQ_MASK : constant := - (if Config.Has_Fractional_RawClk then 16#3fff# * 2 ** 16 else 16#3ff# * 2 ** 0); + ICP_RAWCLK_NUM : constant := 1 * 2 ** 11; + + function PCH_RAWCLK_FREQ_MASK return Word32 is + Mask : Word32; + begin + if Config.Need_Rawclk_Numerator then + Mask := 16#ffff_ffff#; + elsif Config.Has_Fractional_RawClk then + Mask := 16#3fff# * 2 ** 16; + else + Mask := 16#3ff# * 2 ** 0; + end if; + return Mask; + end PCH_RAWCLK_FREQ_MASK;
function PCH_RAWCLK_FREQ (Freq : Frequency_Type) return Word32 is @@ -112,6 +124,10 @@ Freq32 := Freq32 or Shift_Left (Word32 (Div_Round_Closest (1_000, Fraction_K) - 1), 26); end if; + + if Config.Need_Rawclk_Numerator then + Freq32 := Freq32 or ICP_RAWCLK_NUM; + end if; return Freq32; end; else