Skip to content

Commit 80a0e82

Browse files
committed
drm/amdgpu/discovery: optionally use fw based ip discovery
On chips without native IP discovery support, use the fw binary if available, otherwise we can continue without it. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Flora Cui <flora.cui@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 25f602f commit 80a0e82

File tree

1 file changed

+32
-8
lines changed

1 file changed

+32
-8
lines changed

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

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,6 +2545,38 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
25452545
{
25462546
int r;
25472547

2548+
switch (adev->asic_type) {
2549+
case CHIP_VEGA10:
2550+
case CHIP_VEGA12:
2551+
case CHIP_RAVEN:
2552+
case CHIP_VEGA20:
2553+
case CHIP_ARCTURUS:
2554+
case CHIP_ALDEBARAN:
2555+
/* this is not fatal. We have a fallback below
2556+
* if the new firmwares are not present. some of
2557+
* this will be overridden below to keep things
2558+
* consistent with the current behavior.
2559+
*/
2560+
r = amdgpu_discovery_reg_base_init(adev);
2561+
if (!r) {
2562+
amdgpu_discovery_harvest_ip(adev);
2563+
amdgpu_discovery_get_gfx_info(adev);
2564+
amdgpu_discovery_get_mall_info(adev);
2565+
amdgpu_discovery_get_vcn_info(adev);
2566+
}
2567+
break;
2568+
default:
2569+
r = amdgpu_discovery_reg_base_init(adev);
2570+
if (r)
2571+
return -EINVAL;
2572+
2573+
amdgpu_discovery_harvest_ip(adev);
2574+
amdgpu_discovery_get_gfx_info(adev);
2575+
amdgpu_discovery_get_mall_info(adev);
2576+
amdgpu_discovery_get_vcn_info(adev);
2577+
break;
2578+
}
2579+
25482580
switch (adev->asic_type) {
25492581
case CHIP_VEGA10:
25502582
vega10_reg_base_init(adev);
@@ -2709,14 +2741,6 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
27092741
adev->ip_versions[XGMI_HWIP][0] = IP_VERSION(6, 1, 0);
27102742
break;
27112743
default:
2712-
r = amdgpu_discovery_reg_base_init(adev);
2713-
if (r)
2714-
return -EINVAL;
2715-
2716-
amdgpu_discovery_harvest_ip(adev);
2717-
amdgpu_discovery_get_gfx_info(adev);
2718-
amdgpu_discovery_get_mall_info(adev);
2719-
amdgpu_discovery_get_vcn_info(adev);
27202744
break;
27212745
}
27222746

0 commit comments

Comments
 (0)