summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Wang <KevinYang.Wang@amd.com>2023-05-24 08:54:26 +0300
committerAlex Deucher <alexander.deucher@amd.com>2023-06-09 19:34:28 +0300
commit5e86aa29a338f5c25e2d10d021bffc6b1b560ad5 (patch)
treee181603adaf8efff14a7d7ae2306e122ebd0a754
parent93682f8a196718c2caf9b9b3de7894d5c0318f1f (diff)
downloadlinux-5e86aa29a338f5c25e2d10d021bffc6b1b560ad5.tar.xz
drm/amd/pm: add unique serial number support for smu_v13_0_6
add unique serial number support for smu_v13_0_6. (use aid0 serial number by default) Signed-off-by: Yang Wang <KevinYang.Wang@amd.com> Signed-off-by: Asad Kamal <asad.kamal@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
index b9f32e0364db..75255e0baf91 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
@@ -192,6 +192,7 @@ struct PPTable_t {
uint32_t LclkFrequencyTable[4];
uint32_t MaxLclkDpmRange;
uint32_t MinLclkDpmRange;
+ uint64_t PublicSerialNumber_AID;
bool Init;
};
@@ -352,6 +353,9 @@ static int smu_v13_0_6_setup_driver_pptable(struct smu_context *smu)
SMUQ10_TO_UINT(metrics->LclkFrequencyTable[i]);
}
+ /* use AID0 serial number by default */
+ pptable->PublicSerialNumber_AID = metrics->PublicSerialNumber_AID[0];
+
pptable->Init = true;
}
@@ -1856,19 +1860,11 @@ static void smu_v13_0_6_i2c_control_fini(struct smu_context *smu)
static void smu_v13_0_6_get_unique_id(struct smu_context *smu)
{
struct amdgpu_device *adev = smu->adev;
- //SmuMetrics_t *metrics = smu->smu_table.metrics_table;
- uint32_t upper32 = 0, lower32 = 0;
- int ret;
-
- ret = smu_cmn_get_metrics_table(smu, NULL, false);
- if (ret)
- goto out;
-
- //upper32 = metrics->PublicSerialNumUpper32;
- //lower32 = metrics->PublicSerialNumLower32;
+ struct smu_table_context *smu_table = &smu->smu_table;
+ struct PPTable_t *pptable =
+ (struct PPTable_t *)smu_table->driver_pptable;
-out:
- adev->unique_id = ((uint64_t)upper32 << 32) | lower32;
+ adev->unique_id = pptable->PublicSerialNumber_AID;
if (adev->serial[0] == '\0')
sprintf(adev->serial, "%016llx", adev->unique_id);
}