Skip to content

Commit 4b55403

Browse files
committed
soc/intel/meteorlake/acpi/tcss.asl: Notify IGD by TCSS
If DP tulleing and DP_ALT monitoring is enabeld in FSP for IOM, ACPI can notify IGD about HPD assertion and wake IGD from D3 hot. Add ACPI code to detect the HPD assertions and notify IGD if needed. Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
1 parent 64f76b4 commit 4b55403

1 file changed

Lines changed: 91 additions & 0 deletions

File tree

src/soc/intel/meteorlake/acpi/tcss.asl

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,23 @@ Scope (\_SB)
135135
Return (0)
136136
}
137137

138+
Method (TCWK, 1, NotSerialized) {
139+
If (Arg0 == 3 || Arg0 == 4) {
140+
If (LNotEqual (\_SB.PCI0.TRP0.VDID,0xFFFFFFFF)) {
141+
Notify (\_SB.PCI0.TRP0, 0)
142+
}
143+
If (LNotEqual (\_SB.PCI0.TRP1.VDID,0xFFFFFFFF)) {
144+
Notify (\_SB.PCI0.TRP1, 0)
145+
}
146+
If (LNotEqual (\_SB.PCI0.TRP2.VDID,0xFFFFFFFF)) {
147+
Notify (\_SB.PCI0.TRP2, 0)
148+
}
149+
If (LNotEqual (\_SB.PCI0.TRP3.VDID,0xFFFFFFFF)) {
150+
Notify (\_SB.PCI0.TRP3, 0)
151+
}
152+
}
153+
}
154+
138155
Method (_OSC, 4, Serialized)
139156
{
140157
CreateDWordField (Arg3, 0, CDW1)
@@ -320,6 +337,11 @@ Scope (_GPE)
320337
\_SB.PCI0.TRP3.HPME()
321338
}
322339

340+
Method (_L71, 0, Serialized)
341+
{
342+
\_SB.PCI0.IMNG (0x71)
343+
}
344+
323345
Method (_L73, 0 , Serialized) { }
324346
}
325347

@@ -407,11 +429,66 @@ Scope (\_SB.PCI0)
407429
TACK, 1, /* [16:16] IOM Acknowledge bit */
408430
DPOF, 1, /* [17:17] Set 1 to indicate IOM, all the */
409431
/* display is OFF, clear otherwise */
432+
Offset (0x44), /* SW_CONFIG_2 */
433+
DPHD, 1, /* [0:0] DP_ALT and DP Tunneling HPD assertion. */
434+
Offset (0x48), /* SW_CONFIG_3 */
435+
, 12,
436+
INDP, 1, /* [12:12] The capability of monitoring the DP_ALT and DP tunneling. */
410437
Offset(0x70), /* Physical addr is offset 0x70. */
411438
IMCD, 32, /* R_SA_IOM_BIOS_MAIL_BOX_CMD */
412439
IMDA, 32 /* R_SA_IOM_BIOS_MAIL_BOX_DATA */
413440
}
414441

442+
Name (IGFG, 0) /* Internal Monitor On/Off Flag. 1 - Off, 0 - On */
443+
/* Notify iGfx when HPD_ASSERT with DP_ALT/DP tunneling. */
444+
Method (IMNG, 1)
445+
{
446+
Switch (ToInteger (Arg0)) {
447+
Case (0) {
448+
/* Clear IOM_TYPEC_SW_CONFIGURATION_2 BIT0 to 0 while BIOS detect BIT0 is 1 */
449+
If (INDP == 1) {
450+
/*
451+
* Set Internal Monitor off flag for skipping notification
452+
* to iGfx after PEP Fun#3 Display off notification.
453+
*/
454+
IGFG = 1
455+
}
456+
If (DPHD == 1) {
457+
DPHD = 0 /* Clear IOM HPD indication. */
458+
}
459+
}
460+
Case (1) {
461+
/* Clear IOM_TYPEC_SW_CONFIGURATION_2 BIT0 to 0 and notify IGD for device scan */
462+
If (INDP == 1) {
463+
/*
464+
* Clear the internal monitor off flag for enabling
465+
* _L71 notification to iGfx when iGfx is in D3 hot.
466+
*/
467+
IGFG = 0
468+
}
469+
If (DPHD == 1) {
470+
DPHD = 0 /* Clear IOM HPD indication. */
471+
}
472+
}
473+
/* _L71 using condition */
474+
Case (0x71) {
475+
Local0 = 0xF
476+
If (CondRefOf (\_SB.PCI0.GFX0.GFPS)) {
477+
Local0 = \_SB.PCI0.GFX0.GFPS ()
478+
}
479+
If (IGFG == 0) {
480+
/*
481+
* Notify iGfx when the capability bit of monitoring DP_ALT and
482+
* DP tunneling is set and iGfx is in D3 hot.
483+
*/
484+
If (INDP == 1 && Local0 == 3) {
485+
Notify (\_SB.PCI0.GFX0, 0)
486+
}
487+
}
488+
}
489+
}
490+
}
491+
415492
/*
416493
* TBT Group0 ON method
417494
*/
@@ -820,3 +897,17 @@ Scope (\_SB.PCI0)
820897
#include "tcss_pcierp.asl"
821898
}
822899
}
900+
901+
Scope (\_SB.PCI0.GFX0)
902+
{
903+
OperationRegion (PXCS, PCI_Config, 0xd4, 4)
904+
Field (PXCS, AnyAcc, NoLock, Preserve) {
905+
D3HT, 2, // PowerState
906+
}
907+
908+
Method (GFPS,0,Serialized)
909+
{
910+
911+
Return (D3HT)
912+
}
913+
}

0 commit comments

Comments
 (0)