All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu/psp: add check sOS sign
@ 2017-03-29  9:26 Xiangliang Yu
       [not found] ` <1490779607-24341-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Xiangliang Yu @ 2017-03-29  9:26 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Xiangliang Yu

Confirm if sys driver and sOS are already been loaded through sOS
sign register, skip loading sys driver and sOS if finding the sign.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/psp_v3_1.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
index 49c3844..5191c45 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
@@ -170,7 +170,14 @@ int psp_v3_1_bootloader_load_sysdrv(struct psp_context *psp)
 	void *psp_sysdrv_virt = NULL;
 	uint64_t psp_sysdrv_mem;
 	struct amdgpu_device *adev = psp->adev;
-	uint32_t size;
+	uint32_t size, sol_reg;
+
+	/* Check sOS sign of life register to confirm sys driver and sOS
+	 * are already been loaded.
+	 */
+	sol_reg = RREG32(SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_81));
+	if (sol_reg)
+		return 0;
 
 	/* Wait for bootloader to signify that is ready having bit 31 of C2PMSG_35 set to 1 */
 	ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_35),
@@ -222,7 +229,14 @@ int psp_v3_1_bootloader_load_sos(struct psp_context *psp)
 	void *psp_sos_virt = NULL;
 	uint64_t psp_sos_mem;
 	struct amdgpu_device *adev = psp->adev;
-	uint32_t size;
+	uint32_t size, sol_reg;
+
+	/* Check sOS sign of life register to confirm sys driver and sOS
+	 * are already been loaded.
+	 */
+	sol_reg = RREG32(SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_81));
+	if (sol_reg)
+		return 0;
 
 	/* Wait for bootloader to signify that is ready having bit 31 of C2PMSG_35 set to 1 */
 	ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_35),
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH 1/2] drm/amdgpu/psp: add check sOS sign
       [not found] ` <1490779607-24341-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
@ 2017-03-29 21:42   ` Deucher, Alexander
  0 siblings, 0 replies; 2+ messages in thread
From: Deucher, Alexander @ 2017-03-29 21:42 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Yu, Xiangliang

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Xiangliang Yu
> Sent: Wednesday, March 29, 2017 5:27 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Yu, Xiangliang
> Subject: [PATCH 1/2] drm/amdgpu/psp: add check sOS sign
> 
> Confirm if sys driver and sOS are already been loaded through sOS
> sign register, skip loading sys driver and sOS if finding the sign.
> 
> Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>

Series is:
Acked-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/psp_v3_1.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
> b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
> index 49c3844..5191c45 100644
> --- a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
> +++ b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
> @@ -170,7 +170,14 @@ int psp_v3_1_bootloader_load_sysdrv(struct
> psp_context *psp)
>  	void *psp_sysdrv_virt = NULL;
>  	uint64_t psp_sysdrv_mem;
>  	struct amdgpu_device *adev = psp->adev;
> -	uint32_t size;
> +	uint32_t size, sol_reg;
> +
> +	/* Check sOS sign of life register to confirm sys driver and sOS
> +	 * are already been loaded.
> +	 */
> +	sol_reg = RREG32(SOC15_REG_OFFSET(MP0, 0,
> mmMP0_SMN_C2PMSG_81));
> +	if (sol_reg)
> +		return 0;
> 
>  	/* Wait for bootloader to signify that is ready having bit 31 of
> C2PMSG_35 set to 1 */
>  	ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0,
> mmMP0_SMN_C2PMSG_35),
> @@ -222,7 +229,14 @@ int psp_v3_1_bootloader_load_sos(struct
> psp_context *psp)
>  	void *psp_sos_virt = NULL;
>  	uint64_t psp_sos_mem;
>  	struct amdgpu_device *adev = psp->adev;
> -	uint32_t size;
> +	uint32_t size, sol_reg;
> +
> +	/* Check sOS sign of life register to confirm sys driver and sOS
> +	 * are already been loaded.
> +	 */
> +	sol_reg = RREG32(SOC15_REG_OFFSET(MP0, 0,
> mmMP0_SMN_C2PMSG_81));
> +	if (sol_reg)
> +		return 0;
> 
>  	/* Wait for bootloader to signify that is ready having bit 31 of
> C2PMSG_35 set to 1 */
>  	ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0,
> mmMP0_SMN_C2PMSG_35),
> --
> 2.7.4
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-29 21:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-29  9:26 [PATCH 1/2] drm/amdgpu/psp: add check sOS sign Xiangliang Yu
     [not found] ` <1490779607-24341-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org>
2017-03-29 21:42   ` Deucher, Alexander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.