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>
diff --git a/src/soc/intel/xeon_sp/spr/ioat.c b/src/soc/intel/xeon_sp/spr/ioat.c
index 9ed9576..a0babee 100644
--- a/src/soc/intel/xeon_sp/spr/ioat.c
+++ b/src/soc/intel/xeon_sp/spr/ioat.c
@@ -61,21 +61,11 @@
unsigned int index = 0;
- if (mem32_base <= mem32_limit) {
- struct resource *const res = new_resource(domain, index++);
- res->base = mem32_base;
- res->limit = mem32_limit;
- res->size = res->limit - res->base + 1;
- res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED;
- }
+ if (mem32_base <= mem32_limit)
+ domain_mem_window_from_to(domain, index++, mem32_base, mem32_limit + 1);
- if (mem64_base <= mem64_limit) {
- struct resource *const res = new_resource(domain, index++);
- res->base = mem64_base;
- res->limit = mem64_limit;
- res->size = res->limit - res->base + 1;
- res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED;
- }
+ if (mem64_base <= mem64_limit)
+ domain_mem_window_from_to(domain, index++, mem64_base, mem64_limit + 1);
}
void create_ioat_domains(const union xeon_domain_path path,