summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-08-03 00:20:55 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-08-08 19:41:30 +0000
commit4078d14a7eb0ccd83ed576e0b4b11e0af5893671 (patch)
tree5a1338be42e8d2481782965ce0e44ff4ad902ff5
parent18a3c230ff4ab06dda46ebac9902d198721909d9 (diff)
soc/amd/common/data_fabric_helper: use DF broadcast read/write functions
Instead of open coding the broadcast data fabric PCI register access in the functions for indirect non-broadcast data fabric register access, just use the existing data_fabric_broadcast_[read,write]32 functions. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I174c1e6ee4856d97c5ec6d07bb8c217d6df9425f Reviewed-on: https://review.coreboot.org/c/coreboot/+/76887 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
-rw-r--r--src/soc/amd/common/block/data_fabric/data_fabric_helper.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/soc/amd/common/block/data_fabric/data_fabric_helper.c b/src/soc/amd/common/block/data_fabric/data_fabric_helper.c
index acfbf6c78d..812e0d442c 100644
--- a/src/soc/amd/common/block/data_fabric/data_fabric_helper.c
+++ b/src/soc/amd/common/block/data_fabric/data_fabric_helper.c
@@ -18,8 +18,7 @@ static void data_fabric_set_indirect_address(uint16_t fn_reg, uint8_t instance_i
ficaa.reg_num = DF_REG_OFFSET(fn_reg) >> 2;
ficaa.func_num = DF_REG_FN(fn_reg);
ficaa.inst_id = instance_id;
- pci_write_config32(_SOC_DEV(DF_DEV, DF_REG_FN(DF_FICAA_BIOS)),
- DF_REG_OFFSET(DF_FICAA_BIOS), ficaa.raw);
+ data_fabric_broadcast_write32(DF_FICAA_BIOS, ficaa.raw);
}
uint32_t data_fabric_read32(uint16_t fn_reg, uint8_t instance_id)
@@ -31,8 +30,7 @@ uint32_t data_fabric_read32(uint16_t fn_reg, uint8_t instance_id)
/* non-broadcast data fabric accesses need to be done via indirect access */
data_fabric_set_indirect_address(fn_reg, instance_id);
- return pci_read_config32(_SOC_DEV(DF_DEV, DF_REG_FN(DF_FICAD_LO)),
- DF_REG_OFFSET(DF_FICAD_LO));
+ return data_fabric_broadcast_read32(DF_FICAD_LO);
}
void data_fabric_write32(uint16_t fn_reg, uint8_t instance_id, uint32_t data)
@@ -44,8 +42,7 @@ void data_fabric_write32(uint16_t fn_reg, uint8_t instance_id, uint32_t data)
/* non-broadcast data fabric accesses need to be done via indirect access */
data_fabric_set_indirect_address(fn_reg, instance_id);
- pci_write_config32(_SOC_DEV(DF_DEV, DF_REG_FN(DF_FICAD_LO)),
- DF_REG_OFFSET(DF_FICAD_LO), data);
+ data_fabric_broadcast_write32(DF_FICAD_LO, data);
}
void data_fabric_print_mmio_conf(void)