vega10_powertune.h revision 1.1
118334Speter/*
218334Speter * Copyright 2016 Advanced Micro Devices, Inc.
318334Speter *
418334Speter * Permission is hereby granted, free of charge, to any person obtaining a
518334Speter * copy of this software and associated documentation files (the "Software"),
618334Speter * to deal in the Software without restriction, including without limitation
718334Speter * the rights to use, copy, modify, merge, publish, distribute, sublicense,
818334Speter * and/or sell copies of the Software, and to permit persons to whom the
918334Speter * Software is furnished to do so, subject to the following conditions:
1018334Speter *
1118334Speter * The above copyright notice and this permission notice shall be included in
1218334Speter * all copies or substantial portions of the Software.
1318334Speter *
1418334Speter * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1518334Speter * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1618334Speter * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1718334Speter * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
1818334Speter * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1918334Speter * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2018334Speter * OTHER DEALINGS IN THE SOFTWARE.
2118334Speter *
2218334Speter */
2318334Speter#ifndef _VEGA10_POWERTUNE_H_
2418334Speter#define _VEGA10_POWERTUNE_H_
2518334Speter
2618334Speterenum vega10_pt_config_reg_type {
2718334Speter	VEGA10_CONFIGREG_MMR = 0,
2818334Speter	VEGA10_CONFIGREG_SMC_IND,
2918334Speter	VEGA10_CONFIGREG_DIDT_IND,
3018334Speter	VEGA10_CONFIGREG_CACHE,
3118334Speter	VEGA10_CONFIGREG_MAX
3218334Speter};
3318334Speter
3418334Speterenum vega10_didt_config_reg_type {
3518334Speter	VEGA10_CONFIGREG_DIDT = 0,
3618334Speter	VEGA10_CONFIGREG_GCCAC,
3718334Speter	VEGA10_CONFIGREG_SECAC
3818334Speter};
3918334Speter
4018334Speter/* PowerContainment Features */
4118334Speter#define POWERCONTAINMENT_FEATURE_DTE             0x00000001
4218334Speter#define POWERCONTAINMENT_FEATURE_TDCLimit        0x00000002
4318334Speter#define POWERCONTAINMENT_FEATURE_PkgPwrLimit     0x00000004
4418334Speter
4518334Speterstruct vega10_pt_config_reg {
4618334Speter	uint32_t                           offset;
4718334Speter	uint32_t                           mask;
4818334Speter	uint32_t                           shift;
4918334Speter	uint32_t                           value;
5018334Speter	enum vega10_pt_config_reg_type       type;
5118334Speter};
52
53struct vega10_didt_config_reg {
54	uint32_t		offset;
55	uint32_t		mask;
56	uint32_t		shift;
57	uint32_t		value;
58};
59
60struct vega10_pt_defaults {
61    uint8_t   SviLoadLineEn;
62    uint8_t   SviLoadLineVddC;
63    uint8_t   TDC_VDDC_ThrottleReleaseLimitPerc;
64    uint8_t   TDC_MAWt;
65    uint8_t   TdcWaterfallCtl;
66    uint8_t   DTEAmbientTempBase;
67};
68
69void vega10_initialize_power_tune_defaults(struct pp_hwmgr *hwmgr);
70int vega10_populate_bapm_parameters_in_dpm_table(struct pp_hwmgr *hwmgr);
71int vega10_populate_pm_fuses(struct pp_hwmgr *hwmgr);
72int vega10_enable_smc_cac(struct pp_hwmgr *hwmgr);
73int vega10_enable_power_containment(struct pp_hwmgr *hwmgr);
74int vega10_set_power_limit(struct pp_hwmgr *hwmgr, uint32_t n);
75int vega10_power_control_set_level(struct pp_hwmgr *hwmgr);
76int vega10_disable_power_containment(struct pp_hwmgr *hwmgr);
77
78int vega10_enable_didt_config(struct pp_hwmgr *hwmgr);
79int vega10_disable_didt_config(struct pp_hwmgr *hwmgr);
80
81#endif  /* _VEGA10_POWERTUNE_H_ */
82
83