2020-01-15 06:34:21 +10:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
|
|
|
#ifndef __NVKM_GSP_PRIV_H__
|
|
|
|
#define __NVKM_GSP_PRIV_H__
|
|
|
|
#include <subdev/gsp.h>
|
2025-02-15 02:55:45 +10:00
|
|
|
#include <rm/gpu.h>
|
2020-01-15 06:34:21 +10:00
|
|
|
enum nvkm_acr_lsf_id;
|
|
|
|
|
2023-09-19 06:21:37 +10:00
|
|
|
int nvkm_gsp_fwsec_frts(struct nvkm_gsp *);
|
|
|
|
int nvkm_gsp_fwsec_sb(struct nvkm_gsp *);
|
|
|
|
|
2020-01-15 06:34:21 +10:00
|
|
|
struct nvkm_gsp_fwif {
|
|
|
|
int version;
|
|
|
|
int (*load)(struct nvkm_gsp *, int ver, const struct nvkm_gsp_fwif *);
|
2022-06-01 20:47:47 +10:00
|
|
|
const struct nvkm_gsp_func *func;
|
2025-02-15 02:55:45 +10:00
|
|
|
const struct nvkm_rm_impl *rm;
|
2023-09-19 06:21:37 +10:00
|
|
|
const char *ver;
|
|
|
|
bool enable;
|
2020-01-15 06:34:21 +10:00
|
|
|
};
|
|
|
|
|
2025-02-04 08:38:19 +10:00
|
|
|
int nvkm_gsp_load_fw(struct nvkm_gsp *, const char *name, const char *ver,
|
|
|
|
const struct firmware **);
|
|
|
|
void nvkm_gsp_dtor_fws(struct nvkm_gsp *);
|
|
|
|
|
2023-09-19 06:21:09 +10:00
|
|
|
int gv100_gsp_nofw(struct nvkm_gsp *, int, const struct nvkm_gsp_fwif *);
|
2024-11-25 10:21:18 +10:00
|
|
|
|
2025-02-04 08:38:19 +10:00
|
|
|
int tu102_gsp_load(struct nvkm_gsp *, int, const struct nvkm_gsp_fwif *);
|
2024-11-25 10:21:18 +10:00
|
|
|
int tu102_gsp_load_rm(struct nvkm_gsp *, const struct nvkm_gsp_fwif *);
|
2025-02-04 08:38:19 +10:00
|
|
|
|
2024-11-25 10:27:02 +10:00
|
|
|
int gh100_gsp_load(struct nvkm_gsp *, int, const struct nvkm_gsp_fwif *);
|
|
|
|
|
2025-02-04 08:38:19 +10:00
|
|
|
#define NVKM_GSP_FIRMWARE_BOOTER(chip,vers) \
|
|
|
|
MODULE_FIRMWARE("nvidia/"#chip"/gsp/booter_load-"#vers".bin"); \
|
|
|
|
MODULE_FIRMWARE("nvidia/"#chip"/gsp/booter_unload-"#vers".bin"); \
|
|
|
|
MODULE_FIRMWARE("nvidia/"#chip"/gsp/bootloader-"#vers".bin"); \
|
|
|
|
MODULE_FIRMWARE("nvidia/"#chip"/gsp/gsp-"#vers".bin")
|
2023-09-19 06:21:09 +10:00
|
|
|
|
2024-11-25 10:21:18 +10:00
|
|
|
#define NVKM_GSP_FIRMWARE_FMC(chip,vers) \
|
|
|
|
MODULE_FIRMWARE("nvidia/"#chip"/gsp/fmc-"#vers".bin"); \
|
|
|
|
MODULE_FIRMWARE("nvidia/"#chip"/gsp/bootloader-"#vers".bin"); \
|
|
|
|
MODULE_FIRMWARE("nvidia/"#chip"/gsp/gsp-"#vers".bin")
|
|
|
|
|
2023-09-19 06:21:09 +10:00
|
|
|
struct nvkm_gsp_func {
|
|
|
|
const struct nvkm_falcon_func *flcn;
|
2023-09-19 06:21:37 +10:00
|
|
|
const struct nvkm_falcon_fw_func *fwsec;
|
|
|
|
|
|
|
|
char *sig_section;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
int (*ctor)(struct nvkm_gsp *, const char *name, const struct firmware *,
|
|
|
|
struct nvkm_falcon *, struct nvkm_falcon_fw *);
|
|
|
|
} booter;
|
2023-09-19 06:21:09 +10:00
|
|
|
|
|
|
|
void (*dtor)(struct nvkm_gsp *);
|
|
|
|
int (*oneinit)(struct nvkm_gsp *);
|
|
|
|
int (*init)(struct nvkm_gsp *);
|
|
|
|
int (*fini)(struct nvkm_gsp *, bool suspend);
|
2023-09-19 06:21:37 +10:00
|
|
|
int (*reset)(struct nvkm_gsp *);
|
|
|
|
|
2025-02-15 02:55:45 +10:00
|
|
|
struct {
|
|
|
|
const struct nvkm_rm_gpu *gpu;
|
|
|
|
} rm;
|
2023-09-19 06:21:09 +10:00
|
|
|
};
|
|
|
|
|
2023-09-19 06:21:37 +10:00
|
|
|
extern const struct nvkm_falcon_func tu102_gsp_flcn;
|
|
|
|
extern const struct nvkm_falcon_fw_func tu102_gsp_fwsec;
|
|
|
|
int tu102_gsp_booter_ctor(struct nvkm_gsp *, const char *, const struct firmware *,
|
|
|
|
struct nvkm_falcon *, struct nvkm_falcon_fw *);
|
|
|
|
int tu102_gsp_oneinit(struct nvkm_gsp *);
|
2025-01-22 21:21:03 +10:00
|
|
|
int tu102_gsp_init(struct nvkm_gsp *);
|
|
|
|
int tu102_gsp_fini(struct nvkm_gsp *, bool suspend);
|
2023-09-19 06:21:37 +10:00
|
|
|
int tu102_gsp_reset(struct nvkm_gsp *);
|
2024-11-25 10:21:18 +10:00
|
|
|
u64 tu102_gsp_wpr_heap_size(struct nvkm_gsp *);
|
2023-09-19 06:21:37 +10:00
|
|
|
|
|
|
|
extern const struct nvkm_falcon_func ga102_gsp_flcn;
|
|
|
|
extern const struct nvkm_falcon_fw_func ga102_gsp_fwsec;
|
|
|
|
int ga102_gsp_booter_ctor(struct nvkm_gsp *, const char *, const struct firmware *,
|
|
|
|
struct nvkm_falcon *, struct nvkm_falcon_fw *);
|
|
|
|
int ga102_gsp_reset(struct nvkm_gsp *);
|
|
|
|
|
2024-11-25 10:27:02 +10:00
|
|
|
int gh100_gsp_oneinit(struct nvkm_gsp *);
|
|
|
|
int gh100_gsp_init(struct nvkm_gsp *);
|
|
|
|
int gh100_gsp_fini(struct nvkm_gsp *, bool suspend);
|
|
|
|
|
2023-09-19 06:21:37 +10:00
|
|
|
void r535_gsp_dtor(struct nvkm_gsp *);
|
|
|
|
int r535_gsp_oneinit(struct nvkm_gsp *);
|
|
|
|
int r535_gsp_init(struct nvkm_gsp *);
|
|
|
|
int r535_gsp_fini(struct nvkm_gsp *, bool suspend);
|
|
|
|
|
2020-12-04 11:23:38 +10:00
|
|
|
int nvkm_gsp_new_(const struct nvkm_gsp_fwif *, struct nvkm_device *, enum nvkm_subdev_type, int,
|
2020-01-15 06:34:21 +10:00
|
|
|
struct nvkm_gsp **);
|
2023-09-19 06:21:09 +10:00
|
|
|
|
|
|
|
extern const struct nvkm_gsp_func gv100_gsp;
|
2020-01-15 06:34:21 +10:00
|
|
|
#endif
|