From 6c708d8a467e7027cd841896b8f5cbc8555fb254 Mon Sep 17 00:00:00 2001 From: Shuo Liu Date: Mon, 29 Apr 2024 18:16:30 +0800 Subject: soc/intel/xeon_sp: Add domain resource window creation utils It might be benefical to have utils for domain resource window creation so that the correct IORESOURCE flags used could be guaranteed. TEST=Build and boot on intel/archercity CRB TEST=Build on intel/avenuecity CRB Change-Id: I1e90512a48ab002a1c1d5031585ddadaac63673e Signed-off-by: Shuo Liu Reviewed-on: https://review.coreboot.org/c/coreboot/+/82103 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans --- src/device/device_util.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/device/device_util.c') diff --git a/src/device/device_util.c b/src/device/device_util.c index d91df76cee..5d620202ea 100644 --- a/src/device/device_util.c +++ b/src/device/device_util.c @@ -776,7 +776,7 @@ void show_all_devs_resources(int debug_level, const char *msg) } } -const struct resource *fixed_resource_range_idx(struct device *dev, unsigned long index, +const struct resource *resource_range_idx(struct device *dev, unsigned long index, uint64_t base, uint64_t size, unsigned long flags) { struct resource *resource; @@ -785,8 +785,13 @@ const struct resource *fixed_resource_range_idx(struct device *dev, unsigned lon resource = new_resource(dev, index); resource->base = base; - resource->size = size; - resource->flags = IORESOURCE_FIXED | IORESOURCE_ASSIGNED; + + if (flags & IORESOURCE_FIXED) + resource->size = size; + if (flags & IORESOURCE_BRIDGE) + resource->limit = base + size - 1; + + resource->flags = IORESOURCE_ASSIGNED; resource->flags |= flags; printk(BIOS_SPEW, "dev: %s, index: 0x%lx, base: 0x%llx, size: 0x%llx\n", -- cgit v1.2.3