From e995684fa1212784bb2642ad21e4e0ce60b19130 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Wed, 10 Mar 2021 22:55:22 +0100 Subject: soc/amd/common: factor out SMN access function from SMU code The SMU mailbox interface gets accessed over the SMN register space, so factor out those access functions into a separate common code SMN access building block. Signed-off-by: Felix Held Change-Id: Iabac181972c02ae641da99f47b2aa9aa28dae333 Reviewed-on: https://review.coreboot.org/c/coreboot/+/51399 Tested-by: build bot (Jenkins) Reviewed-by: Marshall Dawson --- src/soc/amd/common/block/include/amdblocks/smn.h | 11 +++++++++++ src/soc/amd/common/block/include/amdblocks/smu.h | 4 ---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 src/soc/amd/common/block/include/amdblocks/smn.h (limited to 'src/soc/amd/common/block/include/amdblocks') diff --git a/src/soc/amd/common/block/include/amdblocks/smn.h b/src/soc/amd/common/block/include/amdblocks/smn.h new file mode 100644 index 0000000000..962c8acd82 --- /dev/null +++ b/src/soc/amd/common/block/include/amdblocks/smn.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef AMD_BLOCK_SMN_H +#define AMD_BLOCK_SMN_H + +#include + +uint32_t smn_read32(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/include/amdblocks/smu.h b/src/soc/amd/common/block/include/amdblocks/smu.h index ca5e37a7ee..eeca3c6e7f 100644 --- a/src/soc/amd/common/block/include/amdblocks/smu.h +++ b/src/soc/amd/common/block/include/amdblocks/smu.h @@ -6,10 +6,6 @@ #include #include /* SoC-dependent definitions for SMU access */ -/* SMU registers accessed indirectly using an index/data pair in D0F00 config space */ -#define SMU_INDEX_ADDR 0xb8 /* 32 bit */ -#define SMU_DATA_ADDR 0xbc /* 32 bit */ - /* Arguments indexed locations are contiguous; the number is SoC-dependent */ #define REG_ADDR_MESG_ARG(x) (REG_ADDR_MESG_ARGS_BASE + ((x) * sizeof(uint32_t))) -- cgit v1.2.3