Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: use spirom update wait_for helper for psp v14

Spirom update typically requires extremely long
duration for command execution, and special helper
function to wait for it's completion.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Likun Gao and committed by
Alex Deucher
f19cb916 b7a90034

+7 -1
+5 -1
drivers/gpu/drm/amd/amdgpu/psp_v14_0.c
··· 577 577 WREG32_SOC15(MP0, 0, regMPASP_SMN_C2PMSG_73, 1); 578 578 579 579 if (cmd == C2PMSG_CMD_SPI_UPDATE_FLASH_IMAGE) 580 - return 0; 580 + ret = psp_wait_for_spirom_update(psp, SOC15_REG_OFFSET(MP0, 0, regMPASP_SMN_C2PMSG_115), 581 + MBOX_READY_FLAG, MBOX_READY_MASK, PSP_SPIROM_UPDATE_TIMEOUT); 582 + else 583 + ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMPASP_SMN_C2PMSG_115), 584 + MBOX_READY_FLAG, MBOX_READY_MASK, false); 581 585 582 586 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, regMPASP_SMN_C2PMSG_115), 583 587 MBOX_READY_FLAG, MBOX_READY_MASK, false);
+2
drivers/gpu/drm/amd/amdgpu/psp_v14_0.h
··· 25 25 26 26 #include "amdgpu_psp.h" 27 27 28 + #define PSP_SPIROM_UPDATE_TIMEOUT 60000 /* 60s */ 29 + 28 30 void psp_v14_0_set_psp_funcs(struct psp_context *psp); 29 31 30 32 #endif