thunderbolt: Perform USB4 router NVM upgrade in two phases
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 10 Nov 2020 08:34:07 +0000 (11:34 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 30 Nov 2020 11:39:24 +0000 (14:39 +0300)
commit661b19473bf3ac0924560f0cbf84c15458b3c8de
tree32a36bb669b6a4bc3536f3386107a2853a01ec6e
parent463e48fa544826898791085508459de246fc4c09
thunderbolt: Perform USB4 router NVM upgrade in two phases

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 <mika.westerberg@linux.intel.com>
drivers/thunderbolt/switch.c
drivers/thunderbolt/tb.h
drivers/thunderbolt/tb_regs.h
drivers/thunderbolt/usb4.c