From 2dfd48b26de8e61501cc81ad528997b2efa50369 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Fri, 4 Aug 2023 19:22:54 +0200 Subject: [PATCH] soc/amd/common/data_fabric/domain: factor out report_data_fabric_io As a preparation to read the IO decode ranges from the data fabric registers instead of having it hard-coded, factor out the report_data_fabric_io function to report one IO producer region from add_io_regions. Signed-off-by: Felix Held Change-Id: I51c3f8cd6749623f1a4bad14873d53b8a52be737 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76933 Reviewed-by: Fred Reitberger Reviewed-by: Martin Roth Tested-by: build bot (Jenkins) --- src/soc/amd/common/block/data_fabric/domain.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/soc/amd/common/block/data_fabric/domain.c b/src/soc/amd/common/block/data_fabric/domain.c index 9f0f48c325..66ad8b3848 100644 --- a/src/soc/amd/common/block/data_fabric/domain.c +++ b/src/soc/amd/common/block/data_fabric/domain.c @@ -139,18 +139,23 @@ static void add_data_fabric_mmio_regions(struct device *domain, unsigned int *id } } +static void report_data_fabric_io(struct device *domain, unsigned int idx, + resource_t io_base, resource_t io_limit) +{ + struct resource *res; + res = new_resource(domain, idx); + res->base = io_base; + res->limit = io_limit; + res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED; +} + /* Tell the resource allocator about the usable I/O space */ static void add_io_regions(struct device *domain, unsigned int *idx) { - struct resource *res; - /* TODO: Systems with more than one PCI root need to read the data fabric registers to see which IO ranges get decoded to which PCI root. */ - res = new_resource(domain, (*idx)++); - res->base = 0; - res->limit = 0xffff; - res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED; + report_data_fabric_io(domain, (*idx)++, 0, 0xffff); } void amd_pci_domain_read_resources(struct device *domain)