drivers/intel/dtbt: Skip mailbox commands on downstream bridges

Downstream bridges share the same PCI device ID as the upstream
bridge but have no firmware mailbox. Sending commands to them
causes timeouts. Add a forward declaration of dtbt_device_ops
to detect and skip bridges whose parent is also a dTBT device.

Tested on thinkpad t480: The 5s timeout is now gone.

Change-Id: I96febb0e52e0ffbe52a237212b8f708a7b05c6d7
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91689
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Arthur Heymans 2026-03-16 20:53:33 +01:00 committed by Matt DeVillier
commit 674000732d

View file

@ -11,6 +11,7 @@
#include "chip.h"
#include "dtbt.h"
static struct device_operations dtbt_device_ops;
/* Returns true on success, false on timeout or TBT2PCIE Error field non-zero */
static bool dtbt_cmd(struct device *dev, u8 command, u32 data, u32 timeout)
@ -183,6 +184,16 @@ static void dtbt_enable(struct device *dev)
if (!is_dev_enabled(dev) || dev->path.pci.devfn != 0)
return;
/*
* Only the upstream bridge has the firmware mailbox (PCIE2TBT/TBT2PCIE
* registers). Downstream bridges behind it share the same PCI device ID
* but have no mailbox, so sending commands to them will timeout. Skip any
* bridge whose parent is also a dTBT bridge (i.e. a downstream bridge).
*/
if (dev->upstream && dev->upstream->dev &&
dev->upstream->dev->ops == &dtbt_device_ops)
return;
printk(BIOS_INFO, "dTBT controller found at %s\n", dev_path(dev));
/* Set security level (Table 37/428); failure aborts enable */