summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/amd/common/block/include/amdblocks/smn.h1
-rw-r--r--src/soc/amd/common/block/smn/smn.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/include/amdblocks/smn.h b/src/soc/amd/common/block/include/amdblocks/smn.h
index 962c8acd82..0268926bbe 100644
--- a/src/soc/amd/common/block/include/amdblocks/smn.h
+++ b/src/soc/amd/common/block/include/amdblocks/smn.h
@@ -6,6 +6,7 @@
#include <types.h>
uint32_t smn_read32(uint32_t reg);
+uint64_t smn_read64(uint32_t reg);
void smn_write32(uint32_t reg, uint32_t val);
#endif /* AMD_BLOCK_SMN_H */
diff --git a/src/soc/amd/common/block/smn/smn.c b/src/soc/amd/common/block/smn/smn.c
index 055f732cf7..caf6a41004 100644
--- a/src/soc/amd/common/block/smn/smn.c
+++ b/src/soc/amd/common/block/smn/smn.c
@@ -15,6 +15,11 @@ uint32_t smn_read32(uint32_t reg)
return pci_read_config32(SOC_GNB_DEV, SMN_DATA_ADDR);
}
+uint64_t smn_read64(uint32_t reg)
+{
+ return smn_read32(reg) | (uint64_t)smn_read32(reg + 4) << 32;
+}
+
void smn_write32(uint32_t reg, uint32_t val)
{
pci_write_config32(SOC_GNB_DEV, SMN_INDEX_ADDR, reg);