[PATCH v2 6/8] drm/amdgpu: Add PSP public function to load a list of FWs

Lazar, Lijo Lijo.Lazar at amd.com
Mon Mar 22 05:57:53 UTC 2021


[AMD Public Use]

v1: Adds a function to load a list of FWs as passed by the caller. This is
needed as only a select need to loaded for some use cases.

v2: Omit unrelated change, remove info log, fix return value when count is 0

Signed-off-by: Lijo Lazar lijo.lazar at amd.com<mailto:lijo.lazar at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 16 ++++++++++++++++
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h |  3 +++
2 files changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index c2b7ee693719..60dbb8c1e74d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -2204,6 +2204,22 @@ static bool fw_load_skip_check(struct psp_context *psp,
               return false;
}
+int psp_load_fw_list(struct psp_context *psp,
+                                  struct amdgpu_firmware_info **ucode_list, int ucode_count)
+{
+             int ret = 0, i;
+             struct amdgpu_firmware_info *ucode;
+
+             for (i = 0; i < ucode_count; ++i) {
+                             ucode = ucode_list[i];
+                             psp_print_fw_hdr(psp, ucode);
+                             ret = psp_execute_np_fw_load(psp, ucode);
+                             if (ret)
+                                             return ret;
+             }
+             return ret;
+}
+
static int psp_np_fw_load(struct psp_context *psp)
{
               int i, ret;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
index 64f143390835..46a5328e00e0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
@@ -420,4 +420,7 @@ int psp_init_ta_microcode(struct psp_context *psp,
                                                 const char *chip_name);
int psp_get_fw_attestation_records_addr(struct psp_context *psp,
                                                                               uint64_t *output_ptr);
+
+int psp_load_fw_list(struct psp_context *psp,
+                                  struct amdgpu_firmware_info **ucode_list, int ucode_count);
#endif
--
2.17.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20210322/aaaf6965/attachment.htm>


More information about the amd-gfx mailing list