drm/amdgpu: export mmhub sw_init into gmc
authorHuang Rui <ray.huang@amd.com>
Wed, 31 May 2017 14:59:18 +0000 (22:59 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 6 Jun 2017 20:58:43 +0000 (16:58 -0400)
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.h

index 1dc6816c87b291ffda30a58f4b40b2917beedf7a..979c884625bff82a38435fd36fce6599d037dd13 100644 (file)
@@ -533,6 +533,7 @@ static int gmc_v9_0_sw_init(void *handle)
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
        gfxhub_v1_0_init(adev);
+       mmhub_v1_0_init(adev);
 
        spin_lock_init(&adev->mc.invalidate_lock);
 
index 3d0c652daab8c0ee5c35334cf89e0646ea54cbef..2ead630c7f379342ec475d0a6159e5f71495f952 100644 (file)
@@ -348,19 +348,8 @@ void mmhub_v1_0_set_fault_enable_default(struct amdgpu_device *adev, bool value)
        WREG32(SOC15_REG_OFFSET(MMHUB, 0, mmVM_L2_PROTECTION_FAULT_CNTL), tmp);
 }
 
-static int mmhub_v1_0_early_init(void *handle)
+void mmhub_v1_0_init(struct amdgpu_device *adev)
 {
-       return 0;
-}
-
-static int mmhub_v1_0_late_init(void *handle)
-{
-       return 0;
-}
-
-static int mmhub_v1_0_sw_init(void *handle)
-{
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_MMHUB];
 
        hub->ctx0_ptb_addr_lo32 =
@@ -380,6 +369,20 @@ static int mmhub_v1_0_sw_init(void *handle)
        hub->vm_l2_pro_fault_cntl =
                SOC15_REG_OFFSET(MMHUB, 0, mmVM_L2_PROTECTION_FAULT_CNTL);
 
+}
+
+static int mmhub_v1_0_early_init(void *handle)
+{
+       return 0;
+}
+
+static int mmhub_v1_0_late_init(void *handle)
+{
+       return 0;
+}
+
+static int mmhub_v1_0_sw_init(void *handle)
+{
        return 0;
 }
 
index aadedf99c0281354528e5e9d25cd380cc3520748..f8a57e16ec254ba4e7d03cdaefde1931b15beb56 100644 (file)
@@ -28,6 +28,7 @@ int mmhub_v1_0_gart_enable(struct amdgpu_device *adev);
 void mmhub_v1_0_gart_disable(struct amdgpu_device *adev);
 void mmhub_v1_0_set_fault_enable_default(struct amdgpu_device *adev,
                                         bool value);
+void mmhub_v1_0_init(struct amdgpu_device *adev);
 
 extern const struct amd_ip_funcs mmhub_v1_0_ip_funcs;
 extern const struct amdgpu_ip_block_version mmhub_v1_0_ip_block;