summaryrefslogtreecommitdiff
path: root/src/soc/amd/common/block/include
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-02-13 01:09:28 +0100
committerFelix Held <felix-coreboot@felixheld.de>2021-02-14 20:52:53 +0000
commit789f6f7c35a3eff5d112ae2afce7f6c8e2b2c000 (patch)
tree3b46b18274d5c20944a1012ecae432af46e26c6d /src/soc/amd/common/block/include
parent45df9c1b911e2fcd5857954c10c68cf9b7ab0beb (diff)
soc/amd/common/block/data_fabric: add data_fabric_broadcast_read/write32
Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I81e7ff293865ef22ed74606e1e79f67a460de4a7 Reviewed-on: https://review.coreboot.org/c/coreboot/+/50621 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/amd/common/block/include')
-rw-r--r--src/soc/amd/common/block/include/amdblocks/data_fabric.h17
1 files changed, 17 insertions, 0 deletions
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 3695c4a0c7..386be7a40b 100644
--- a/src/soc/amd/common/block/include/amdblocks/data_fabric.h
+++ b/src/soc/amd/common/block/include/amdblocks/data_fabric.h
@@ -3,6 +3,9 @@
#ifndef AMD_BLOCK_DATA_FABRIC_H
#define AMD_BLOCK_DATA_FABRIC_H
+#include <amdblocks/pci_devs.h>
+#include <device/pci_ops.h>
+#include <soc/pci_devs.h>
#include <stdint.h>
#define BROADCAST_FABRIC_ID 0xff
@@ -10,4 +13,18 @@
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);
+static __always_inline
+uint32_t data_fabric_broadcast_read32(uint8_t function, uint16_t reg)
+{
+ /* No bit masking required. Macros will apply mask to values. */
+ return pci_read_config32(_SOC_DEV(DF_DEV, function), reg);
+}
+
+static __always_inline
+void data_fabric_broadcast_write32(uint8_t function, uint16_t reg, uint32_t data)
+{
+ /* No bit masking required. Macros will apply mask to values. */
+ pci_write_config32(_SOC_DEV(DF_DEV, function), reg, data);
+}
+
#endif /* AMD_BLOCK_DATA_FABRIC_H */