From 60875b47185696c292150058f095b195d7d6901c Mon Sep 17 00:00:00 2001 From: Jason Glenesk Date: Thu, 16 Mar 2023 15:28:10 -0700 Subject: soc/amd/mendocino: Consume fsp misc_data hob Provide support function to query fsp misc_data hob and return smu reported power and thermal limit. BUG=b:253301653 TEST=Use get_amd_smu_reported_tdp(&tdp) values match what FSP placed in the hob. Change-Id: I9f0d8cdd616726c5a714e99504b83b0126dd273b Signed-off-by: Jason Glenesk Reviewed-on: https://review.coreboot.org/c/coreboot/+/73747 Reviewed-by: Martin Roth Tested-by: build bot (Jenkins) --- src/soc/amd/mendocino/include/fsp/amd_misc_data.h | 10 ++++++++++ src/soc/amd/mendocino/include/fsp/amd_misc_data_hob.h | 14 ++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/soc/amd/mendocino/include/fsp/amd_misc_data.h create mode 100644 src/soc/amd/mendocino/include/fsp/amd_misc_data_hob.h (limited to 'src/soc/amd/mendocino/include') diff --git a/src/soc/amd/mendocino/include/fsp/amd_misc_data.h b/src/soc/amd/mendocino/include/fsp/amd_misc_data.h new file mode 100644 index 0000000000..df42d536a6 --- /dev/null +++ b/src/soc/amd/mendocino/include/fsp/amd_misc_data.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef AMD_MISC_DATA_H +#define AMD_MISC_DATA_H + +#include + +enum cb_err get_amd_smu_reported_tdp(uint32_t *tdp); + +#endif /* AMD_MISC_DATA_H */ diff --git a/src/soc/amd/mendocino/include/fsp/amd_misc_data_hob.h b/src/soc/amd/mendocino/include/fsp/amd_misc_data_hob.h new file mode 100644 index 0000000000..66b8bea4eb --- /dev/null +++ b/src/soc/amd/mendocino/include/fsp/amd_misc_data_hob.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef __AMD_MISC_DATA_HOB_H__ +#define __AMD_MISC_DATA_HOB_H__ + +#define AMD_MISC_DATA_VERSION 2 + +struct amd_misc_data { + uint8_t version; + uint8_t unused[3]; + uint32_t smu_power_and_thm_limit; +} __packed; + +#endif /* __AMD_MISC_DATA_HOB_H__ */ -- cgit v1.2.3