intel-pmc-mux.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. .. SPDX-License-Identifier: GPL-2.0
  2. =====================
  3. Intel North Mux-Agent
  4. =====================
  5. Introduction
  6. ============
  7. North Mux-Agent is a function of the Intel PMC firmware that is supported on
  8. most Intel based platforms that have the PMC microcontroller. It's used for
  9. configuring the various USB Multiplexer/DeMultiplexers on the system. The
  10. platforms that allow the mux-agent to be configured from the operating system
  11. have an ACPI device object (node) with HID "INTC105C" that represents it.
  12. The North Mux-Agent (aka. Intel PMC Mux Control, or just mux-agent) driver
  13. communicates with the PMC microcontroller by using the PMC IPC method
  14. (drivers/platform/x86/intel_scu_ipc.c). The driver registers with the USB Type-C
  15. Mux Class which allows the USB Type-C Controller and Interface drivers to
  16. configure the cable plug orientation and mode (with Alternate Modes). The driver
  17. also registers with the USB Role Class in order to support both USB Host and
  18. Device modes. The driver is located here: drivers/usb/typec/mux/intel_pmc_mux.c.
  19. Port nodes
  20. ==========
  21. General
  22. -------
  23. For every USB Type-C connector under the mux-agent control on the system, there
  24. is a separate child node under the PMC mux-agent device node. Those nodes do not
  25. represent the actual connectors, but instead the "channels" in the mux-agent
  26. that are associated with the connectors::
  27. Scope (_SB.PCI0.PMC.MUX)
  28. {
  29. Device (CH0)
  30. {
  31. Name (_ADR, 0)
  32. }
  33. Device (CH1)
  34. {
  35. Name (_ADR, 1)
  36. }
  37. }
  38. _PLD (Physical Location of Device)
  39. ----------------------------------
  40. The optional _PLD object can be used with the port (the channel) nodes. If _PLD
  41. is supplied, it should match the connector node _PLD::
  42. Scope (_SB.PCI0.PMC.MUX)
  43. {
  44. Device (CH0)
  45. {
  46. Name (_ADR, 0)
  47. Method (_PLD, 0, NotSerialized)
  48. {
  49. /* Consider this as pseudocode. */
  50. Return (\_SB.USBC.CON0._PLD())
  51. }
  52. }
  53. }
  54. Mux-agent specific _DSD Device Properties
  55. -----------------------------------------
  56. Port Numbers
  57. ~~~~~~~~~~~~
  58. In order to configure the muxes behind a USB Type-C connector, the PMC firmware
  59. needs to know the USB2 port and the USB3 port that is associated with the
  60. connector. The driver extracts the correct port numbers by reading specific _DSD
  61. device properties named "usb2-port-number" and "usb3-port-number". These
  62. properties have integer value that means the port index. The port index number
  63. is 1's based, and value 0 is illegal. The driver uses the numbers extracted from
  64. these device properties as-is when sending the mux-agent specific messages to
  65. the PMC::
  66. Name (_DSD, Package () {
  67. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  68. Package() {
  69. Package () {"usb2-port-number", 6},
  70. Package () {"usb3-port-number", 3},
  71. },
  72. })
  73. Orientation
  74. ~~~~~~~~~~~
  75. Depending on the platform, the data and SBU lines coming from the connector may
  76. be "fixed" from the mux-agent's point of view, which means the mux-agent driver
  77. should not configure them according to the cable plug orientation. This can
  78. happen for example if a retimer on the platform handles the cable plug
  79. orientation. The driver uses a specific device properties "sbu-orientation"
  80. (SBU) and "hsl-orientation" (data) to know if those lines are "fixed", and to
  81. which orientation. The value that these properties have is a string value, and
  82. it can be one that is defined for the USB Type-C connector orientation: "normal"
  83. or "reversed"::
  84. Name (_DSD, Package () {
  85. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  86. Package() {
  87. Package () {"sbu-orientation", "normal"},
  88. Package () {"hsl-orientation", "normal"},
  89. },
  90. })
  91. Example ASL
  92. ===========
  93. The following ASL is an example that shows the mux-agent node, and two
  94. connectors under its control::
  95. Scope (_SB.PCI0.PMC)
  96. {
  97. Device (MUX)
  98. {
  99. Name (_HID, "INTC105C")
  100. Device (CH0)
  101. {
  102. Name (_ADR, 0)
  103. Name (_DSD, Package () {
  104. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  105. Package() {
  106. Package () {"usb2-port-number", 6},
  107. Package () {"usb3-port-number", 3},
  108. Package () {"sbu-orientation", "normal"},
  109. Package () {"hsl-orientation", "normal"},
  110. },
  111. })
  112. }
  113. Device (CH1)
  114. {
  115. Name (_ADR, 1)
  116. Name (_DSD, Package () {
  117. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  118. Package() {
  119. Package () {"usb2-port-number", 5},
  120. Package () {"usb3-port-number", 2},
  121. Package () {"sbu-orientation", "normal"},
  122. Package () {"hsl-orientation", "normal"},
  123. },
  124. })
  125. }
  126. }
  127. }