soc/intel/xeon_sp: Add utils to detect domain0 and stack0

In Xeon-SP, the domain0, which is located at stack0, usually needs
special handling due to the compatible devices on it (HEPT, IO-APIC
and legacy IOs). This patch adds util function detect whether a
give domain or stack is with such a role.

TEST=intel/archercity CRB

Change-Id: I2f26b4ac54091c24c554f17964502c364288aa40
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81199
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
This commit is contained in:
Shuo Liu
2024-03-12 00:34:47 +08:00
committed by Lean Sheng Tan
parent e0c935b0dc
commit 091fb05312
2 changed files with 6 additions and 1 deletions

View File

@@ -199,7 +199,7 @@ void iio_pci_domain_read_resources(struct device *dev)
int index = 0;
if (dev->path.domain.domain == 0) {
if (is_domain0(dev)) {
/* The 0 - 0xfff IO range is not reported by the HOB but still gets decoded */
res = new_resource(dev, index++);
res->base = 0;

View File

@@ -77,4 +77,9 @@ bool is_cxl_domain(struct device *dev);
#define is_dev_on_ubox_domain(dev) is_ubox_domain(dev_get_pci_domain(dev))
#define is_dev_on_cxl_domain(dev) is_cxl_domain(dev_get_pci_domain(dev))
#define is_domain0(dev) (dev && dev->path.type == DEVICE_PATH_DOMAIN &&\
dev->path.domain.domain == 0)
#define is_dev_on_domain0(dev) (is_domain0(dev_get_pci_domain(dev)))
#define is_stack0(socket, stack) (socket == 0 && stack == IioStack0)
#endif /* _CHIP_COMMON_H_ */