Unverified Commit f10ea2df authored by Shyam Sundar S K's avatar Shyam Sundar S K Committed by Ilpo Järvinen
Browse files

platform/x86/amd/pmf: Add support for adjusting PMF PPT and PPT APU thresholds



The most recent PMF Trusted Application includes enhanced features that
allow for modifications to PMF thermal parameters such as PPT and PPT APU.

This update introduces the necessary driver support to utilize these
capabilities.

Co-developed-by: default avatarPatil Rajesh Reddy <Patil.Reddy@amd.com>
Signed-off-by: default avatarPatil Rajesh Reddy <Patil.Reddy@amd.com>
Tested-by: default avatarYijun Shen <Yijun.Shen@Dell.com>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarShyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://patch.msgid.link/20250901110140.2519072-2-Shyam-sundar.S-k@amd.com


Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
parent c4f8b11b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -93,6 +93,8 @@ struct cookie_header {
#define PMF_POLICY_BIOS_OUTPUT_1				10
#define PMF_POLICY_BIOS_OUTPUT_2				11
#define PMF_POLICY_P3T						38
#define PMF_POLICY_PMF_PPT					54
#define PMF_POLICY_PMF_PPT_APU_ONLY				55
#define PMF_POLICY_BIOS_OUTPUT_3				57
#define PMF_POLICY_BIOS_OUTPUT_4				58
#define PMF_POLICY_BIOS_OUTPUT_5				59
@@ -677,6 +679,8 @@ struct pmf_action_table {
	u32 stt_skintemp_apu;	/* in C */
	u32 stt_skintemp_hs2;	/* in C */
	u32 p3t_limit;		/* in mW */
	u32 pmf_ppt;		/* in mW */
	u32 pmf_ppt_apu_only;	/* in mW */
};

/* Input conditions */
+16 −0
Original line number Diff line number Diff line
@@ -147,6 +147,22 @@ static void amd_pmf_apply_policies(struct amd_pmf_dev *dev, struct ta_pmf_enact_
			}
			break;

		case PMF_POLICY_PMF_PPT:
			if (dev->prev_data->pmf_ppt != val) {
				amd_pmf_send_cmd(dev, SET_PMF_PPT, false, val, NULL);
				dev_dbg(dev->dev, "update PMF PPT: %u\n", val);
				dev->prev_data->pmf_ppt = val;
			}
			break;

		case PMF_POLICY_PMF_PPT_APU_ONLY:
			if (dev->prev_data->pmf_ppt_apu_only != val) {
				amd_pmf_send_cmd(dev, SET_PMF_PPT_APU_ONLY, false, val, NULL);
				dev_dbg(dev->dev, "update PMF PPT APU ONLY: %u\n", val);
				dev->prev_data->pmf_ppt_apu_only = val;
			}
			break;

		case PMF_POLICY_SYSTEM_STATE:
			switch (val) {
			case 0: