gma: Program PCH_RAWCLK_FREQ register
This seems to be a scratchpad register to tell later drivers which
frequency the platform uses. Linux reads this but never writes the
register.
Change-Id: I55af7c7b675da580c7f52d9997262b232019132c
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17071
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
diff --git a/common/hw-gfx-gma.adb b/common/hw-gfx-gma.adb
index 9e3bee9..416117b 100644
--- a/common/hw-gfx-gma.adb
+++ b/common/hw-gfx-gma.adb
@@ -78,6 +78,16 @@
----------------------------------------------------------------------------
+ PCH_RAWCLK_FREQ_MASK : constant := 16#3ff# * 2 ** 0;
+
+ function PCH_RAWCLK_FREQ (Freq : Frequency_Type) return Word32
+ is
+ begin
+ return Word32 (Freq / 1_000_000);
+ end PCH_RAWCLK_FREQ;
+
+ ----------------------------------------------------------------------------
+
function To_GPU_Port
(Configs : Configs_Type;
Idx : Config_Index)
@@ -712,6 +722,11 @@
-------------------- Now restart from a clean state ---------------------
Power_And_Clocks.Initialize;
+ Registers.Unset_And_Set_Mask
+ (Register => Registers.PCH_RAWCLK_FREQ,
+ Mask_Unset => PCH_RAWCLK_FREQ_MASK,
+ Mask_Set => PCH_RAWCLK_FREQ (Config.Default_RawClk_Freq));
+
Initialized := True;
end Initialize;