Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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