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>
This commit is contained in:
@@ -207,3 +207,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;
|
||||
}
|
||||
}
|
||||
|
@@ -22,6 +22,8 @@ void read_non_pci_resources(struct device *domain, unsigned int *idx);
|
||||
uint32_t get_iohc_misc_smn_base(struct device *domain);
|
||||
const struct non_pci_mmio_reg *get_iohc_non_pci_mmio_regs(size_t *count);
|
||||
|
||||
signed int get_iohc_fabric_id(struct device *domain);
|
||||
|
||||
void read_fsp_resources(struct device *dev, unsigned int *idx);
|
||||
|
||||
#endif /* AMD_BLOCK_ROOT_COMPLEX_H */
|
||||
|
@@ -240,3 +240,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;
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -240,3 +240,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;
|
||||
}
|
||||
}
|
||||
|
@@ -213,3 +213,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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user