~vicamo/+git/ubuntu-kernel:bug-1906236/support-intel-maple-ridge/unstable

Last commit made on 2020-12-03
Get this branch:
git clone -b bug-1906236/support-intel-maple-ridge/unstable https://git.launchpad.net/~vicamo/+git/ubuntu-kernel
Only You-Sheng Yang can upload to this branch. If you are You-Sheng Yang please log in for upload directions.

Branch merges

Branch information

Name:
bug-1906236/support-intel-maple-ridge/unstable
Repository:
lp:~vicamo/+git/ubuntu-kernel

Recent commits

09ba355... by You-Sheng Yang

Bug 1906236: Support Intel Maple Ridge

b8d432d... by Mika Westerberg <email address hidden>

xhci-pci: Allow host runtime PM as default for Intel Maple Ridge xHCI

BugLink: https://bugs.launchpad.net/bugs/1906236

Intel Maple Ridge is successor of Titan Ridge Thunderbolt controller. As
Titan Ridge this one also includes xHCI host controller. In order to
safe energy we should put it to low power state by default when idle.
For this reason allow host runtime PM for Maple Ridge.

Signed-off-by: Mika Westerberg <email address hidden>
Signed-off-by: Mathias Nyman <email address hidden>
(cherry picked from commit 62233f88fda297df335168daf42c969dabb702e7
https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git)
Signed-off-by: You-Sheng Yang <email address hidden>

0539e27... by Mika Westerberg <email address hidden>

thunderbolt: Add support for Intel Maple Ridge

BugLink: https://bugs.launchpad.net/bugs/1906236

Maple Ridge is first discrete USB4 host controller from Intel. It comes
with firmware based connection manager and the flows are similar as used
in Intel Titan Ridge.

Signed-off-by: Mika Westerberg <email address hidden>
(cherry picked from commit db0746e3399ee87ee5f957880811da16faa89fb8
git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git)
Signed-off-by: You-Sheng Yang <email address hidden>

b50123d... by Mika Westerberg <email address hidden>

thunderbolt: Add USB4 router operation proxy for firmware connection manager

BugLink: https://bugs.launchpad.net/bugs/1906236

Intel Maple Ridge and Tiger Lake connection manager firmware implements
a USB4 router operation proxy that should be used instead of direct
register access to avoid races with the firmware. This is supported in
all firmwares where the protocol version field returned in the driver
ready response is 3 (or higher).

This adds the USB4 router proxy operations support to the driver so that
we first check the protocol version and if it is 3 (or higher) the USB4
router operation is run through the firmware provided proxy. Otherwise
the native version is used.

Most USB4 router proxy operations are pretty straightforward except
NVM_AUTH where the firmware only responds once the router is restarted
but before it sends device connected notification. To support this we
split the operation so that the reply is received asynchronously and
stored to struct icm. This last reply is then returned in
icm_usb4_switch_nvm_authenticate_status() if available.

Signed-off-by: Mika Westerberg <email address hidden>
(cherry picked from commit 9039387e166edab35c89ddcc057529e332cc4089
git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git)
Signed-off-by: You-Sheng Yang <email address hidden>

577a46c... by Mika Westerberg <email address hidden>

thunderbolt: Move constants for USB4 router operations to tb_regs.h

BugLink: https://bugs.launchpad.net/bugs/1906236

We are going to use these in subsequent patch so make them available
outside of usb4.c.

Signed-off-by: Mika Westerberg <email address hidden>
(cherry picked from commit 579f14217c952975e7d11e300c669af0c47bfe04
git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git)
Signed-off-by: You-Sheng Yang <email address hidden>

7388c18... by Mika Westerberg <email address hidden>

thunderbolt: Add connection manager specific hooks for USB4 router operations

BugLink: https://bugs.launchpad.net/bugs/1906236

Intel USB4 host routers that run the firmware based connection manager
(ICM) may implement a proxy for USB4 router operations. This is to avoid
the firmware to race with the OS driver, as both may need to run these
operations.

This adds two new connection manager specific callbacks which, if
provided, get called instead of the native USB4 router operation.

Signed-off-by: Mika Westerberg <email address hidden>
(cherry picked from commit 9490f71167feba55349e33854f5e51a1a3af9e8c
git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git)
Signed-off-by: You-Sheng Yang <email address hidden>

8fecd5a... by Mika Westerberg <email address hidden>

thunderbolt: Pass TX and RX data directly to usb4_switch_op()

BugLink: https://bugs.launchpad.net/bugs/1906236

We are going to make usb4_switch_op() to match better the corresponding
firmware (ICM) USB4 router operation proxy interface, so that we can use
either based on the connection manager implementation.

For this reason rename usb4_switch_op() to __usb4_switch_op() that
provides the most complete interface. Then make usb4_switch_op() and
usb4_switch_op_data() call it with correct set of parameters and update
the callers accordingly.

Signed-off-by: Mika Westerberg <email address hidden>
(cherry picked from commit 83bab44ada0512b054844e661279d68d0c8f3d03
git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git)
Signed-off-by: You-Sheng Yang <email address hidden>

43f963f... by Mika Westerberg <email address hidden>

thunderbolt: Pass metadata directly to usb4_switch_op()

BugLink: https://bugs.launchpad.net/bugs/1906236

We are going to make usb4_switch_op() to match better the corresponding
firmware (ICM) USB4 router operation proxy interface, so that we can use
either based on the connection manager implementation. For this reason
pass metadata directly to usb4_switch_op().

Signed-off-by: Mika Westerberg <email address hidden>
(cherry picked from commit fe265a06319bfa27cfbccd3305d93b33b78f48f2
git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git)
Signed-off-by: You-Sheng Yang <email address hidden>

a699560... by Mika Westerberg <email address hidden>

thunderbolt: Perform USB4 router NVM upgrade in two phases

BugLink: https://bugs.launchpad.net/bugs/1906236

The currect code expects that the router returns back the status of the
NVM authentication immediately. When tested against a real USB4 device
what happens is that the router is reset and only after that the result
is updated in the ROUTER_CS_26 register status field. This also seems to
align better what the spec suggests.

For this reason do the same what we already do with the Thunderbolt 3
devices and perform the NVM upgrade in two phases. First start the
NVM_AUTH router operation and once the router is added back after the
reset read the status in ROUTER_CS_26 and expose it to the userspace
accordingly.

Signed-off-by: Mika Westerberg <email address hidden>
(cherry picked from commit 661b19473bf3ac0924560f0cbf84c15458b3c8de
git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git)
Signed-off-by: You-Sheng Yang <email address hidden>

bae51ff... by Mika Westerberg <email address hidden>

thunderbolt: Return -ENOTCONN when ERR_CONN is received

BugLink: https://bugs.launchpad.net/bugs/1906236

This allows the calling code to distinguish if the error was due to
ERR_CONN (adapter is disconneced or disabled) or something else. Will be
needed in USB4 router NVM update in the following patch.

Signed-off-by: Mika Westerberg <email address hidden>
(cherry picked from commit 463e48fa544826898791085508459de246fc4c09
git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git)
Signed-off-by: You-Sheng Yang <email address hidden>