device/device_util: Add and use is_pci_bridge()

TEST=Build and boot on intel/archercity CRB

Change-Id: Ied4921f7dc7e144e580d05d4f2262777aa59d895
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81566
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Shuo Liu 2024-03-30 00:37:55 +08:00 committed by Lean Sheng Tan
commit 0f3316bc71
3 changed files with 8 additions and 2 deletions

View file

@ -930,3 +930,8 @@ bool is_pci_dev_on_bus(const struct device *pci, unsigned int bus)
return is_pci(pci) && pci->upstream->segment_group == 0
&& pci->upstream->secondary == bus;
}
bool is_pci_bridge(const struct device *pci)
{
return is_pci(pci) && ((pci->hdr_type & 0x7f) == PCI_HEADER_TYPE_BRIDGE);
}