Commit edec7149 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/core: remove previous versioned fw loader

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 9d350c5e
......@@ -4,10 +4,7 @@
#include <core/option.h>
#include <core/subdev.h>
int nvkm_firmware_get_version(const struct nvkm_subdev *, const char *fwname,
int min_version, int max_version,
const struct firmware **);
int nvkm_firmware_get(const struct nvkm_subdev *, const char *fwname,
int nvkm_firmware_get(const struct nvkm_subdev *, const char *fwname, int ver,
const struct firmware **);
void nvkm_firmware_put(const struct firmware *);
......
......@@ -30,7 +30,7 @@ nvkm_firmware_load_name(const struct nvkm_subdev *subdev, const char *base,
int ret;
snprintf(path, sizeof(path), "%s%s", base, name);
ret = nvkm_firmware_get_version(subdev, path, ver, ver, pfw);
ret = nvkm_firmware_get(subdev, path, ver, pfw);
if (ret < 0)
return ret;
......@@ -66,8 +66,7 @@ nvkm_firmware_load_blob(const struct nvkm_subdev *subdev, const char *base,
* Firmware files released by NVIDIA will always follow this format.
*/
int
nvkm_firmware_get_version(const struct nvkm_subdev *subdev, const char *fwname,
int min_version, int max_version,
nvkm_firmware_get(const struct nvkm_subdev *subdev, const char *fwname, int ver,
const struct firmware **fw)
{
struct nvkm_device *device = subdev->device;
......@@ -84,32 +83,21 @@ nvkm_firmware_get_version(const struct nvkm_subdev *subdev, const char *fwname,
cname[i] = tolower(cname[i]);
}
for (i = max_version; i >= min_version; i--) {
if (i != 0)
snprintf(f, sizeof(f), "nvidia/%s/%s-%d.bin", cname, fwname, i);
if (ver != 0)
snprintf(f, sizeof(f), "nvidia/%s/%s-%d.bin", cname, fwname, ver);
else
snprintf(f, sizeof(f), "nvidia/%s/%s.bin", cname, fwname);
if (!firmware_request_nowarn(fw, f, device->dev)) {
nvkm_debug(subdev, "firmware \"%s\" loaded - "
"%zu byte(s)\n", f, (*fw)->size);
return i;
nvkm_debug(subdev, "firmware \"%s\" loaded - %zu byte(s)\n",
f, (*fw)->size);
return 0;
}
nvkm_debug(subdev, "firmware \"%s\" unavailable\n", f);
}
nvkm_error(subdev, "failed to load firmware \"%s\"\n", fwname);
return -ENOENT;
}
int
nvkm_firmware_get(const struct nvkm_subdev *subdev, const char *fwname,
const struct firmware **fw)
{
return nvkm_firmware_get_version(subdev, fwname, 0, 0, fw);
}
/**
* nvkm_firmware_put - release firmware loaded with nvkm_firmware_get
*/
......
......@@ -357,8 +357,7 @@ nvkm_acr_ctor_wpr(struct nvkm_acr *acr, int ver)
struct nvkm_device *device = subdev->device;
int ret;
ret = nvkm_firmware_get_version(subdev, "acr/wpr", ver, ver,
&acr->wpr_fw);
ret = nvkm_firmware_get(subdev, "acr/wpr", ver, &acr->wpr_fw);
if (ret < 0)
return ret;
......
......@@ -58,7 +58,7 @@ nvkm_acr_hsfw_load_image(struct nvkm_acr *acr, const char *name, int ver,
u32 loc, sig;
int ret;
ret = nvkm_firmware_get_version(subdev, name, ver, ver, &fw);
ret = nvkm_firmware_get(subdev, name, ver, &fw);
if (ret < 0)
return ret;
......@@ -136,7 +136,7 @@ nvkm_acr_hsfw_load_bl(struct nvkm_acr *acr, const char *name, int ver,
u8 *data;
int ret;
ret = nvkm_firmware_get_version(subdev, name, ver, ver, &fw);
ret = nvkm_firmware_get(subdev, name, ver, &fw);
if (ret)
return ret;
......
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