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