Skip to content

Commit 14200a2

Browse files
Memento80westeri
authored andcommitted
thunderbolt: Announce USB4 v2 connection manager support
Program the CMUV (Connection Manager USB4 Version) field for USB4 v2 and v1 routers according to the spec. Signed-off-by: Gil Fine <gil.fine@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
1 parent 0fc7088 commit 14200a2

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

drivers/thunderbolt/switch.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2430,9 +2430,13 @@ int tb_switch_configure(struct tb_switch *sw)
24302430
/*
24312431
* For USB4 devices, we need to program the CM version
24322432
* accordingly so that it knows to expose all the
2433-
* additional capabilities.
2433+
* additional capabilities. Program it according to USB4
2434+
* version to avoid changing existing (v1) routers behaviour.
24342435
*/
2435-
sw->config.cmuv = USB4_VERSION_1_0;
2436+
if (usb4_switch_version(sw) < 2)
2437+
sw->config.cmuv = ROUTER_CS_4_CMUV_V1;
2438+
else
2439+
sw->config.cmuv = ROUTER_CS_4_CMUV_V2;
24362440
sw->config.plug_events_delay = 0xa;
24372441

24382442
/* Enumerate the switch */

drivers/thunderbolt/tb_regs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ struct tb_regs_switch_header {
195195

196196
#define ROUTER_CS_1 0x01
197197
#define ROUTER_CS_4 0x04
198+
/* Used with the router cmuv field */
199+
#define ROUTER_CS_4_CMUV_V1 0x10
200+
#define ROUTER_CS_4_CMUV_V2 0x20
198201
#define ROUTER_CS_5 0x05
199202
#define ROUTER_CS_5_SLP BIT(0)
200203
#define ROUTER_CS_5_WOP BIT(1)

0 commit comments

Comments
 (0)