summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/common/block/data_fabric/data_fabric_helper.c13
-rw-r--r--src/soc/amd/common/block/include/amdblocks/data_fabric.h1
2 files changed, 14 insertions, 0 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 e8e02d8eb1..d0827e6d36 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
@@ -29,3 +29,16 @@ uint32_t data_fabric_read32(uint8_t function, uint16_t reg, uint8_t instance_id)
data_fabric_set_indirect_address(function, reg, instance_id);
return pci_read_config32(SOC_DF_F4_DEV, DF_FICAD_LO);
}
+
+void data_fabric_write32(uint8_t function, uint16_t reg, uint8_t instance_id, uint32_t data)
+{
+ if (instance_id == BROADCAST_FABRIC_ID) {
+ /* No bit masking required. Macros will apply mask to values. */
+ pci_write_config32(_SOC_DEV(DF_DEV, function), reg, data);
+ return;
+ }
+
+ /* non-broadcast data fabric accesses need to be done via indirect access */
+ data_fabric_set_indirect_address(function, reg, instance_id);
+ pci_write_config32(SOC_DF_F4_DEV, DF_FICAD_LO, data);
+}
diff --git a/src/soc/amd/common/block/include/amdblocks/data_fabric.h b/src/soc/amd/common/block/include/amdblocks/data_fabric.h
index 606d56419f..3695c4a0c7 100644
--- a/src/soc/amd/common/block/include/amdblocks/data_fabric.h
+++ b/src/soc/amd/common/block/include/amdblocks/data_fabric.h
@@ -8,5 +8,6 @@
#define BROADCAST_FABRIC_ID 0xff
uint32_t data_fabric_read32(uint8_t function, uint16_t reg, uint8_t instance_id);
+void data_fabric_write32(uint8_t function, uint16_t reg, uint8_t instance_id, uint32_t data);
#endif /* AMD_BLOCK_DATA_FABRIC_H */