diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2023-08-04 19:22:54 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-08-08 19:43:26 +0000 |
commit | 2dfd48b26de8e61501cc81ad528997b2efa50369 (patch) | |
tree | e6c8d0cb45f6de934a39474756f380e5529e0651 /src/soc | |
parent | 84a60fbb1bdd17b3ca51532f5991fb78ad0f8635 (diff) |
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>
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/amd/common/block/data_fabric/domain.c | 17 |
1 files 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 } } -/* Tell the resource allocator about the usable I/O space */ -static void add_io_regions(struct device *domain, unsigned int *idx) +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) +{ /* 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) |