John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42295 )
Change subject: soc/intel/tigerlake: Update TCSS for SW CM support ......................................................................
soc/intel/tigerlake: Update TCSS for SW CM support
This change adds support for SW CM. Add Operating System Capabilities (_OSC) method to enable USB/DisplayPort/Inter-doman USB4 internet protocol tunneling and disable PCIe tunneling. Remove Connect Topogoly (CNTP) command because kernel driver directly works with SW CM Thunderbolt firmware. Update _DSD method for USB4 support across xhci and PCIe root ports.
BUG=b:140645231 TEST=Check Type C device connection/enumeration with SW CM.
Signed-off-by: John Zhao john.zhao@intel.com Change-Id: I859c5075882e40d7be30d4ba88cc825886712b74 --- M src/soc/intel/tigerlake/acpi/tcss.asl M src/soc/intel/tigerlake/acpi/tcss_dma.asl M src/soc/intel/tigerlake/acpi/tcss_pcierp.asl M src/soc/intel/tigerlake/acpi/tcss_xhci.asl 4 files changed, 182 insertions(+), 180 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/42295/1
diff --git a/src/soc/intel/tigerlake/acpi/tcss.asl b/src/soc/intel/tigerlake/acpi/tcss.asl index 48f2689..93bd32c 100644 --- a/src/soc/intel/tigerlake/acpi/tcss.asl +++ b/src/soc/intel/tigerlake/acpi/tcss.asl @@ -126,6 +126,46 @@ } Return (0) } + + Method (_OSC, 4, Serialized) + { + /* + * Operating System Capabilities for USB4 + * Arg0: UUID = {23A0D13A-26AB-486C-9C5F-0FFA525A575A} + * Arg1: Revision ID = 1 + * Arg2: Count of entries (DWORD) in Arg3 (Integer): 3 + * Arg3: DWORD capabilities buffer: + * First DWORD: The standard definiton bits is used to return errors. + * Second DWORD: OSPM support field for USB4, bits [31:0] reserved. + * Third DWORD: OSPM control field for USB4. + * bit 0: USB tunneling + * bit 1: DisplayPort tunneling + * bit 2: PCIe tunneling + * bit 3: Inter-domain USB4 internet protocol + * bit 31:4: reserved + * Return: The platform acknolwedges the Capabilities buffer by returning + * a buffer of DWORD of the same length. Preserved bits in the control + * field from the platform to OSPM, while masked/cleared bits in the + * control field indicate that the platform does not permit OSPM control + * of the respective capabilities or features. + */ + Name (CTRL, 0) /* Control field value */ + If (Arg0 == ToUUID("23A0D13A-26AB-486C-9C5F-0FFA525A575A")) { + CreateDWordField(Arg3, 0, CDW1) + CreateDWordField(Arg3, 8, CDW3) + CTRL = CDW3 + + If (Arg1 != 1) { + CDW1 |= 0x8 /* Unknown revision */ + } + CTRL |= 0xb + CDW3 = CTRL + Return (Arg3) + } Else { + CDW1 |= 0x4 /* Unrecognized UUID */ + Return (Arg3) + } + } }
Scope (_GPE) @@ -424,17 +464,6 @@ }
/* - * Below is a variable to store devices connect state for TBT PCIe RP before - * entering D3 cold. - * Value 0 - no device connected before enter D3 cold, no need to send - * CONNECT_TOPOLOGY in D3 cold exit. - * Value 1 - has device connected before enter D3 cold, need to send - * CONNECT_TOPOLOGY in D3 cold exit. - */ - Name (CTP0, 0) /* Variable of device connecet status for TBT0 group. */ - Name (CTP1, 0) /* Variable of device connecet status for TBT1 group. */ - - /* * TBT Group0 ON method */ Method (TG0N, 0) @@ -455,28 +484,6 @@ /* RP1 D3 cold exit. */ _SB.PCI0.TRP1.D3CX() } - - /* - * Need to send Connect-Topology command when TBT host - * controller back to D0 from D3. - */ - If (_SB.PCI0.TDM0.ALCT == 1) { - If (CTP0 == 1) { - /* - * Send Connect-Topology command if there is - * device present on PCIe RP. - */ - _SB.PCI0.TDM0.CNTP() - - /* Indicate to wait Connect-Topology command. */ - _SB.PCI0.TDM0.WACT = 1 - - /* Clear the connect states. */ - CTP0 = 0 - } - /* Disallow to send Connect-Topology command. */ - _SB.PCI0.TDM0.ALCT = 0 - } } Else { Printf("Drop TG0N due to it is already exit D3 cold.") } @@ -500,16 +507,10 @@
Printf("Push TBT RPs to D3Cold together") If (_SB.PCI0.TRP0.VDID != 0xFFFFFFFF) { - If (_SB.PCI0.TRP0.PDSX == 1) { - CTP0 = 1 - } /* Put RP0 to D3 cold. */ _SB.PCI0.TRP0.D3CE() } If (_SB.PCI0.TRP1.VDID != 0xFFFFFFFF) { - If (_SB.PCI0.TRP1.PDSX == 1) { - CTP0 = 1 - } /* Put RP1 to D3 cold. */ _SB.PCI0.TRP1.D3CE() } @@ -538,28 +539,6 @@ /* RP3 D3 cold exit. */ _SB.PCI0.TRP3.D3CX() } - - /* - * Need to send Connect-Topology command when TBT host - * controller back to D0 from D3. - */ - If (_SB.PCI0.TDM1.ALCT == 1) { - If (CTP1 == 1) { - /* - * Send Connect-Topology command if there is - * device present on PCIe RP. - */ - _SB.PCI0.TDM1.CNTP() - - /* Indicate to wait Connect-Topology command. */ - _SB.PCI0.TDM1.WACT = 1 - - /* Clear the connect states. */ - CTP1 = 0 - } - /* Disallow to send Connect-Topology cmd. */ - _SB.PCI0.TDM1.ALCT = 0 - } } Else { Printf("Drop TG1N due to it is already exit D3 cold.") } @@ -583,16 +562,10 @@
Printf("Push TBT RPs to D3Cold together") If (_SB.PCI0.TRP2.VDID != 0xFFFFFFFF) { - If (_SB.PCI0.TRP2.PDSX == 1) { - CTP1 = 1 - } /* Put RP2 to D3 cold. */ _SB.PCI0.TRP2.D3CE() } If (_SB.PCI0.TRP3.VDID != 0xFFFFFFFF) { - If (_SB.PCI0.TRP3.PDSX == 1) { - CTP1 = 1 - } /* Put RP3 to D3 cold */ _SB.PCI0.TRP3.D3CE() } diff --git a/src/soc/intel/tigerlake/acpi/tcss_dma.asl b/src/soc/intel/tigerlake/acpi/tcss_dma.asl index 66950a6..cca69c8 100644 --- a/src/soc/intel/tigerlake/acpi/tcss_dma.asl +++ b/src/soc/intel/tigerlake/acpi/tcss_dma.asl @@ -81,58 +81,10 @@ } }
-/* - * TCSS TBT CONNECT_TOPOLOGY MailBox Command Method - */ -Method (CNTP, 0, Serialized) -{ - Local0 = 0 - /* Set Force Power if it is not set */ - If (DFPE == 0) { - DMAD = 0x22 - DFPE = 1 - /* - * Poll the TBT NVM FW Ready bit with timeout(default is 500ms) before - * send the TBT MailBox command. - */ - While ((INFR == 0) && (Local0 < 500)) { - Sleep (1) - Local0++ - } - } - If (Local0 != 100) { - ITMB (0x3E) /* 0x3E, PCIE2TBT_CONNECT_TOPOLOGY_COMMAND */ - } -} - Name (STAT, 0x1) /* Variable to save power state 1 - D0, 0 - D3C */ -Name (ALCT, 0x0) /* Connect-Topology cmd can be sent or not 1 - yes, 0 - no */ -/* - * Wait Connect-Topology cmd done - * 0 - no need to wait - * 1 - need to wait - * 2 - wait in progress - */ -Name (WACT, 0x0)
Method (_PS0, 0, Serialized) { - If (WACT == 1) { - /* - * PCIe rp0/rp1 is grouped with DMA0 and PCIe rp2/rp3 is grouped wit DMA1. - * Whenever the Connect-Topology command is in the process, WACT flag is set 1. - * PCIe root ports 0/1/2/3/ and DMA 0/1 _PS0 method set WACT to 2 to indicate - * other thread's _PS0 to wait for the command completion. WACT is cleared to - * be 0 after command is finished. - */ - WACT = 2 - WFCC (100) /* Wait for command complete. */ - WACT = 0 - } ElseIf (WACT == 2) { - While (WACT != 0) { - Sleep (5) - } - } }
Method (_PS3, 0, Serialized) @@ -178,7 +130,6 @@ { DD3E = 1 /* Enable DMA RTD3 */ STAT = 0 - ALCT = 0x1 /* Allow to send Connect-Topology cmd. */ }
/* diff --git a/src/soc/intel/tigerlake/acpi/tcss_pcierp.asl b/src/soc/intel/tigerlake/acpi/tcss_pcierp.asl index a7eafa4..8172f03 100644 --- a/src/soc/intel/tigerlake/acpi/tcss_pcierp.asl +++ b/src/soc/intel/tigerlake/acpi/tcss_pcierp.asl @@ -64,7 +64,7 @@ */ Method (_DSM, 4, Serialized) { - Return (Buffer() {0x00}) + return (Buffer() { 0x00 }) }
Device (PXSX) @@ -195,34 +195,8 @@ If (PMEX == 1) { PMEX = 0 /* Disable Power Management SCI */ } + Sleep(100) /* Wait for 100ms before return to OS starts any DS activities. */ - If ((TUID == 0) || (TUID == 1)) { - If (_SB.PCI0.TDM0.WACT == 1) { - /* - * Indicate other thread's _PS0 to wait the response. - */ - _SB.PCI0.TDM0.WACT = 2 - _SB.PCI0.TDM0.WFCC (10) /* Wait for command complete. */ - _SB.PCI0.TDM0.WACT = 0 - } ElseIf (_SB.PCI0.TDM0.WACT == 2) { - While (_SB.PCI0.TDM0.WACT != 0) { - Sleep (5) - } - } - } Else { - If (_SB.PCI0.TDM1.WACT == 1) { - /* - * Indicate other thread's _PS0 to wait the response. - */ - _SB.PCI0.TDM1.WACT = 2 - _SB.PCI0.TDM1.WFCC (10) /* Wait for command complete. */ - _SB.PCI0.TDM1.WACT = 0 - } ElseIf (_SB.PCI0.TDM1.WACT == 2) { - While (_SB.PCI0.TDM1.WACT != 0) { - Sleep (5) - } - } - } }
Method (_PS3, 0, Serialized) @@ -246,27 +220,82 @@ }
Method (_DSD, 0) { - Return ( - Package () { - /* acpi_pci_bridge_d3 at ../drivers/pci/pci-acpi.c */ - ToUUID("6211E2C0-58A3-4AF3-90E1-927A4E0C55A4"), - Package () - { - Package (2) { "HotPlugSupportInD3", 1 }, - }, + If ((TUID == 0) || (TUID == 1)) { + Return ( Package() { + /* acpi_pci_bridge_d3 at ../drivers/pci/pci-acpi.c */ + ToUUID("6211E2C0-58A3-4AF3-90E1-927A4E0C55A4"), + Package () + { + Package (2) { "HotPlugSupportInD3", 1 }, + },
- /* pci_acpi_set_untrusted at ../drivers/pci/pci-acpi.c */ - ToUUID("EFCC06CC-73AC-4BC3-BFF0-76143807C389"), - Package () { - Package (2) { "ExternalFacingPort", 1 }, /* TBT/CIO port */ - /* - * UID of the TBT RP on platform, range is: 0, 1 ..., - * (NumOfTBTRP - 1). - */ - Package (2) { "UID", TUID }, - } - } - ) + /* pci_acpi_set_untrusted at ../drivers/pci/pci-acpi.c */ + ToUUID("EFCC06CC-73AC-4BC3-BFF0-76143807C389"), + Package () { + Package (2) { "ExternalFacingPort", 1 }, /* TBT/CIO port */ + /* + * UID of the TBT RP on platform, range is: 0, 1 ..., + * (NumOfTBTRP - 1). + */ + Package (2) { "UID", TUID }, + }, + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package (2) { "usb4-host-interface", _SB.PCI0.TDM0 }, + Package (2) { "usb4-port-number", TUID }, + } + }) + } ElseIf (TUID == 2) { + Return ( Package () { + /* acpi_pci_bridge_d3 at ../drivers/pci/pci-acpi.c */ + ToUUID("6211E2C0-58A3-4AF3-90E1-927A4E0C55A4"), + Package () + { + Package (2) { "HotPlugSupportInD3", 1 }, + }, + + /* pci_acpi_set_untrusted at ../drivers/pci/pci-acpi.c */ + ToUUID("EFCC06CC-73AC-4BC3-BFF0-76143807C389"), + Package () { + Package (2) { "ExternalFacingPort", 1 }, /* TBT/CIO port */ + /* + * UID of the TBT RP on platform, range is: 0, 1 ..., + * (NumOfTBTRP - 1). + */ + Package (2) { "UID", TUID }, + }, + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package (2) { "usb4-host-interface", _SB.PCI0.TDM1 }, + Package (2) { "usb4-port-number", 0 }, + } + }) + } Else { /* TUID == 3 */ + Return ( Package () { + /* acpi_pci_bridge_d3 at ../drivers/pci/pci-acpi.c */ + ToUUID("6211E2C0-58A3-4AF3-90E1-927A4E0C55A4"), + Package () + { + Package (2) { "HotPlugSupportInD3", 1 }, + }, + + /* pci_acpi_set_untrusted at ../drivers/pci/pci-acpi.c */ + ToUUID("EFCC06CC-73AC-4BC3-BFF0-76143807C389"), + Package () { + Package (2) { "ExternalFacingPort", 1 }, /* TBT/CIO port */ + /* + * UID of the TBT RP on platform, range is: 0, 1 ..., + * (NumOfTBTRP - 1). + */ + Package (2) { "UID", TUID }, + }, + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () { + Package (2) { "usb4-host-interface", _SB.PCI0.TDM1 }, + Package (2) { "usb4-port-number", 1 }, + } + }) + } }
Method (_S0W, 0x0, NotSerialized) diff --git a/src/soc/intel/tigerlake/acpi/tcss_xhci.asl b/src/soc/intel/tigerlake/acpi/tcss_xhci.asl index 259b92a..8c62a97 100644 --- a/src/soc/intel/tigerlake/acpi/tcss_xhci.asl +++ b/src/soc/intel/tigerlake/acpi/tcss_xhci.asl @@ -115,23 +115,72 @@ }
/* Super Speed Ports */ - Device (SS01) - { - Name (_ADR, 0x02) - } + Device (SS01) + { + Name (_ADR, 0x02) + Method (_DSD, 0, NotSerialized) + { + Return( Package () + { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () + { + Package (2) { "usb4-host-interface", _SB.PCI0.TDM0 }, + Package (2) { "usb4-port-number", 0 } + } + }) + } + }
- Device (SS02) - { - Name (_ADR, 0x03) - } + Device (SS02) + { + Name (_ADR, 0x03) + Method (_DSD, 0, NotSerialized) + { + Return( Package () + { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () + { + Package (2) { "usb4-host-interface", _SB.PCI0.TDM0 }, + Package (2) { "usb4-port-number", 1 } + } + }) + } + }
- Device (SS03) - { - Name (_ADR, 0x04) - } + Device (SS03) + { + Name (_ADR, 0x04) + Method (_DSD, 0, NotSerialized) + { + Return( Package () + { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () + { + Package (2) { "usb4-host-interface", _SB.PCI0.TDM1 }, + Package (2) { "usb4-port-number", 0 } + } + }) + } + }
- Device (SS04) - { - Name (_ADR, 0x05) - } + Device (SS04) + { + Name (_ADR, 0x05) + Method (_DSD, 0, NotSerialized) + { + Return( Package () + { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), + Package () + { + Package (2) { "usb4-host-interface", _SB.PCI0.TDM1 }, + Package (2) { "usb4-port-number", 1 } + } + }) + } + } + }