Commit 9d20f37a authored by Jesse.Zhang's avatar Jesse.Zhang Committed by Alex Deucher
Browse files

drm/amd/pm: Add VCN reset support for SMU v13.0.6



This commit implements VCN reset capability for SMU v13.0.6 with the following changes:

1. Added new PPSMC message ID (0x5B) for VCN reset in SMU firmware interface
2. Extended SMU capabilities to include VCN_RESET support
3. Implemented VCN reset support check:
   - Added smu_v13_0_6_reset_vcn_is_supported() function
4. Updated SMU v13.0.6 PPT functions to include VCN reset operations

v2: clean up debug info (Alex)
v3: remove unsupported message and split smu v13.0.6 changes to a separate patch (Lijo)
v4: simply the function (smu_v13_0_6_reset_vcn_is_supported) (Lijo)

Suggested-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarRuili Ji <ruiliji2@amd.com>
Signed-off-by: default avatarJesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 37b9257b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -94,9 +94,9 @@
#define PPSMC_MSG_RmaDueToBadPageThreshold          0x43
#define PPSMC_MSG_SetThrottlingPolicy               0x44
#define PPSMC_MSG_ResetSDMA                         0x4D
#define PPSMC_MSG_ResetVCN                          0x4E
#define PPSMC_MSG_GetStaticMetricsTable             0x59
#define PPSMC_Message_Count                         0x5A
#define PPSMC_MSG_ResetVCN                          0x5B
#define PPSMC_Message_Count                         0x5C

//PPSMC Reset Types for driver msg argument
#define PPSMC_RESET_TYPE_DRIVER_MODE_1_RESET        0x1
+9 −0
Original line number Diff line number Diff line
@@ -436,6 +436,9 @@ static void smu_v13_0_6_init_caps(struct smu_context *smu)
	    ((pgm == 0) && (fw_ver >= 0x00557900)) ||
	    ((pgm == 4) && (fw_ver >= 0x4557000)))
		smu_v13_0_6_cap_set(smu, SMU_CAP(SDMA_RESET));

	if ((pgm == 4) && (fw_ver >= 0x04557100))
		smu_v13_0_6_cap_set(smu, SMU_CAP(VCN_RESET));
}

static void smu_v13_0_x_init_caps(struct smu_context *smu)
@@ -3200,6 +3203,11 @@ static int smu_v13_0_6_reset_sdma(struct smu_context *smu, uint32_t inst_mask)
	return ret;
}

static bool smu_v13_0_6_reset_vcn_is_supported(struct smu_context *smu)
{
	return smu_v13_0_6_cap_supported(smu, SMU_CAP(VCN_RESET));
}

static int smu_v13_0_6_reset_vcn(struct smu_context *smu, uint32_t inst_mask)
{
	int ret = 0;
@@ -3888,6 +3896,7 @@ static const struct pptable_funcs smu_v13_0_6_ppt_funcs = {
	.reset_sdma = smu_v13_0_6_reset_sdma,
	.reset_sdma_is_supported = smu_v13_0_6_reset_sdma_is_supported,
	.dpm_reset_vcn = smu_v13_0_6_reset_vcn,
	.reset_vcn_is_supported = smu_v13_0_6_reset_vcn_is_supported,
};

void smu_v13_0_6_set_ppt_funcs(struct smu_context *smu)
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ enum smu_v13_0_6_caps {
	SMU_CAP(RMA_MSG),
	SMU_CAP(ACA_SYND),
	SMU_CAP(SDMA_RESET),
	SMU_CAP(VCN_RESET),
	SMU_CAP(STATIC_METRICS),
	SMU_CAP(HST_LIMIT_METRICS),
	SMU_CAP(BOARD_VOLTAGE),