summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/soc15.c
diff options
context:
space:
mode:
authorShaoyun Liu <Shaoyun.Liu@amd.com>2017-11-27 13:16:35 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-12-08 11:16:51 -0500
commit4522824c488e93755b10349cf6af0e967fb73186 (patch)
tree90860aea820418ab4617d218cbe56676530c6a2d /drivers/gpu/drm/amd/amdgpu/soc15.c
parent8205f8840f753a36038ae76023ceab32e0e43934 (diff)
drm/amdgpu: Dynamic initialize IP base offset
The base offsets of the IP blocks may change across asics even though the relative register offsets are the same for an IP. Handle this dynamically. Acked-by: Christian Konig <christian.koenig@amd.com> Signed-off-by: Shaoyun Liu <Shaoyun.Liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/soc15.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/soc15.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index f134ca0c093c..7c88bcb6c305 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -516,6 +516,16 @@ static const struct amdgpu_ip_block_version vega10_common_ip_block =
int soc15_set_ip_blocks(struct amdgpu_device *adev)
{
+ /* Set IP register base before any HW register access */
+ switch (adev->asic_type) {
+ case CHIP_VEGA10:
+ case CHIP_RAVEN:
+ vega10_reg_base_init(adev);
+ break;
+ default:
+ return -EINVAL;
+ }
+
nbio_v6_1_detect_hw_virt(adev);
if (amdgpu_sriov_vf(adev))