Drop those useless APIs and structures. Change-Id: I1350c0e7ec0b990a1178a0ce92f61e56dc8851b5 Signed-off-by: Evan Quan <evan.quan@xxxxxxx> --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 66 +++++++++---------------- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 5 -- 2 files changed, 22 insertions(+), 49 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 2528fbcad275..f1ffe04b8c0f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -62,19 +62,6 @@ ((psp)->funcs->smu_reload_quirk ? (psp)->funcs->smu_reload_quirk((psp)) : false) #define psp_mode1_reset(psp) \ ((psp)->funcs->mode1_reset ? (psp)->funcs->mode1_reset((psp)) : false) -#define amdgpu_psp_check_fw_loading_status(adev, i) \ - (adev)->firmware.funcs->check_fw_loading_status((adev), (i)) - -static void psp_set_funcs(struct amdgpu_device *adev); - -static int psp_early_init(void *handle) -{ - struct amdgpu_device *adev = (struct amdgpu_device *)handle; - - psp_set_funcs(adev); - - return 0; -} static int psp_sw_init(void *handle) { @@ -166,6 +153,26 @@ static int psp_hw_start(struct psp_context *psp) return 0; } +static bool psp_check_fw_loading_status(struct amdgpu_device *adev, + enum AMDGPU_UCODE_ID ucode_type) +{ + struct amdgpu_firmware_info *ucode = NULL; + + if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) { + DRM_INFO("firmware is not loaded by PSP\n"); + return true; + } + + if (!adev->firmware.fw_size) + return false; + + ucode = &adev->firmware.ucode[ucode_type]; + if (!ucode->fw || !ucode->ucode_size) + return false; + + return psp_compare_sram_data(&adev->psp, ucode, ucode_type); +} + static int psp_np_fw_load(struct psp_context *psp) { int i, ret; @@ -198,7 +205,7 @@ static int psp_np_fw_load(struct psp_context *psp) #if 0 /* check if firmware loaded sucessfully */ - if (!amdgpu_psp_check_fw_loading_status(adev, i)) + if (!psp_check_fw_loading_status(adev, i)) return -EINVAL; #endif } @@ -413,25 +420,6 @@ int psp_gpu_reset(struct amdgpu_device *adev) return psp_mode1_reset(&adev->psp); } -static bool psp_check_fw_loading_status(struct amdgpu_device *adev, - enum AMDGPU_UCODE_ID ucode_type) -{ - struct amdgpu_firmware_info *ucode = NULL; - - if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) { - DRM_INFO("firmware is not loaded by PSP\n"); - return true; - } - - if (!adev->firmware.fw_size) - return false; - - ucode = &adev->firmware.ucode[ucode_type]; - if (!ucode->fw || !ucode->ucode_size) - return false; - - return psp_compare_sram_data(&adev->psp, ucode, ucode_type); -} static int psp_set_clockgating_state(void *handle, enum amd_clockgating_state state) @@ -447,7 +435,7 @@ static int psp_set_powergating_state(void *handle, const struct amd_ip_funcs psp_ip_funcs = { .name = "psp", - .early_init = psp_early_init, + .early_init = NULL, .late_init = NULL, .sw_init = psp_sw_init, .sw_fini = psp_sw_fini, @@ -463,16 +451,6 @@ const struct amd_ip_funcs psp_ip_funcs = { .set_powergating_state = psp_set_powergating_state, }; -static const struct amdgpu_psp_funcs psp_funcs = { - .check_fw_loading_status = psp_check_fw_loading_status, -}; - -static void psp_set_funcs(struct amdgpu_device *adev) -{ - if (NULL == adev->firmware.funcs) - adev->firmware.funcs = &psp_funcs; -} - const struct amdgpu_ip_block_version psp_v3_1_ip_block = { .type = AMD_IP_BLOCK_TYPE_PSP, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h index d65691b988fa..16900d4c8034 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h @@ -157,11 +157,6 @@ struct psp_context struct psp_xgmi_context xgmi_context; }; -struct amdgpu_psp_funcs { - bool (*check_fw_loading_status)(struct amdgpu_device *adev, - enum AMDGPU_UCODE_ID); -}; - #define AMDGPU_XGMI_MAX_CONNECTED_NODES 64 struct psp_xgmi_node_info { uint64_t node_id; -- 2.20.1 _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx