Commit 9352ce37 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/secboot: enable loading of versioned LS PMU/SEC2 ACR msgqueue FW

Some chipsets will be switching to updated SEC2 LS firmware, so we need to
plumb that through.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 5f0f8b57
...@@ -43,28 +43,28 @@ acr_ls_ucode_load_msgqueue(const struct nvkm_subdev *subdev, const char *name, ...@@ -43,28 +43,28 @@ acr_ls_ucode_load_msgqueue(const struct nvkm_subdev *subdev, const char *name,
{ {
const struct firmware *image, *desc, *sig; const struct firmware *image, *desc, *sig;
char f[64]; char f[64];
int ret; int ver, ret;
snprintf(f, sizeof(f), "%s/image", name); snprintf(f, sizeof(f), "%s/image", name);
ret = nvkm_firmware_get(subdev, f, &image); ver = nvkm_firmware_get_version(subdev, f, 0, maxver, &image);
if (ret) if (ver < 0)
return ret; return ver;
img->ucode_data = kmemdup(image->data, image->size, GFP_KERNEL); img->ucode_data = kmemdup(image->data, image->size, GFP_KERNEL);
nvkm_firmware_put(image); nvkm_firmware_put(image);
if (!img->ucode_data) if (!img->ucode_data)
return -ENOMEM; return -ENOMEM;
snprintf(f, sizeof(f), "%s/desc", name); snprintf(f, sizeof(f), "%s/desc", name);
ret = nvkm_firmware_get(subdev, f, &desc); ret = nvkm_firmware_get_version(subdev, f, ver, ver, &desc);
if (ret) if (ret < 0)
return ret; return ret;
memcpy(&img->ucode_desc, desc->data, sizeof(img->ucode_desc)); memcpy(&img->ucode_desc, desc->data, sizeof(img->ucode_desc));
img->ucode_size = ALIGN(img->ucode_desc.app_start_offset + img->ucode_desc.app_size, 256); img->ucode_size = ALIGN(img->ucode_desc.app_start_offset + img->ucode_desc.app_size, 256);
nvkm_firmware_put(desc); nvkm_firmware_put(desc);
snprintf(f, sizeof(f), "%s/sig", name); snprintf(f, sizeof(f), "%s/sig", name);
ret = nvkm_firmware_get(subdev, f, &sig); ret = nvkm_firmware_get_version(subdev, f, ver, ver, &sig);
if (ret) if (ret < 0)
return ret; return ret;
img->sig_size = sig->size; img->sig_size = sig->size;
img->sig = kmemdup(sig->data, sig->size, GFP_KERNEL); img->sig = kmemdup(sig->data, sig->size, GFP_KERNEL);
...@@ -72,7 +72,7 @@ acr_ls_ucode_load_msgqueue(const struct nvkm_subdev *subdev, const char *name, ...@@ -72,7 +72,7 @@ acr_ls_ucode_load_msgqueue(const struct nvkm_subdev *subdev, const char *name,
if (!img->sig) if (!img->sig)
return -ENOMEM; return -ENOMEM;
return 0; return ver;
} }
static int static int
...@@ -141,11 +141,11 @@ acr_ls_ucode_load_sec2(const struct nvkm_secboot *sb, int maxver, ...@@ -141,11 +141,11 @@ acr_ls_ucode_load_sec2(const struct nvkm_secboot *sb, int maxver,
struct ls_ucode_img *img) struct ls_ucode_img *img)
{ {
struct nvkm_sec2 *sec = sb->subdev.device->sec2; struct nvkm_sec2 *sec = sb->subdev.device->sec2;
int ret; int ver, ret;
ret = acr_ls_ucode_load_msgqueue(&sb->subdev, "sec2", maxver, img); ver = acr_ls_ucode_load_msgqueue(&sb->subdev, "sec2", maxver, img);
if (ret) if (ver < 0)
return ret; return ver;
/* Allocate the PMU queue corresponding to the FW version */ /* Allocate the PMU queue corresponding to the FW version */
ret = nvkm_msgqueue_new(img->ucode_desc.app_version, sec->falcon, ret = nvkm_msgqueue_new(img->ucode_desc.app_version, sec->falcon,
...@@ -153,7 +153,7 @@ acr_ls_ucode_load_sec2(const struct nvkm_secboot *sb, int maxver, ...@@ -153,7 +153,7 @@ acr_ls_ucode_load_sec2(const struct nvkm_secboot *sb, int maxver,
if (ret) if (ret)
return ret; return ret;
return 0; return ver;
} }
int int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment