Attention is currently required from: Jason Glenesk, Raul Rangel, Marshall Dawson. Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/50620 )
Change subject: soc/amd/common/block/data_fabric: add data_fabric_write32 ......................................................................
soc/amd/common/block/data_fabric: add data_fabric_write32
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I9c1ae03e9aec1dec45333e697060308cb6cbda4b --- M src/soc/amd/common/block/data_fabric/data_fabric_helper.c M src/soc/amd/common/block/include/amdblocks/data_fabric.h 2 files changed, 12 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/50620/1
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 d97cf52..abd12ed 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 @@ -28,3 +28,14 @@ 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); + + /* 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 606d564..3695c4a 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 */