gma adl: Add missing Alder Lake power & clock bits
Most notable changes are:
* ADL-P has different default CDClk frequency choices.
* There are new divisors for CDClk:
+ 3 (resulting in an odd `/ 1.5` for CDClk x2)
+ and 8.
* There are four DBUF slices now and we need to enable all of
them (probably related to their position and distance to the
display pipelines on the MBus).
* Programming of MBus ABOX credits is not needed anymore
(Has_Mbus_Abox_Credits).
* The MBus configuration allows joining of DBUF slices. We
enable this for our simple buffer allocation (Has_Mbus_Joining)
(this could use a deeper investigation if we wanted to conserve
power).
This is based on work by several authors that was originally
squashed into another commit:
https://review.coreboot.org/c/libgfxinit/+/67801/
Change-Id: I6402b9cdcc3571128d76026aa5c7c1bb48f8df33
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/libgfxinit/+/510
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: Ada SPARK <gnatbot@sourcearcade.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
diff --git a/common/tigerlake/hw-gfx-gma-power_domains_common.adb b/common/tigerlake/hw-gfx-gma-power_domains_common.adb
index 5c94c3f..94ca219 100644
--- a/common/tigerlake/hw-gfx-gma-power_domains_common.adb
+++ b/common/tigerlake/hw-gfx-gma-power_domains_common.adb
@@ -113,6 +113,11 @@
Mask => DP_AUX_CH_CTL_TBT_IO);
Connectors.TC.Ownership.Claimed (To_GPU_Port (PD), Success);
elsif PD = PW1 then
+ if Config.Gen_AlderlakeP then
+ Registers.Set_Mask
+ (Register => Registers.GEN8_CHICKEN_DCPR_1,
+ Mask => 1 * 2 ** 15); -- DISABLE_FLR_SRC
+ end if;
Registers.Wait_Set_Mask
(Register => Registers.FUSE_STATUS,
Mask => FUSE_STATUS_PG0_DIST_STATUS,
@@ -183,7 +188,11 @@
Success => Success);
pragma Debug (not Success, Debug.Put_Line ("Failed to enable power domain!"));
- if Success then
+ if Success or else
+ (Config.Gen_AlderlakeP and then PD in AUX_USBC_Domain)
+ then
+ -- FIXME: Is it really expected?
+ pragma Debug (not Success, Debug.Put_Line ("AUX timeout expected."));
Post_PD_On (PD);
end if;
end if;