All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: remove SRIOV VF FB location programming
@ 2023-07-06 16:25 Zhigang Luo
  2023-07-06 16:25 ` [PATCH 2/2] drm/amdgpu: init TA microcode for SRIOV VF when MP0 IP is 13.0.6 Zhigang Luo
  2023-07-06 18:12 ` [PATCH 1/2] drm/amdgpu: remove SRIOV VF FB location programming Alex Deucher
  0 siblings, 2 replies; 3+ messages in thread
From: Zhigang Luo @ 2023-07-06 16:25 UTC (permalink / raw)
  To: amd-gfx; +Cc: alexander.deucher, Zhigang Luo

For SRIOV VF, FB location is programmed by host driver, no need to
program it in guest driver.

Signed-off-by: Zhigang Luo <Zhigang.Luo@amd.com>
Change-Id: I2a4838f6703e94bb0bcf3a8e923c69466e37803f
---
 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 15 +--------------
 drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c  | 12 ------------
 2 files changed, 1 insertion(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c
index 47f95ec218a3..03ae661e3b54 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c
@@ -406,20 +406,6 @@ static int gfxhub_v1_2_xcc_gart_enable(struct amdgpu_device *adev,
 	int i;
 
 	tmp_mask = xcc_mask;
-	/*
-	 * MC_VM_FB_LOCATION_BASE/TOP is NULL for VF, because they are
-	 * VF copy registers so vbios post doesn't program them, for
-	 * SRIOV driver need to program them
-	 */
-	if (amdgpu_sriov_vf(adev)) {
-		for_each_inst(i, tmp_mask) {
-			i = ffs(tmp_mask) - 1;
-			WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_BASE,
-				     adev->gmc.vram_start >> 24);
-			WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_TOP,
-				     adev->gmc.vram_end >> 24);
-		}
-	}
 
 	/* GART Enable. */
 	gfxhub_v1_2_xcc_init_gart_aperture_regs(adev, xcc_mask);
@@ -606,6 +592,7 @@ static int gfxhub_v1_2_get_xgmi_info(struct amdgpu_device *adev)
 	max_region =
 		REG_GET_FIELD(xgmi_lfb_cntl, MC_VM_XGMI_LFB_CNTL, PF_MAX_REGION);
 
+	DRM_INFO("XXXXXX xgmi_lfb_cntl=0x%x seg_size=0x%llx", xgmi_lfb_cntl, seg_size);
 
 
 	max_num_physical_nodes   = 8;
diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
index 5e8b493f8699..784c4e077470 100644
--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
+++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
@@ -413,18 +413,6 @@ static void mmhub_v1_8_program_invalidation(struct amdgpu_device *adev)
 
 static int mmhub_v1_8_gart_enable(struct amdgpu_device *adev)
 {
-	if (amdgpu_sriov_vf(adev)) {
-		/*
-		 * MC_VM_FB_LOCATION_BASE/TOP is NULL for VF, becuase they are
-		 * VF copy registers so vbios post doesn't program them, for
-		 * SRIOV driver need to program them
-		 */
-		WREG32_SOC15(MMHUB, 0, regMC_VM_FB_LOCATION_BASE,
-			     adev->gmc.vram_start >> 24);
-		WREG32_SOC15(MMHUB, 0, regMC_VM_FB_LOCATION_TOP,
-			     adev->gmc.vram_end >> 24);
-	}
-
 	/* GART Enable. */
 	mmhub_v1_8_init_gart_aperture_regs(adev);
 	mmhub_v1_8_init_system_aperture_regs(adev);
-- 
2.25.1


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

* [PATCH 2/2] drm/amdgpu: init TA microcode for SRIOV VF when MP0 IP is 13.0.6
  2023-07-06 16:25 [PATCH 1/2] drm/amdgpu: remove SRIOV VF FB location programming Zhigang Luo
@ 2023-07-06 16:25 ` Zhigang Luo
  2023-07-06 18:12 ` [PATCH 1/2] drm/amdgpu: remove SRIOV VF FB location programming Alex Deucher
  1 sibling, 0 replies; 3+ messages in thread
From: Zhigang Luo @ 2023-07-06 16:25 UTC (permalink / raw)
  To: amd-gfx; +Cc: alexander.deucher, Zhigang Luo

Signed-off-by: Zhigang Luo <Zhigang.Luo@amd.com>
Change-Id: I71524c69c7137c6db4968b95e480c910aba24703
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 21438ff61c6e..de9a2a7f5459 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -145,6 +145,7 @@ static int psp_init_sriov_microcode(struct psp_context *psp)
 		break;
 	case IP_VERSION(13, 0, 6):
 		ret = psp_init_cap_microcode(psp, ucode_prefix);
+		ret &= psp_init_ta_microcode(psp, ucode_prefix);
 		break;
 	case IP_VERSION(13, 0, 10):
 		adev->virt.autoload_ucode_id = AMDGPU_UCODE_ID_CP_MES1_DATA;
-- 
2.25.1


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

* Re: [PATCH 1/2] drm/amdgpu: remove SRIOV VF FB location programming
  2023-07-06 16:25 [PATCH 1/2] drm/amdgpu: remove SRIOV VF FB location programming Zhigang Luo
  2023-07-06 16:25 ` [PATCH 2/2] drm/amdgpu: init TA microcode for SRIOV VF when MP0 IP is 13.0.6 Zhigang Luo
@ 2023-07-06 18:12 ` Alex Deucher
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2023-07-06 18:12 UTC (permalink / raw)
  To: Zhigang Luo; +Cc: alexander.deucher, amd-gfx

On Thu, Jul 6, 2023 at 12:25 PM Zhigang Luo <Zhigang.Luo@amd.com> wrote:
>
> For SRIOV VF, FB location is programmed by host driver, no need to
> program it in guest driver.
>
> Signed-off-by: Zhigang Luo <Zhigang.Luo@amd.com>
> Change-Id: I2a4838f6703e94bb0bcf3a8e923c69466e37803f
> ---
>  drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 15 +--------------
>  drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c  | 12 ------------
>  2 files changed, 1 insertion(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c
> index 47f95ec218a3..03ae661e3b54 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c
> @@ -406,20 +406,6 @@ static int gfxhub_v1_2_xcc_gart_enable(struct amdgpu_device *adev,
>         int i;
>
>         tmp_mask = xcc_mask;
> -       /*
> -        * MC_VM_FB_LOCATION_BASE/TOP is NULL for VF, because they are
> -        * VF copy registers so vbios post doesn't program them, for
> -        * SRIOV driver need to program them
> -        */
> -       if (amdgpu_sriov_vf(adev)) {
> -               for_each_inst(i, tmp_mask) {
> -                       i = ffs(tmp_mask) - 1;
> -                       WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_BASE,
> -                                    adev->gmc.vram_start >> 24);
> -                       WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_TOP,
> -                                    adev->gmc.vram_end >> 24);
> -               }
> -       }
>
>         /* GART Enable. */
>         gfxhub_v1_2_xcc_init_gart_aperture_regs(adev, xcc_mask);
> @@ -606,6 +592,7 @@ static int gfxhub_v1_2_get_xgmi_info(struct amdgpu_device *adev)
>         max_region =
>                 REG_GET_FIELD(xgmi_lfb_cntl, MC_VM_XGMI_LFB_CNTL, PF_MAX_REGION);
>
> +       DRM_INFO("XXXXXX xgmi_lfb_cntl=0x%x seg_size=0x%llx", xgmi_lfb_cntl, seg_size);

Leftover debugging statement.  With that removed, the series is:
Acked-by: Alex Deucher <alexander.deucher@amd.com>

>
>
>         max_num_physical_nodes   = 8;
> diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
> index 5e8b493f8699..784c4e077470 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
> @@ -413,18 +413,6 @@ static void mmhub_v1_8_program_invalidation(struct amdgpu_device *adev)
>
>  static int mmhub_v1_8_gart_enable(struct amdgpu_device *adev)
>  {
> -       if (amdgpu_sriov_vf(adev)) {
> -               /*
> -                * MC_VM_FB_LOCATION_BASE/TOP is NULL for VF, becuase they are
> -                * VF copy registers so vbios post doesn't program them, for
> -                * SRIOV driver need to program them
> -                */
> -               WREG32_SOC15(MMHUB, 0, regMC_VM_FB_LOCATION_BASE,
> -                            adev->gmc.vram_start >> 24);
> -               WREG32_SOC15(MMHUB, 0, regMC_VM_FB_LOCATION_TOP,
> -                            adev->gmc.vram_end >> 24);
> -       }
> -
>         /* GART Enable. */
>         mmhub_v1_8_init_gart_aperture_regs(adev);
>         mmhub_v1_8_init_system_aperture_regs(adev);
> --
> 2.25.1
>

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

end of thread, other threads:[~2023-07-06 18:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06 16:25 [PATCH 1/2] drm/amdgpu: remove SRIOV VF FB location programming Zhigang Luo
2023-07-06 16:25 ` [PATCH 2/2] drm/amdgpu: init TA microcode for SRIOV VF when MP0 IP is 13.0.6 Zhigang Luo
2023-07-06 18:12 ` [PATCH 1/2] drm/amdgpu: remove SRIOV VF FB location programming Alex Deucher

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.