Skip to content

Commit b9e75bc

Browse files
Lijo Lazaralexdeucher
authored andcommitted
drm/amdgpu: Remove unsupported xgmi versions
XGMI v4.8.0 is not used in any SOCs. Remove the associated functions. Also, ensure get_xgmi_info callback pointer is not NULL before calling the function. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 16fbc18 commit b9e75bc

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2772,9 +2772,6 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
27722772
break;
27732773
}
27742774

2775-
if (amdgpu_ip_version(adev, XGMI_HWIP, 0) == IP_VERSION(4, 8, 0))
2776-
adev->gmc.xgmi.supported = true;
2777-
27782775
if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 3) ||
27792776
amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 4))
27802777
adev->ip_versions[XGMI_HWIP][0] = IP_VERSION(6, 4, 0);

drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -505,42 +505,6 @@ static void gfxhub_v2_1_init(struct amdgpu_device *adev)
505505
hub->vmhub_funcs = &gfxhub_v2_1_vmhub_funcs;
506506
}
507507

508-
static int gfxhub_v2_1_get_xgmi_info(struct amdgpu_device *adev)
509-
{
510-
u32 xgmi_lfb_cntl = RREG32_SOC15(GC, 0, mmGCMC_VM_XGMI_LFB_CNTL);
511-
u32 max_region =
512-
REG_GET_FIELD(xgmi_lfb_cntl, GCMC_VM_XGMI_LFB_CNTL, PF_MAX_REGION);
513-
u32 max_num_physical_nodes = 0;
514-
u32 max_physical_node_id = 0;
515-
516-
switch (amdgpu_ip_version(adev, XGMI_HWIP, 0)) {
517-
case IP_VERSION(4, 8, 0):
518-
max_num_physical_nodes = 4;
519-
max_physical_node_id = 3;
520-
break;
521-
default:
522-
return -EINVAL;
523-
}
524-
525-
/* PF_MAX_REGION=0 means xgmi is disabled */
526-
if (max_region) {
527-
adev->gmc.xgmi.num_physical_nodes = max_region + 1;
528-
if (adev->gmc.xgmi.num_physical_nodes > max_num_physical_nodes)
529-
return -EINVAL;
530-
531-
adev->gmc.xgmi.physical_node_id =
532-
REG_GET_FIELD(xgmi_lfb_cntl, GCMC_VM_XGMI_LFB_CNTL, PF_LFB_REGION);
533-
if (adev->gmc.xgmi.physical_node_id > max_physical_node_id)
534-
return -EINVAL;
535-
536-
adev->gmc.xgmi.node_segment_size = REG_GET_FIELD(
537-
RREG32_SOC15(GC, 0, mmGCMC_VM_XGMI_LFB_SIZE),
538-
GCMC_VM_XGMI_LFB_SIZE, PF_LFB_SIZE) << 24;
539-
}
540-
541-
return 0;
542-
}
543-
544508
static void gfxhub_v2_1_utcl2_harvest(struct amdgpu_device *adev)
545509
{
546510
int i;
@@ -696,7 +660,6 @@ const struct amdgpu_gfxhub_funcs gfxhub_v2_1_funcs = {
696660
.gart_disable = gfxhub_v2_1_gart_disable,
697661
.set_fault_enable_default = gfxhub_v2_1_set_fault_enable_default,
698662
.init = gfxhub_v2_1_init,
699-
.get_xgmi_info = gfxhub_v2_1_get_xgmi_info,
700663
.utcl2_harvest = gfxhub_v2_1_utcl2_harvest,
701664
.mode2_save_regs = gfxhub_v2_1_save_regs,
702665
.mode2_restore_regs = gfxhub_v2_1_restore_regs,

0 commit comments

Comments
 (0)