[PATCH 3/8] drm/amdgpu: introduce psp_v11_0_is_sos_alive interface

Tuikov, Luben Luben.Tuikov at amd.com
Wed Oct 9 03:21:43 UTC 2019


On 2019-10-08 3:29 p.m., Alex Deucher wrote:
> From: "Tianci.Yin" <tianci.yin at amd.com>
> 
> introduce psp_v11_0_is_sos_alive func for common use.
> 
> Change-Id: Iee0a6dd924d6a4b164eb751c0bec49fcb7d79483
> Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> Signed-off-by: Tianci.Yin <tianci.yin at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 22 +++++++++++++---------
>  1 file changed, 13 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
> index 04318cfd50a8..e74a952a3f7c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
> @@ -206,18 +206,26 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)
>  	return err;
>  }
>  
> +static bool psp_v11_0_is_sos_alive(struct psp_context *psp)
> +{
> +	struct amdgpu_device *adev = psp->adev;
> +	uint32_t sol_reg;
> +
> +	sol_reg = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
> +
> +	return (sol_reg != 0x0);

Parenthesis are unnecessary in the return and not in LKCS.

Regards,
Luben

> +}
> +
>  static int psp_v11_0_bootloader_load_kdb(struct psp_context *psp)
>  {
>  	int ret;
>  	uint32_t psp_gfxdrv_command_reg = 0;
>  	struct amdgpu_device *adev = psp->adev;
> -	uint32_t sol_reg;
>  
>  	/* Check tOS sign of life register to confirm sys driver and sOS
>  	 * are already been loaded.
>  	 */
> -	sol_reg = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
> -	if (sol_reg) {
> +	if (psp_v11_0_is_sos_alive(psp)) {
>  		psp->sos_fw_version = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_58);
>  		dev_info(adev->dev, "sos fw version = 0x%x.\n", psp->sos_fw_version);
>  		return 0;
> @@ -253,13 +261,11 @@ static int psp_v11_0_bootloader_load_sysdrv(struct psp_context *psp)
>  	int ret;
>  	uint32_t psp_gfxdrv_command_reg = 0;
>  	struct amdgpu_device *adev = psp->adev;
> -	uint32_t sol_reg;
>  
>  	/* Check sOS sign of life register to confirm sys driver and sOS
>  	 * are already been loaded.
>  	 */
> -	sol_reg = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
> -	if (sol_reg) {
> +	if (psp_v11_0_is_sos_alive(psp)) {
>  		psp->sos_fw_version = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_58);
>  		dev_info(adev->dev, "sos fw version = 0x%x.\n", psp->sos_fw_version);
>  		return 0;
> @@ -297,13 +303,11 @@ static int psp_v11_0_bootloader_load_sos(struct psp_context *psp)
>  	int ret;
>  	unsigned int psp_gfxdrv_command_reg = 0;
>  	struct amdgpu_device *adev = psp->adev;
> -	uint32_t sol_reg;
>  
>  	/* Check sOS sign of life register to confirm sys driver and sOS
>  	 * are already been loaded.
>  	 */
> -	sol_reg = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
> -	if (sol_reg)
> +	if (psp_v11_0_is_sos_alive(psp))
>  		return 0;
>  
>  	/* Wait for bootloader to signify that is ready having bit 31 of C2PMSG_35 set to 1 */
> 



More information about the amd-gfx mailing list