Commit 39dd895d authored by YuBiao Wang's avatar YuBiao Wang Committed by Alex Deucher

drm/amdgpu: Add nv mailbox irq in soc21

Under virtualization guest needs to receive notification from host to
perform reset in some cases. Add nv mailbox irq in soc21.
Signed-off-by: default avatarYuBiao Wang <YuBiao.Wang@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 82132ecc
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "soc15.h" #include "soc15.h"
#include "soc15_common.h" #include "soc15_common.h"
#include "soc21.h" #include "soc21.h"
#include "mxgpu_nv.h"
static const struct amd_ip_funcs soc21_common_ip_funcs; static const struct amd_ip_funcs soc21_common_ip_funcs;
...@@ -659,19 +660,31 @@ static int soc21_common_early_init(void *handle) ...@@ -659,19 +660,31 @@ static int soc21_common_early_init(void *handle)
return -EINVAL; return -EINVAL;
} }
if (amdgpu_sriov_vf(adev)) if (amdgpu_sriov_vf(adev)) {
amdgpu_virt_init_setting(adev); amdgpu_virt_init_setting(adev);
xgpu_nv_mailbox_set_irq_funcs(adev);
}
return 0; return 0;
} }
static int soc21_common_late_init(void *handle) static int soc21_common_late_init(void *handle)
{ {
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
if (amdgpu_sriov_vf(adev))
xgpu_nv_mailbox_get_irq(adev);
return 0; return 0;
} }
static int soc21_common_sw_init(void *handle) static int soc21_common_sw_init(void *handle)
{ {
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
if (amdgpu_sriov_vf(adev))
xgpu_nv_mailbox_add_irq_id(adev);
return 0; return 0;
} }
...@@ -709,6 +722,9 @@ static int soc21_common_hw_fini(void *handle) ...@@ -709,6 +722,9 @@ static int soc21_common_hw_fini(void *handle)
/* disable the doorbell aperture */ /* disable the doorbell aperture */
soc21_enable_doorbell_aperture(adev, false); soc21_enable_doorbell_aperture(adev, false);
if (amdgpu_sriov_vf(adev))
xgpu_nv_mailbox_put_irq(adev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment