]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amdgpu/discovery: optionally use fw based ip discovery
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Mar 2025 22:00:57 +0000 (18:00 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 21 Mar 2025 16:16:36 +0000 (12:16 -0400)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

index 4125d2da704106b23ae702ffa23e35b0f2fac5c5..dc2713ec95a5bdab8b0b06150b0a3e721f6a4a62 100644 (file)
@@ -2545,6 +2545,38 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
 {
        int r;
 
+       switch (adev->asic_type) {
+       case CHIP_VEGA10:
+       case CHIP_VEGA12:
+       case CHIP_RAVEN:
+       case CHIP_VEGA20:
+       case CHIP_ARCTURUS:
+       case CHIP_ALDEBARAN:
+               /* this is not fatal.  We have a fallback below
+                * if the new firmwares are not present. some of
+                * this will be overridden below to keep things
+                * consistent with the current behavior.
+                */
+               r = amdgpu_discovery_reg_base_init(adev);
+               if (!r) {
+                       amdgpu_discovery_harvest_ip(adev);
+                       amdgpu_discovery_get_gfx_info(adev);
+                       amdgpu_discovery_get_mall_info(adev);
+                       amdgpu_discovery_get_vcn_info(adev);
+               }
+               break;
+       default:
+               r = amdgpu_discovery_reg_base_init(adev);
+               if (r)
+                       return -EINVAL;
+
+               amdgpu_discovery_harvest_ip(adev);
+               amdgpu_discovery_get_gfx_info(adev);
+               amdgpu_discovery_get_mall_info(adev);
+               amdgpu_discovery_get_vcn_info(adev);
+               break;
+       }
+
        switch (adev->asic_type) {
        case CHIP_VEGA10:
                vega10_reg_base_init(adev);
@@ -2709,14 +2741,6 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
                adev->ip_versions[XGMI_HWIP][0] = IP_VERSION(6, 1, 0);
                break;
        default:
-               r = amdgpu_discovery_reg_base_init(adev);
-               if (r)
-                       return -EINVAL;
-
-               amdgpu_discovery_harvest_ip(adev);
-               amdgpu_discovery_get_gfx_info(adev);
-               amdgpu_discovery_get_mall_info(adev);
-               amdgpu_discovery_get_vcn_info(adev);
                break;
        }