Commit 511a9555 authored by Lijo Lazar's avatar Lijo Lazar Committed by Alex Deucher
Browse files

drm/amd/pm: Add SMU 13.0.6 support



Add initial SMU 13.0.6 implementation.

v1:
Initial implementation to support SMU 13.0.6.
v2:
Add driver interface version check.
v3: rebase (Alex)
v4: Enable i2c for avoid warning (Alex)
v5: sqaush in cleanups up through (Alex)
    "drm/amd/pm: Ignore EIO error on SMUv13.0.6"

Signed-off-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a2c5dd9e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#include "smu_v13_0_0_ppt.h"
#include "smu_v13_0_4_ppt.h"
#include "smu_v13_0_5_ppt.h"
#include "smu_v13_0_6_ppt.h"
#include "smu_v13_0_7_ppt.h"
#include "amd_pcie.h"

@@ -609,6 +610,11 @@ static int smu_set_funcs(struct amdgpu_device *adev)
	case IP_VERSION(13, 0, 10):
		smu_v13_0_0_set_ppt_funcs(smu);
		break;
	case IP_VERSION(13, 0, 6):
		smu_v13_0_6_set_ppt_funcs(smu);
		/* Enable pp_od_clk_voltage node */
		smu->od_enabled = true;
		break;
	case IP_VERSION(13, 0, 7):
		smu_v13_0_7_set_ppt_funcs(smu);
		break;
+3 −1
Original line number Diff line number Diff line
@@ -243,7 +243,9 @@
	__SMU_DUMMY_MAP(SetNumBadMemoryPagesRetired),		\
	__SMU_DUMMY_MAP(SetBadMemoryPagesRetiredFlagsPerChannel), \
	__SMU_DUMMY_MAP(AllowGpo),	\
	__SMU_DUMMY_MAP(Mode2Reset),
	__SMU_DUMMY_MAP(Mode2Reset),	\
	__SMU_DUMMY_MAP(RequestI2cTransaction), \
	__SMU_DUMMY_MAP(GetMetricsTable),

#undef __SMU_DUMMY_MAP
#define __SMU_DUMMY_MAP(type)	SMU_MSG_##type
+5 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_0_10 0x32
#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_7 0x37
#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_10 0x1D
#define SMU13_DRIVER_IF_VERSION_SMU_V13_0_6 0x0

#define SMU13_MODE1_RESET_WAIT_TIME_IN_MS 500  //500ms

@@ -244,6 +245,10 @@ int smu_v13_0_set_single_dpm_table(struct smu_context *smu,
				   enum smu_clk_type clk_type,
				   struct smu_13_0_dpm_table *single_dpm_table);

int smu_v13_0_get_dpm_freq_by_index(struct smu_context *smu,
				    enum smu_clk_type clk_type, uint16_t level,
				    uint32_t *value);

int smu_v13_0_get_current_pcie_link_width_level(struct smu_context *smu);

int smu_v13_0_get_current_pcie_link_width(struct smu_context *smu);
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@
# It provides the smu management services for the driver.

SMU13_MGR = smu_v13_0.o aldebaran_ppt.o yellow_carp_ppt.o smu_v13_0_0_ppt.o smu_v13_0_4_ppt.o \
	    smu_v13_0_5_ppt.o smu_v13_0_7_ppt.o
	    smu_v13_0_5_ppt.o smu_v13_0_7_ppt.o smu_v13_0_6_ppt.o

AMD_SWSMU_SMU13MGR = $(addprefix $(AMD_SWSMU_PATH)/smu13/,$(SMU13_MGR))

+7 −4
Original line number Diff line number Diff line
@@ -294,6 +294,10 @@ int smu_v13_0_check_fw_version(struct smu_context *smu)
	case IP_VERSION(13, 0, 5):
		smu->smc_driver_if_version = SMU13_DRIVER_IF_VERSION_SMU_V13_0_5;
		break;
	case IP_VERSION(13, 0, 6):
		smu->smc_driver_if_version = SMU13_DRIVER_IF_VERSION_SMU_V13_0_6;
		adev->pm.fw_version = smu_version;
		break;
	default:
		dev_err(adev->dev, "smu unsupported IP version: 0x%x.\n",
			adev->ip_versions[MP1_HWIP][0]);
@@ -1914,9 +1918,8 @@ int smu_v13_0_set_power_source(struct smu_context *smu,
					       NULL);
}

static int smu_v13_0_get_dpm_freq_by_index(struct smu_context *smu,
					   enum smu_clk_type clk_type,
					   uint16_t level,
int smu_v13_0_get_dpm_freq_by_index(struct smu_context *smu,
				    enum smu_clk_type clk_type, uint16_t level,
				    uint32_t *value)
{
	int ret = 0, clk_id = 0;
Loading