From 0f3316bc71aab50dbd8464ee2fb5b680947f2ca5 Mon Sep 17 00:00:00 2001 From: Shuo Liu Date: Sat, 30 Mar 2024 00:37:55 +0800 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/81566 Reviewed-by: Lean Sheng Tan Tested-by: build bot (Jenkins) --- src/device/device_util.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/device') diff --git a/src/device/device_util.c b/src/device/device_util.c index 7dcf081820..d91df76cee 100644 --- a/src/device/device_util.c +++ b/src/device/device_util.c @@ -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); +} -- cgit v1.2.3