Shuo Liu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/81046?usp=email )
Change subject: soc/intel/xeon_sp: Add is_dev_on_pcie/ubox/ioat_domain ......................................................................
soc/intel/xeon_sp: Add is_dev_on_pcie/ubox/ioat_domain
Change-Id: I6b31c29564c774c27e86f55749ca9eca057a0cfe Signed-off-by: Shuo Liu shuo.liu@intel.com --- M src/soc/intel/xeon_sp/chip_common.c M src/soc/intel/xeon_sp/include/soc/chip_common.h 2 files changed, 52 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/81046/1
diff --git a/src/soc/intel/xeon_sp/chip_common.c b/src/soc/intel/xeon_sp/chip_common.c index 03ae70a..f89532d 100644 --- a/src/soc/intel/xeon_sp/chip_common.c +++ b/src/soc/intel/xeon_sp/chip_common.c @@ -268,3 +268,51 @@ } } } + +bool is_dev_on_pcie_domain(struct device *dev) +{ + struct device *domain; + domain = dev_get_pci_domain(dev); + + if ((!domain) || (!domain->name)) + return false; + + if (strstr(domain->name, DOMAIN_TYPE_PCIE)) + return true; + + return false; +} + +bool is_dev_on_ubox_domain(struct device *dev) +{ + struct device *domain; + domain = dev_get_pci_domain(dev); + + if ((!domain) || (!domain->name)) + return false; + + if (strstr(domain->name, DOMAIN_TYPE_UBX0) || + strstr(domain->name, DOMAIN_TYPE_UBX1)) + return true; + + return false; +} + +bool is_dev_on_ioat_domain(struct device *dev) +{ + struct device *domain; + domain = dev_get_pci_domain(dev); + + if ((!domain) || (!domain->name)) + return false; + + if (strstr(domain->name, DOMAIN_TYPE_CPM0) || + strstr(domain->name, DOMAIN_TYPE_CPM1) || + strstr(domain->name, DOMAIN_TYPE_DINO) || + strstr(domain->name, DOMAIN_TYPE_HQM0) || + strstr(domain->name, DOMAIN_TYPE_HQM1)) + return true; + + return false; +} + diff --git a/src/soc/intel/xeon_sp/include/soc/chip_common.h b/src/soc/intel/xeon_sp/include/soc/chip_common.h index 03bceb5..683df03 100644 --- a/src/soc/intel/xeon_sp/include/soc/chip_common.h +++ b/src/soc/intel/xeon_sp/include/soc/chip_common.h @@ -40,4 +40,8 @@ int iio_pci_domain_socket_from_dev(struct device *dev); int iio_pci_domain_stack_from_dev(struct device *dev);
+bool is_dev_on_pcie_domain(struct device *dev); +bool is_dev_on_ioat_domain(struct device *dev); +bool is_dev_on_ubox_domain(struct device *dev); + #endif /* _CHIP_COMMON_H_ */