|
@@ -231,3 +231,21 @@ int nbio_v6_1_init(struct amdgpu_device *adev)
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
+
|
|
|
+void nbio_v6_1_detect_hw_virt(struct amdgpu_device *adev)
|
|
|
+{
|
|
|
+ uint32_t reg;
|
|
|
+
|
|
|
+ reg = RREG32(SOC15_REG_OFFSET(NBIO, 0,
|
|
|
+ mmRCC_PF_0_0_RCC_IOV_FUNC_IDENTIFIER));
|
|
|
+ if (reg & 1)
|
|
|
+ adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF;
|
|
|
+
|
|
|
+ if (reg & 0x80000000)
|
|
|
+ adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
|
|
|
+
|
|
|
+ if (!reg) {
|
|
|
+ if (is_virtual_machine()) /* passthrough mode exclus sriov mod */
|
|
|
+ adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
|
|
|
+ }
|
|
|
+}
|