drm/nouveau/acr: allow module to load when HSFW(s) are missing

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
Ben Skeggs 2020-06-16 10:47:07 +10:00
parent 8fdc45e4b6
commit 90e9cf749a
7 changed files with 25 additions and 6 deletions

View File

@ -32,6 +32,17 @@
#include <nvfw/acr.h>
#include <nvfw/flcn.h>
const struct nvkm_acr_func
gm200_acr = {
};
int
gm200_acr_nofw(struct nvkm_acr *acr, int ver, const struct nvkm_acr_fwif *fwif)
{
nvkm_warn(&acr->subdev, "firmware unavailable\n");
return 0;
}
int
gm200_acr_init(struct nvkm_acr *acr)
{
@ -425,7 +436,7 @@ gm200_acr_load_fwif[] = {
};
static const struct nvkm_acr_func
gm200_acr = {
gm200_acr_0 = {
.load = gm200_acr_load_fwif,
.unload = gm200_acr_unload_fwif,
.wpr_parse = gm200_acr_wpr_parse,
@ -459,7 +470,8 @@ gm200_acr_load(struct nvkm_acr *acr, int ver, const struct nvkm_acr_fwif *fwif)
static const struct nvkm_acr_fwif
gm200_acr_fwif[] = {
{ 0, gm200_acr_load, &gm200_acr },
{ 0, gm200_acr_load, &gm200_acr_0 },
{ -1, gm200_acr_nofw, &gm200_acr },
{}
};

View File

@ -123,7 +123,8 @@ gm20b_acr_load(struct nvkm_acr *acr, int ver, const struct nvkm_acr_fwif *fwif)
static const struct nvkm_acr_fwif
gm20b_acr_fwif[] = {
{ 0, gm20b_acr_load, &gm20b_acr },
{ 0, gm20b_acr_load, &gm20b_acr },
{ -1, gm200_acr_nofw, &gm200_acr },
{}
};

View File

@ -270,7 +270,8 @@ gp102_acr_load(struct nvkm_acr *acr, int ver, const struct nvkm_acr_fwif *fwif)
static const struct nvkm_acr_fwif
gp102_acr_fwif[] = {
{ 0, gp102_acr_load, &gp102_acr },
{ 0, gp102_acr_load, &gp102_acr },
{ -1, gm200_acr_nofw, &gm200_acr },
{}
};

View File

@ -100,7 +100,8 @@ gp108_acr = {
static const struct nvkm_acr_fwif
gp108_acr_fwif[] = {
{ 0, gp102_acr_load, &gp108_acr },
{ 0, gp102_acr_load, &gp108_acr },
{ -1, gm200_acr_nofw, &gm200_acr },
{}
};

View File

@ -46,7 +46,8 @@ gp10b_acr = {
static const struct nvkm_acr_fwif
gp10b_acr_fwif[] = {
{ 0, gm20b_acr_load, &gp10b_acr },
{ 0, gm20b_acr_load, &gp10b_acr },
{ -1, gm200_acr_nofw, &gm200_acr },
{}
};

View File

@ -10,6 +10,7 @@ struct nvkm_acr_fwif {
const struct nvkm_acr_func *func;
};
int gm200_acr_nofw(struct nvkm_acr *, int, const struct nvkm_acr_fwif *);
int gm20b_acr_load(struct nvkm_acr *, int, const struct nvkm_acr_fwif *);
int gp102_acr_load(struct nvkm_acr *, int, const struct nvkm_acr_fwif *);
@ -29,6 +30,7 @@ struct nvkm_acr_func {
void (*fini)(struct nvkm_acr *);
};
extern const struct nvkm_acr_func gm200_acr;
int gm200_acr_wpr_parse(struct nvkm_acr *);
u32 gm200_acr_wpr_layout(struct nvkm_acr *);
int gm200_acr_wpr_build(struct nvkm_acr *, struct nvkm_acr_lsf *);

View File

@ -219,6 +219,7 @@ tu102_acr_load(struct nvkm_acr *acr, int version,
static const struct nvkm_acr_fwif
tu102_acr_fwif[] = {
{ 0, tu102_acr_load, &tu102_acr },
{ -1, gm200_acr_nofw, &gm200_acr },
{}
};