Commit 7b8081ea authored by Lijo Lazar's avatar Lijo Lazar Committed by Alex Deucher

drm/amd/pm: Add PMFW message and capability flags

Add flags to categorize messages and PMFW capabilities.
Signed-off-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: default avatarAsad Kamal <asad.kamal@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b41f742d
...@@ -459,7 +459,7 @@ struct smu_umd_pstate_table { ...@@ -459,7 +459,7 @@ struct smu_umd_pstate_table {
struct cmn2asic_msg_mapping { struct cmn2asic_msg_mapping {
int valid_mapping; int valid_mapping;
int map_to; int map_to;
int valid_in_vf; uint32_t flags;
}; };
struct cmn2asic_mapping { struct cmn2asic_mapping {
...@@ -539,6 +539,7 @@ struct smu_context { ...@@ -539,6 +539,7 @@ struct smu_context {
uint32_t smc_driver_if_version; uint32_t smc_driver_if_version;
uint32_t smc_fw_if_version; uint32_t smc_fw_if_version;
uint32_t smc_fw_version; uint32_t smc_fw_version;
uint32_t smc_fw_caps;
bool uploading_custom_pp_table; bool uploading_custom_pp_table;
bool dc_controlled_by_gpio; bool dc_controlled_by_gpio;
...@@ -1485,8 +1486,8 @@ enum smu_baco_seq { ...@@ -1485,8 +1486,8 @@ enum smu_baco_seq {
BACO_SEQ_COUNT, BACO_SEQ_COUNT,
}; };
#define MSG_MAP(msg, index, valid_in_vf) \ #define MSG_MAP(msg, index, flags) \
[SMU_MSG_##msg] = {1, (index), (valid_in_vf)} [SMU_MSG_##msg] = {1, (index), (flags)}
#define CLK_MAP(clk, index) \ #define CLK_MAP(clk, index) \
[SMU_##clk] = {1, (index)} [SMU_##clk] = {1, (index)}
......
...@@ -445,4 +445,11 @@ enum smu_feature_mask { ...@@ -445,4 +445,11 @@ enum smu_feature_mask {
SMU_FEATURE_COUNT, SMU_FEATURE_COUNT,
}; };
/* Message category flags */
#define SMU_MSG_VF_FLAG (1U << 0)
#define SMU_MSG_RAS_PRI (1U << 1)
/* Firmware capability flags */
#define SMU_FW_CAP_RAS_PRI (1U << 0)
#endif #endif
...@@ -437,7 +437,7 @@ int smu_cmn_to_asic_specific_index(struct smu_context *smu, ...@@ -437,7 +437,7 @@ int smu_cmn_to_asic_specific_index(struct smu_context *smu,
return -EINVAL; return -EINVAL;
if (amdgpu_sriov_vf(smu->adev) && if (amdgpu_sriov_vf(smu->adev) &&
!msg_mapping.valid_in_vf) !(msg_mapping.flags & SMU_MSG_VF_FLAG))
return -EACCES; return -EACCES;
return msg_mapping.map_to; return msg_mapping.map_to;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment