drm/nouveau/secboot/gp10[2467]: support newer FW to fix SEC2 failures on some boards
authorBen Skeggs <bskeggs@redhat.com>
Thu, 6 Jun 2019 06:28:35 +0000 (16:28 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 7 Jun 2019 05:13:58 +0000 (15:13 +1000)
Some newer boards with these chipsets aren't compatible with the prior
version of the SEC2 FW, and fail to load as a result.

This newer FW is actually the one we already use on >=GP108.

Unfortunately, there are interface differences in GP108's FW, making it
impossible to simply move files around in linux-firmware to solve this.

We need to be able to keep compatibility with all linux-firmware/kernel
combinations, which means supporting both firmwares.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r361.c
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r361.h
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r367.c
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r370.c
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r370.h

index 71f85b1..f6b2d20 100644 (file)
@@ -188,13 +188,13 @@ acr_r361_generate_sec2_bl_desc(const struct nvkm_acr *acr,
        desc->argv = 0x01000000;
 }
 
-static const struct acr_r352_lsf_func
+const struct acr_r352_lsf_func
 acr_r361_ls_sec2_func_0 = {
        .generate_bl_desc = acr_r361_generate_sec2_bl_desc,
        .bl_desc_size = sizeof(struct acr_r361_pmu_bl_desc),
 };
 
-const struct acr_r352_ls_func
+static const struct acr_r352_ls_func
 acr_r361_ls_sec2_func = {
        .load = acr_ls_ucode_load_sec2,
        .post_run = acr_ls_sec2_post_run,
index f9f978d..38dec93 100644 (file)
@@ -67,6 +67,5 @@ void acr_r361_generate_hs_bl_desc(const struct hsf_load_header *, void *, u64);
 extern const struct acr_r352_ls_func acr_r361_ls_fecs_func;
 extern const struct acr_r352_ls_func acr_r361_ls_gpccs_func;
 extern const struct acr_r352_ls_func acr_r361_ls_pmu_func;
-extern const struct acr_r352_ls_func acr_r361_ls_sec2_func;
-
+extern const struct acr_r352_lsf_func acr_r361_ls_sec2_func_0;
 #endif
index fe20a09..472ced2 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "acr_r367.h"
 #include "acr_r361.h"
+#include "acr_r370.h"
 
 #include <core/gpuobj.h>
 
@@ -381,6 +382,17 @@ acr_r367_fixup_hs_desc(struct acr_r352 *acr, struct nvkm_secboot *sb,
        }
 }
 
+static const struct acr_r352_ls_func
+acr_r367_ls_sec2_func = {
+       .load = acr_ls_ucode_load_sec2,
+       .post_run = acr_ls_sec2_post_run,
+       .version_max = 1,
+       .version = {
+               &acr_r361_ls_sec2_func_0,
+               &acr_r370_ls_sec2_func_0,
+       }
+};
+
 const struct acr_r352_func
 acr_r367_func = {
        .fixup_hs_desc = acr_r367_fixup_hs_desc,
@@ -394,7 +406,7 @@ acr_r367_func = {
                [NVKM_SECBOOT_FALCON_FECS] = &acr_r361_ls_fecs_func,
                [NVKM_SECBOOT_FALCON_GPCCS] = &acr_r361_ls_gpccs_func,
                [NVKM_SECBOOT_FALCON_PMU] = &acr_r361_ls_pmu_func,
-               [NVKM_SECBOOT_FALCON_SEC2] = &acr_r361_ls_sec2_func,
+               [NVKM_SECBOOT_FALCON_SEC2] = &acr_r367_ls_sec2_func,
        },
 };
 
index ff52d40..e821d0f 100644 (file)
@@ -111,7 +111,7 @@ acr_r370_generate_sec2_bl_desc(const struct nvkm_acr *acr,
        desc->argv = 0x01000000;
 }
 
-static const struct acr_r352_lsf_func
+const struct acr_r352_lsf_func
 acr_r370_ls_sec2_func_0 = {
        .generate_bl_desc = acr_r370_generate_sec2_bl_desc,
        .bl_desc_size = sizeof(struct acr_r370_flcn_bl_desc),
index 3426f86..2efed6f 100644 (file)
@@ -46,4 +46,5 @@ struct acr_r370_flcn_bl_desc {
 void acr_r370_generate_hs_bl_desc(const struct hsf_load_header *, void *, u64);
 extern const struct acr_r352_ls_func acr_r370_ls_fecs_func;
 extern const struct acr_r352_ls_func acr_r370_ls_gpccs_func;
+extern const struct acr_r352_lsf_func acr_r370_ls_sec2_func_0;
 #endif