Skip to content

Commit 5f41741

Browse files
oakzengalexdeucher
authored andcommitted
Revert "drm/amdgpu: workaround the TMR MC address issue (v2)"
This reverts commit 2f05509. 2f05509 was a driver workaround when PSP firmware was not ready. Now the PSP fw is ready so we revert this driver workaround. Signed-off-by: Oak Zeng <[email protected]> Reviewed-by: Harish Kasiviswanathan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 839ede8 commit 5f41741

File tree

4 files changed

+10
-40
lines changed

4 files changed

+10
-40
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,6 @@ struct amdgpu_gmc {
218218
*/
219219
u64 fb_start;
220220
u64 fb_end;
221-
/* In the case of use GART table for vmid0 FB access, [fb_start, fb_end]
222-
* will be squeezed to GART aperture. But we have a PSP FW issue to fix
223-
* for now. To temporarily workaround the PSP FW issue, added below two
224-
* variables to remember the original fb_start/end to re-enable FB
225-
* aperture to workaround the PSP FW issue. Will delete it after we
226-
* get a proper PSP FW fix.
227-
*/
228-
u64 fb_start_original;
229-
u64 fb_end_original;
230221
unsigned vram_width;
231222
u64 real_vram_size;
232223
int vram_mtrr;

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -414,16 +414,6 @@ static int psp_tmr_init(struct psp_context *psp)
414414
AMDGPU_GEM_DOMAIN_VRAM,
415415
&psp->tmr_bo, &psp->tmr_mc_addr, pptr);
416416

417-
/* workaround the tmr_mc_addr:
418-
* PSP requires an address in FB aperture. Right now driver produce
419-
* tmr_mc_addr in the GART aperture. Convert it back to FB aperture
420-
* for PSP. Will revert it after we get a fix from PSP FW.
421-
*/
422-
if (psp->adev->asic_type == CHIP_ALDEBARAN) {
423-
psp->tmr_mc_addr -= psp->adev->gmc.fb_start;
424-
psp->tmr_mc_addr += psp->adev->gmc.fb_start_original;
425-
}
426-
427417
return ret;
428418
}
429419

drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,12 @@ static void gfxhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev)
140140
* FB aperture and AGP aperture. Disable them.
141141
*/
142142
if (adev->gmc.pdb0_bo) {
143-
if (adev->asic_type == CHIP_ALDEBARAN) {
144-
WREG32_SOC15(GC, 0, mmMC_VM_FB_LOCATION_TOP, adev->gmc.fb_end_original >> 24);
145-
WREG32_SOC15(GC, 0, mmMC_VM_FB_LOCATION_BASE, adev->gmc.fb_start_original >> 24);
146-
WREG32_SOC15(GC, 0, mmMC_VM_AGP_TOP, 0);
147-
WREG32_SOC15(GC, 0, mmMC_VM_AGP_BOT, 0xFFFFFF);
148-
WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR, adev->gmc.fb_start_original >> 18);
149-
WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR, adev->gmc.fb_end_original >> 18);
150-
} else {
151-
WREG32_SOC15(GC, 0, mmMC_VM_FB_LOCATION_TOP, 0);
152-
WREG32_SOC15(GC, 0, mmMC_VM_FB_LOCATION_BASE, 0x00FFFFFF);
153-
WREG32_SOC15(GC, 0, mmMC_VM_AGP_TOP, 0);
154-
WREG32_SOC15(GC, 0, mmMC_VM_AGP_BOT, 0xFFFFFF);
155-
WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR, 0x3FFFFFFF);
156-
WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR, 0);
157-
}
143+
WREG32_SOC15(GC, 0, mmMC_VM_FB_LOCATION_TOP, 0);
144+
WREG32_SOC15(GC, 0, mmMC_VM_FB_LOCATION_BASE, 0x00FFFFFF);
145+
WREG32_SOC15(GC, 0, mmMC_VM_AGP_TOP, 0);
146+
WREG32_SOC15(GC, 0, mmMC_VM_AGP_BOT, 0xFFFFFF);
147+
WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR, 0x3FFFFFFF);
148+
WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR, 0);
158149
}
159150
}
160151

drivers/gpu/drm/amd/amdgpu/mmhub_v1_7.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ static u64 mmhub_v1_7_get_fb_location(struct amdgpu_device *adev)
4747

4848
adev->gmc.fb_start = base;
4949
adev->gmc.fb_end = top;
50-
adev->gmc.fb_start_original = base;
51-
adev->gmc.fb_end_original = top;
5250

5351
return base;
5452
}
@@ -126,10 +124,10 @@ static void mmhub_v1_7_init_system_aperture_regs(struct amdgpu_device *adev)
126124
if (adev->gmc.pdb0_bo) {
127125
WREG32_SOC15(MMHUB, 0, regMC_VM_AGP_BOT, 0xFFFFFF);
128126
WREG32_SOC15(MMHUB, 0, regMC_VM_AGP_TOP, 0);
129-
WREG32_SOC15(MMHUB, 0, regMC_VM_FB_LOCATION_TOP, adev->gmc.fb_end_original >> 24);
130-
WREG32_SOC15(MMHUB, 0, regMC_VM_FB_LOCATION_BASE, adev->gmc.fb_start_original >> 24);
131-
WREG32_SOC15(MMHUB, 0, regMC_VM_SYSTEM_APERTURE_LOW_ADDR, adev->gmc.fb_start_original >> 18);
132-
WREG32_SOC15(MMHUB, 0, regMC_VM_SYSTEM_APERTURE_HIGH_ADDR, adev->gmc.fb_end_original >> 18);
127+
WREG32_SOC15(MMHUB, 0, regMC_VM_FB_LOCATION_TOP, 0);
128+
WREG32_SOC15(MMHUB, 0, regMC_VM_FB_LOCATION_BASE, 0x00FFFFFF);
129+
WREG32_SOC15(MMHUB, 0, regMC_VM_SYSTEM_APERTURE_LOW_ADDR, 0x3FFFFFFF);
130+
WREG32_SOC15(MMHUB, 0, regMC_VM_SYSTEM_APERTURE_HIGH_ADDR, 0);
133131
}
134132
if (amdgpu_sriov_vf(adev))
135133
return;

0 commit comments

Comments
 (0)