Skip to content

Commit 1d02ae4

Browse files
Asad Kamalalexdeucher
authored andcommitted
drm/amd/pm: Update pci link width for smu v13.0.6
Update addresses of PCIE link width registers, & link width format used to populate gpu metrics table for smu v13.0.6 v2: Removed ESM register update v3: Updated patch subject and message Signed-off-by: Asad Kamal <asad.kamal@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent dd12b85 commit 1d02ae4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@
8181
#define EPSILON 1
8282

8383
#define smnPCIE_ESM_CTRL 0x193D0
84-
#define smnPCIE_LC_LINK_WIDTH_CNTL 0x1ab40288
84+
#define smnPCIE_LC_LINK_WIDTH_CNTL 0x1a340288
8585
#define PCIE_LC_LINK_WIDTH_CNTL__LC_LINK_WIDTH_RD_MASK 0x00000070L
8686
#define PCIE_LC_LINK_WIDTH_CNTL__LC_LINK_WIDTH_RD__SHIFT 0x4
87+
#define MAX_LINK_WIDTH 6
8788

8889
static const struct cmn2asic_msg_mapping smu_v13_0_6_message_map[SMU_MSG_MAX_COUNT] = {
8990
MSG_MAP(TestMessage, PPSMC_MSG_TestMessage, 0),
@@ -1947,6 +1948,7 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table
19471948
struct amdgpu_device *adev = smu->adev;
19481949
int ret = 0, inst0, xcc0;
19491950
MetricsTable_t *metrics;
1951+
u16 link_width_level;
19501952

19511953
inst0 = adev->sdma.instance[0].aid_id;
19521954
xcc0 = GET_INST(GC, 0);
@@ -1997,8 +1999,12 @@ static ssize_t smu_v13_0_6_get_gpu_metrics(struct smu_context *smu, void **table
19971999
gpu_metrics->throttle_status = 0;
19982000

19992001
if (!(adev->flags & AMD_IS_APU)) {
2002+
link_width_level = smu_v13_0_6_get_current_pcie_link_width_level(smu);
2003+
if (link_width_level > MAX_LINK_WIDTH)
2004+
link_width_level = 0;
2005+
20002006
gpu_metrics->pcie_link_width =
2001-
smu_v13_0_6_get_current_pcie_link_width_level(smu);
2007+
DECODE_LANE_WIDTH(link_width_level);
20022008
gpu_metrics->pcie_link_speed =
20032009
smu_v13_0_6_get_current_pcie_link_speed(smu);
20042010
}

0 commit comments

Comments
 (0)