From e9e71132a308acbe5c6d5371fbe5f7d6ffe30cf4 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Fri, 12 Jul 2024 14:06:49 +0200 Subject: soc/amd/*/root_complex: introduce and use domain_iohc_info struct Instead of implementing the functions get_iohc_misc_smn_base and get_iohc_fabric_id in the SoC code, move those functions to the common AMD code, and implement get_iohc_info in the SoC code that returns a pointer to and the size of a SoC-specific array of domain_iohc_info structs that contains the info needed by the common code instead. This allows to iterate over the domain_iohc_info structs which will be used in a later patch to find the PSP MMIO base address in both ramstage and smm. TEST=Mandolin still boots and all non-PCI MIO resources are still reported to the resource allocator Signed-off-by: Felix Held Change-Id: Ifce3d2b540d14ba3cba36f7cbf248fb7c63483fe Reviewed-on: https://review.coreboot.org/c/coreboot/+/83443 Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier Reviewed-by: Varshit Pandya Reviewed-by: Martin Roth --- src/soc/amd/phoenix/root_complex.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/soc/amd/phoenix') diff --git a/src/soc/amd/phoenix/root_complex.c b/src/soc/amd/phoenix/root_complex.c index 918b7bd9bd..7fed3bdb31 100644 --- a/src/soc/amd/phoenix/root_complex.c +++ b/src/soc/amd/phoenix/root_complex.c @@ -105,9 +105,17 @@ struct device_operations phoenix_root_complex_operations = { .acpi_fill_ssdt = root_complex_fill_ssdt, }; -uint32_t get_iohc_misc_smn_base(struct device *domain) +static const struct domain_iohc_info iohc_info[] = { + [0] = { + .fabric_id = IOMS0_FABRIC_ID, + .misc_smn_base = SMN_IOHC_MISC_BASE_13B1, + }, +}; + +const struct domain_iohc_info *get_iohc_info(size_t *count) { - return SMN_IOHC_MISC_BASE_13B1; + *count = ARRAY_SIZE(iohc_info); + return iohc_info; } static const struct non_pci_mmio_reg non_pci_mmio[] = { @@ -132,13 +140,3 @@ const struct non_pci_mmio_reg *get_iohc_non_pci_mmio_regs(size_t *count) *count = ARRAY_SIZE(non_pci_mmio); return non_pci_mmio; } - -signed int get_iohc_fabric_id(struct device *domain) -{ - switch (domain->path.domain.domain) { - case 0: - return IOMS0_FABRIC_ID; - default: - return -1; - } -} -- cgit v1.2.3