Skip to content

Commit

Permalink
drm/amdgpu/gmc11: enable AGP aperture
Browse files Browse the repository at this point in the history
Enable the AGP aperture on chips with GMC v11.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Alex Deucher committed Jun 3, 2022
1 parent ac1ac69 commit 2cfe34e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,11 @@ static void gfxhub_v3_0_init_system_aperture_regs(struct amdgpu_device *adev)
{
uint64_t value;

/* Disable AGP. */
/* Program the AGP BAR */
WREG32_SOC15(GC, 0, regGCMC_VM_AGP_BASE, 0);
WREG32_SOC15(GC, 0, regGCMC_VM_AGP_TOP, 0);
WREG32_SOC15(GC, 0, regGCMC_VM_AGP_BOT, 0x00FFFFFF);
WREG32_SOC15(GC, 0, regGCMC_VM_AGP_BOT, adev->gmc.agp_start >> 24);
WREG32_SOC15(GC, 0, regGCMC_VM_AGP_TOP, adev->gmc.agp_end >> 24);


/* Program the system aperture low logical page number. */
WREG32_SOC15(GC, 0, regGCMC_VM_SYSTEM_APERTURE_LOW_ADDR,
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ static void gmc_v11_0_vram_gtt_location(struct amdgpu_device *adev,

amdgpu_gmc_vram_location(adev, &adev->gmc, base);
amdgpu_gmc_gart_location(adev, mc);
amdgpu_gmc_agp_location(adev, mc);

/* base offset of vram pages */
adev->vm_manager.vram_base_offset = adev->mmhub.funcs->get_mc_fb_offset(adev);
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ static void mmhub_v3_0_init_system_aperture_regs(struct amdgpu_device *adev)
uint64_t value;
uint32_t tmp;

/* Disable AGP. */
/* Program the AGP BAR */
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BASE, 0);
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_TOP, 0);
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BOT, 0x00FFFFFF);
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BOT, adev->gmc.agp_start >> 24);
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_TOP, adev->gmc.agp_end >> 24);

if (!amdgpu_sriov_vf(adev)) {
/*
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ static void mmhub_v3_0_2_init_system_aperture_regs(struct amdgpu_device *adev)
uint64_t value;
uint32_t tmp;

/* Disable AGP. */
/* Program the AGP BAR */
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BASE, 0);
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_TOP, 0);
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BOT, 0x00FFFFFF);
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BOT, adev->gmc.agp_start >> 24);
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_TOP, adev->gmc.agp_end >> 24);

if (!amdgpu_sriov_vf(adev)) {
/*
Expand Down

0 comments on commit 2cfe34e

Please sign in to comment.