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 <felix-coreboot@felixheld.de>
Change-Id: I51c3f8cd6749623f1a4bad14873d53b8a52be737
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76933
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Felix Held 2023-08-04 19:22:54 +02:00
parent 84a60fbb1b
commit 2dfd48b26d
1 changed files with 11 additions and 6 deletions

View File

@ -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)