Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Add kicker device detection

1. add kicker device list
2. add kicker device checking helper function

Signed-off-by: Frank Min <Frank.Min@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 09aa2b408f4ab689c3541d22b0968de0392ee406)
Cc: stable@vger.kernel.org

authored by

Frank Min and committed by
Alex Deucher
0bbf5fd8 16dc8bc2

+23
+17
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
··· 30 30 31 31 #define AMDGPU_UCODE_NAME_MAX (128) 32 32 33 + static const struct kicker_device kicker_device_list[] = { 34 + {0x744B, 0x00}, 35 + }; 36 + 33 37 static void amdgpu_ucode_print_common_hdr(const struct common_firmware_header *hdr) 34 38 { 35 39 DRM_DEBUG("size_bytes: %u\n", le32_to_cpu(hdr->size_bytes)); ··· 1389 1385 } 1390 1386 } 1391 1387 return NULL; 1388 + } 1389 + 1390 + bool amdgpu_is_kicker_fw(struct amdgpu_device *adev) 1391 + { 1392 + int i; 1393 + 1394 + for (i = 0; i < ARRAY_SIZE(kicker_device_list); i++) { 1395 + if (adev->pdev->device == kicker_device_list[i].device && 1396 + adev->pdev->revision == kicker_device_list[i].revision) 1397 + return true; 1398 + } 1399 + 1400 + return false; 1392 1401 } 1393 1402 1394 1403 void amdgpu_ucode_ip_version_decode(struct amdgpu_device *adev, int block_type, char *ucode_prefix, int len)
+6
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h
··· 605 605 uint32_t pldm_version; 606 606 }; 607 607 608 + struct kicker_device{ 609 + unsigned short device; 610 + u8 revision; 611 + }; 612 + 608 613 void amdgpu_ucode_print_mc_hdr(const struct common_firmware_header *hdr); 609 614 void amdgpu_ucode_print_smc_hdr(const struct common_firmware_header *hdr); 610 615 void amdgpu_ucode_print_imu_hdr(const struct common_firmware_header *hdr); ··· 637 632 const char *amdgpu_ucode_name(enum AMDGPU_UCODE_ID ucode_id); 638 633 639 634 void amdgpu_ucode_ip_version_decode(struct amdgpu_device *adev, int block_type, char *ucode_prefix, int len); 635 + bool amdgpu_is_kicker_fw(struct amdgpu_device *adev); 640 636 641 637 #endif