summaryrefslogtreecommitdiff
path: root/src/soc/amd/mendocino/root_complex.c
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-08-11 22:24:00 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-08-15 14:42:47 +0000
commitb0ab545e7b2d920387fcc68a0c4a383a8b0dd915 (patch)
treee125177728aa6d7bedb58a2a10e0f2e142348101 /src/soc/amd/mendocino/root_complex.c
parent38c13b50d78a6be14689d78446562e67b6c7cd0f (diff)
soc/amd/*/root_complex: introduce get_iohc_fabric_id
Implement get_iohc_fabric_id for each SoC that translates the coreboot domain number to the fabric ID of the corresponding PCI root. This allows the primary domain to have the number 0 even though the destination data fabric ID will be non-zero. Keeping the primary domain number 0 allows to use config_of_soc() which can be resolved at link time and not need to dynamically find the SoC device to get the config. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I6538a777619eed974b449fc70d3fe3084ba447dd Reviewed-on: https://review.coreboot.org/c/coreboot/+/77168 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Diffstat (limited to 'src/soc/amd/mendocino/root_complex.c')
-rw-r--r--src/soc/amd/mendocino/root_complex.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/soc/amd/mendocino/root_complex.c b/src/soc/amd/mendocino/root_complex.c
index 0c95f7a86f..706cc2e75e 100644
--- a/src/soc/amd/mendocino/root_complex.c
+++ b/src/soc/amd/mendocino/root_complex.c
@@ -398,3 +398,13 @@ 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;
+ }
+}