Attention is currently required from: Maulik V Vaghela, Paul Menzel.

Maulik V Vaghela uploaded patch set #4 to this change.

View Change

drivers/intel/usb4/retimer: Update code to assign correct port number

Since TBT controller can have maximum 2 ports per controller, our
code will loop over DFP structure twice and determine port number.

Retimer driver used to assign port number as below:
1. Check if power GPIO is assigned for particular DFP entry or not
2. If entry is there, assign loop count as port number

Since loop count is 2, retimer will never assign port number = 2
even if it's present. In case of more than 1 controller, port number
assigned will still be 0 or 1 even though actual port index might
be 2 or 3. This will create an issue where even if you do transaction
on device on controller 2 (port index 2 or 3), EC will route it on
port 0 or 1 due to incorrect port index.

Update the driver flow as per below to handle this scenario:
1. Check if power GPIO is assigned for particular DFP entry or not
2. Get USB port number from config since it's stored in usb port
information under devicetree
3. Pass the port number to ACPI SSDT and EC code

Above changes will ensure that we're assigning correct port
number as per calculation and EC will use correct port index.

BUG=b:189476816
BRANCH=None
TEST=Checked that retimer firmware update works on both ports and update
happens on correct port index.

Change-Id: Ib11637ae39046e0afdacd33bc34e8a59e6f2bfb1
Signed-off-by: Maulik V Vaghela <maulik.v.vaghela@intel.com>
---
M src/drivers/intel/usb4/retimer/chip.h
M src/drivers/intel/usb4/retimer/retimer.c
2 files changed, 27 insertions(+), 14 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/55945/4

To view, visit change 55945. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib11637ae39046e0afdacd33bc34e8a59e6f2bfb1
Gerrit-Change-Number: 55945
Gerrit-PatchSet: 4
Gerrit-Owner: Maulik V Vaghela <maulik.v.vaghela@intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan@google.com>
Gerrit-Reviewer: John Zhao <john.zhao@intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak@chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Abhijeet Rao <abhijeet.rao@intel.corp-partner.google.com>
Gerrit-CC: Deepti Deshatty <deepti.deshatty@intel.com>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-CC: Subrata Banik <subrata.banik@intel.com>
Gerrit-Attention: Maulik V Vaghela <maulik.v.vaghela@intel.com>
Gerrit-Attention: Paul Menzel <paulepanter@mailbox.org>
Gerrit-MessageType: newpatchset