gma tgl: Factor TC ownership/connection handling out
The ownership and connection handling differs for Alder Lake. It uses
kind of the same procedures with different registers and layouts. Move
things into a sub-package `TC.Ownership', to allow alternative imple-
mentations.
We have to share some register definitions with the sub-package, hence
move related things into the private part of `TC'.
Change-Id: Iaa6b39bdb250c1af88ba83bf78a82cbdd298245e
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.sourcearcade.org/c/libgfxinit/+/505
Reviewed-by: Thomas Heijligen <src@posteo.de>
Tested-by: Nico Huber <nico.h@gmx.de>
diff --git a/common/tigerlake/hw-gfx-gma-power_and_clocks.adb b/common/tigerlake/hw-gfx-gma-power_and_clocks.adb
index bbbbd6f..1573777 100644
--- a/common/tigerlake/hw-gfx-gma-power_and_clocks.adb
+++ b/common/tigerlake/hw-gfx-gma-power_and_clocks.adb
@@ -19,7 +19,7 @@
with HW.GFX.GMA.PCode;
with HW.GFX.GMA.Registers;
with HW.GFX.GMA.Transcoder;
-with HW.GFX.GMA.Connectors.TC;
+with HW.GFX.GMA.Connectors.TC.Ownership;
use type HW.Word64;
@@ -225,7 +225,7 @@
Registers.Unset_Mask
(Register => AUX_CTL_Regs (PD),
Mask => DP_AUX_CH_CTL_TBT_IO);
- Connectors.TC.Claimed (To_GPU_Port (PD), Success);
+ Connectors.TC.Ownership.Claimed (To_GPU_Port (PD), Success);
elsif PD = PW1 then
Registers.Wait_Set_Mask
(Register => Registers.FUSE_STATUS,
@@ -261,7 +261,7 @@
-- convenient to do it here: When requested to turn the
-- power off, we know exactly that we don't want to use
-- the port (anymore).
- Connectors.TC.Disconnect (To_GPU_Port (PD));
+ Connectors.TC.Ownership.Disconnect (To_GPU_Port (PD));
end if;
end Pre_PD_Off;
@@ -771,7 +771,7 @@
PD_On (DDI);
if GPU_Port in USBC_Port then
- Connectors.TC.Claim
+ Connectors.TC.Ownership.Claim
(Port => GPU_Port,
DP_Alt => Port in Physical_USBC_Ports,
Success => Success);