]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
Merge tag 'csky-for-linus-5.3-rc1' of git://github.com/c-sky/csky-linux
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_ucode.c
index 04d007db06f702d58254ded9305f4b27834e1b3f..c352a519ddd4f365081fc5ea1c1479a570db54e5 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/firmware.h>
 #include <linux/slab.h>
 #include <linux/module.h>
-#include <drm/drmP.h>
+
 #include "amdgpu.h"
 #include "amdgpu_ucode.h"
 
@@ -77,6 +77,14 @@ void amdgpu_ucode_print_smc_hdr(const struct common_firmware_header *hdr)
                        container_of(hdr, struct smc_firmware_header_v1_0, header);
 
                DRM_DEBUG("ucode_start_addr: %u\n", le32_to_cpu(smc_hdr->ucode_start_addr));
+       } else if (version_major == 2) {
+               const struct smc_firmware_header_v1_0 *v1_hdr =
+                       container_of(hdr, struct smc_firmware_header_v1_0, header);
+               const struct smc_firmware_header_v2_0 *v2_hdr =
+                       container_of(v1_hdr, struct smc_firmware_header_v2_0, v1_0);
+
+               DRM_INFO("ppt_offset_bytes: %u\n", le32_to_cpu(v2_hdr->ppt_offset_bytes));
+               DRM_INFO("ppt_size_bytes: %u\n", le32_to_cpu(v2_hdr->ppt_size_bytes));
        } else {
                DRM_ERROR("Unknown SMC ucode version: %u.%u\n", version_major, version_minor);
        }
@@ -245,6 +253,16 @@ void amdgpu_ucode_print_psp_hdr(const struct common_firmware_header *hdr)
                          le32_to_cpu(psp_hdr->sos_offset_bytes));
                DRM_DEBUG("sos_size_bytes: %u\n",
                          le32_to_cpu(psp_hdr->sos_size_bytes));
+               if (version_minor == 1) {
+                       const struct psp_firmware_header_v1_1 *psp_hdr_v1_1 =
+                               container_of(psp_hdr, struct psp_firmware_header_v1_1, v1_0);
+                       DRM_DEBUG("toc_header_version: %u\n",
+                                 le32_to_cpu(psp_hdr_v1_1->toc_header_version));
+                       DRM_DEBUG("toc_offset_bytes: %u\n",
+                                 le32_to_cpu(psp_hdr_v1_1->toc_offset_bytes));
+                       DRM_DEBUG("toc_size_bytes: %u\n",
+                                 le32_to_cpu(psp_hdr_v1_1->toc_size_bytes));
+               }
        } else {
                DRM_ERROR("Unknown PSP ucode version: %u.%u\n",
                          version_major, version_minor);
@@ -326,12 +344,11 @@ amdgpu_ucode_get_load_type(struct amdgpu_device *adev, int load_type)
        case CHIP_RAVEN:
        case CHIP_VEGA12:
        case CHIP_VEGA20:
+       case CHIP_NAVI10:
                if (!load_type)
                        return AMDGPU_FW_LOAD_DIRECT;
                else
                        return AMDGPU_FW_LOAD_PSP;
-       case CHIP_NAVI10:
-               return AMDGPU_FW_LOAD_DIRECT;
        default:
                DRM_ERROR("Unknown firmware load type\n");
        }
This page took 0.036435 seconds and 4 git commands to generate.