]> Git Repo - linux.git/commitdiff
drm/amdgpu: Use discovery table's subrevision
authorLijo Lazar <[email protected]>
Thu, 12 Oct 2023 09:39:38 +0000 (15:09 +0530)
committerAlex Deucher <[email protected]>
Thu, 26 Oct 2023 23:02:44 +0000 (19:02 -0400)
Use subrevision of IP version in discovery table to identify SOC
revision id for NBIO v7.9 SOCs. Only newer bootloaders update
subrevision field.

Signed-off-by: Lijo Lazar <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Reviewed-by: Le Ma <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c

index eccb006e78aa130881c91ffc4c946c734213b0dd..23f26f8caad4cf4ebd4e9e7eac7c17165c4c5945 100644 (file)
@@ -56,8 +56,15 @@ static u32 nbio_v7_9_get_rev_id(struct amdgpu_device *adev)
 {
        u32 tmp;
 
+       tmp = IP_VERSION_SUBREV(amdgpu_ip_version_full(adev, NBIO_HWIP, 0));
+       /* If it is VF or subrevision holds a non-zero value, that should be used */
+       if (tmp || amdgpu_sriov_vf(adev))
+               return tmp;
+
+       /* If discovery subrev is not updated, use register version */
        tmp = RREG32_SOC15(NBIO, 0, regRCC_STRAP0_RCC_DEV0_EPF0_STRAP0);
-       tmp = REG_GET_FIELD(tmp, RCC_STRAP0_RCC_DEV0_EPF0_STRAP0, STRAP_ATI_REV_ID_DEV0_F0);
+       tmp = REG_GET_FIELD(tmp, RCC_STRAP0_RCC_DEV0_EPF0_STRAP0,
+                           STRAP_ATI_REV_ID_DEV0_F0);
 
        return tmp;
 }
This page took 0.058594 seconds and 4 git commands to generate.