Commit 05cadcd3 authored by Huang Rui's avatar Huang Rui Committed by Alex Deucher

drm/amd/powerplay: add interface to read pptable from vbios

This patch adds interface to read pptable from vbios for smu.
Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e11c4fd5
...@@ -87,6 +87,17 @@ static int smu_sw_fini(void *handle) ...@@ -87,6 +87,17 @@ static int smu_sw_fini(void *handle)
return 0; return 0;
} }
static int smu_smc_table_hw_init(struct smu_context *smu)
{
int ret;
ret = smu_read_pptable_from_vbios(smu);
if (ret)
return ret;
return 0;
}
static int smu_hw_init(void *handle) static int smu_hw_init(void *handle)
{ {
int ret; int ret;
...@@ -110,13 +121,19 @@ static int smu_hw_init(void *handle) ...@@ -110,13 +121,19 @@ static int smu_hw_init(void *handle)
mutex_lock(&smu->mutex); mutex_lock(&smu->mutex);
/* TODO */ ret = smu_smc_table_hw_init(smu);
if (ret)
goto failed;
mutex_unlock(&smu->mutex); mutex_unlock(&smu->mutex);
pr_info("SMU is initialized successfully!\n"); pr_info("SMU is initialized successfully!\n");
return 0; return 0;
failed:
mutex_unlock(&smu->mutex);
return ret;
} }
static int smu_hw_fini(void *handle) static int smu_hw_fini(void *handle)
......
...@@ -37,6 +37,7 @@ struct smu_funcs ...@@ -37,6 +37,7 @@ struct smu_funcs
int (*init_microcode)(struct smu_context *smu); int (*init_microcode)(struct smu_context *smu);
int (*load_microcode)(struct smu_context *smu); int (*load_microcode)(struct smu_context *smu);
int (*check_fw_status)(struct smu_context *smu); int (*check_fw_status)(struct smu_context *smu);
int (*read_pptable_from_vbios)(struct smu_context *smu);
}; };
#define smu_init_microcode(smu) \ #define smu_init_microcode(smu) \
...@@ -45,6 +46,8 @@ struct smu_funcs ...@@ -45,6 +46,8 @@ struct smu_funcs
((smu)->funcs->load_microcode ? (smu)->funcs->load_microcode((smu)) : 0) ((smu)->funcs->load_microcode ? (smu)->funcs->load_microcode((smu)) : 0)
#define smu_check_fw_status(smu) \ #define smu_check_fw_status(smu) \
((smu)->funcs->check_fw_status ? (smu)->funcs->check_fw_status((smu)) : 0) ((smu)->funcs->check_fw_status ? (smu)->funcs->check_fw_status((smu)) : 0)
#define smu_read_pptable_from_vbios(smu) \
((smu)->funcs->read_pptable_from_vbios ? (smu)->funcs->read_pptable_from_vbios((smu)) : 0)
extern const struct amd_ip_funcs smu_ip_funcs; extern const struct amd_ip_funcs smu_ip_funcs;
......
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