aboutsummaryrefslogtreecommitdiff
path: root/src/device/device_util.c
diff options
context:
space:
mode:
authorShuo Liu <shuo.liu@intel.com>2024-04-29 18:16:30 +0800
committerLean Sheng Tan <sheng.tan@9elements.com>2024-05-28 09:45:35 +0000
commit6c708d8a467e7027cd841896b8f5cbc8555fb254 (patch)
treef7bf2633ce752731d385bd69bc55e25ca5a5ee33 /src/device/device_util.c
parent94bfdd12821d0473e8bac1920342b0271a3771d5 (diff)
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 <shuo.liu@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/82103 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/device/device_util.c')
-rw-r--r--src/device/device_util.c11
1 files changed, 8 insertions, 3 deletions
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",