mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-04-08 12:02:33 +02:00
drm/amdgpu: Add ras module ip block to amdgpu discovery
Add ras module ip block to amdgpu discovery. Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
036f18d0a2
commit
7169e706c8
@@ -380,7 +380,7 @@ int amdgpu_ip_block_suspend(struct amdgpu_ip_block *ip_block);
|
||||
|
||||
int amdgpu_ip_block_resume(struct amdgpu_ip_block *ip_block);
|
||||
|
||||
#define AMDGPU_MAX_IP_NUM 16
|
||||
#define AMDGPU_MAX_IP_NUM AMD_IP_BLOCK_TYPE_NUM
|
||||
|
||||
struct amdgpu_ip_block_status {
|
||||
bool valid;
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
#include "vcn_v5_0_1.h"
|
||||
#include "jpeg_v5_0_0.h"
|
||||
#include "jpeg_v5_0_1.h"
|
||||
#include "amdgpu_ras_mgr.h"
|
||||
|
||||
#include "amdgpu_vpe.h"
|
||||
#if defined(CONFIG_DRM_AMD_ISP)
|
||||
@@ -2393,6 +2394,21 @@ static int amdgpu_discovery_set_sdma_ip_blocks(struct amdgpu_device *adev)
|
||||
amdgpu_ip_version(adev, SDMA0_HWIP, 0));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int amdgpu_discovery_set_ras_ip_blocks(struct amdgpu_device *adev)
|
||||
{
|
||||
switch (amdgpu_ip_version(adev, MP0_HWIP, 0)) {
|
||||
case IP_VERSION(13, 0, 6):
|
||||
case IP_VERSION(13, 0, 12):
|
||||
case IP_VERSION(13, 0, 14):
|
||||
amdgpu_device_ip_block_add(adev, &ras_v1_0_ip_block);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3173,6 +3189,10 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
r = amdgpu_discovery_set_ras_ip_blocks(adev);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
if ((adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT &&
|
||||
!amdgpu_sriov_vf(adev)) ||
|
||||
(adev->firmware.load_type == AMDGPU_FW_LOAD_RLC_BACKDOOR_AUTO && amdgpu_dpm == 1)) {
|
||||
|
||||
@@ -109,6 +109,7 @@ enum amd_ip_block_type {
|
||||
AMD_IP_BLOCK_TYPE_VPE,
|
||||
AMD_IP_BLOCK_TYPE_UMSCH_MM,
|
||||
AMD_IP_BLOCK_TYPE_ISP,
|
||||
AMD_IP_BLOCK_TYPE_RAS,
|
||||
AMD_IP_BLOCK_TYPE_NUM,
|
||||
};
|
||||
|
||||
|
||||
@@ -381,6 +381,14 @@ static const struct amd_ip_funcs __maybe_unused ras_v1_0_ip_funcs = {
|
||||
.hw_fini = amdgpu_ras_mgr_hw_fini,
|
||||
};
|
||||
|
||||
const struct amdgpu_ip_block_version ras_v1_0_ip_block = {
|
||||
.type = AMD_IP_BLOCK_TYPE_RAS,
|
||||
.major = 1,
|
||||
.minor = 0,
|
||||
.rev = 0,
|
||||
.funcs = &ras_v1_0_ip_funcs,
|
||||
};
|
||||
|
||||
int amdgpu_enable_uniras(struct amdgpu_device *adev, bool enable)
|
||||
{
|
||||
struct amdgpu_ras_mgr *ras_mgr = amdgpu_ras_mgr_get_context(adev);
|
||||
|
||||
@@ -54,6 +54,8 @@ struct amdgpu_ras_mgr {
|
||||
bool ras_is_ready;
|
||||
};
|
||||
|
||||
extern const struct amdgpu_ip_block_version ras_v1_0_ip_block;
|
||||
|
||||
struct amdgpu_ras_mgr *amdgpu_ras_mgr_get_context(
|
||||
struct amdgpu_device *adev);
|
||||
int amdgpu_enable_uniras(struct amdgpu_device *adev, bool enable);
|
||||
|
||||
Reference in New Issue
Block a user