From d86fd724e59af96ae5ab6630f4f07a076e9b80cd Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Mon, 8 Feb 2021 11:00:03 +0800 Subject: [PATCH] drm/amdgpu: add psp RAP L0 check support add PSP RAP L0 check when RAP TA is loaded. Signed-off-by: Kevin Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 3510be5..6916292 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -2365,6 +2365,7 @@ static int psp_hw_init(void *handle) { int ret; struct amdgpu_device *adev = (struct amdgpu_device *)handle; + enum ta_rap_status status = TA_RAP_STATUS__SUCCESS; mutex_lock(&adev->firmware.mutex); /* @@ -2382,7 +2383,14 @@ static int psp_hw_init(void *handle) } mutex_unlock(&adev->firmware.mutex); - return 0; + + ret = psp_rap_invoke(&adev->psp, TA_CMD_RAP__VALIDATE_L0, &status); + if (ret || status != TA_RAP_STATUS__SUCCESS) { + dev_err(adev->dev, "RAP: (%d) Failed to Invoke Validate L0, status %d\n", + ret, status); + } + + return ret; failed: adev->firmware.load_type = AMDGPU_FW_LOAD_DIRECT; -- 2.7.4