1 /* SPDX-License-Identifier: MIT */ 2 #ifndef __NVKM_GSP_PRIV_H__ 3 #define __NVKM_GSP_PRIV_H__ 4 #include <subdev/gsp.h> 5 #include <rm/gpu.h> 6 enum nvkm_acr_lsf_id; 7 8 int nvkm_gsp_fwsec_frts(struct nvkm_gsp *); 9 int nvkm_gsp_fwsec_sb(struct nvkm_gsp *); 10 11 struct nvkm_gsp_fwif { 12 int version; 13 int (*load)(struct nvkm_gsp *, int ver, const struct nvkm_gsp_fwif *); 14 const struct nvkm_gsp_func *func; 15 const struct nvkm_rm_impl *rm; 16 const char *ver; 17 }; 18 19 int nvkm_gsp_load_fw(struct nvkm_gsp *, const char *name, const char *ver, 20 const struct firmware **); 21 void nvkm_gsp_dtor_fws(struct nvkm_gsp *); 22 23 int gv100_gsp_nofw(struct nvkm_gsp *, int, const struct nvkm_gsp_fwif *); 24 25 int tu102_gsp_load(struct nvkm_gsp *, int, const struct nvkm_gsp_fwif *); 26 int tu102_gsp_load_rm(struct nvkm_gsp *, const struct nvkm_gsp_fwif *); 27 28 int gh100_gsp_load(struct nvkm_gsp *, int, const struct nvkm_gsp_fwif *); 29 30 #define NVKM_GSP_FIRMWARE_BOOTER(chip,vers) \ 31 MODULE_FIRMWARE("nvidia/"#chip"/gsp/booter_load-"#vers".bin"); \ 32 MODULE_FIRMWARE("nvidia/"#chip"/gsp/booter_unload-"#vers".bin"); \ 33 MODULE_FIRMWARE("nvidia/"#chip"/gsp/bootloader-"#vers".bin"); \ 34 MODULE_FIRMWARE("nvidia/"#chip"/gsp/gsp-"#vers".bin") 35 36 #define NVKM_GSP_FIRMWARE_FMC(chip,vers) \ 37 MODULE_FIRMWARE("nvidia/"#chip"/gsp/fmc-"#vers".bin"); \ 38 MODULE_FIRMWARE("nvidia/"#chip"/gsp/bootloader-"#vers".bin"); \ 39 MODULE_FIRMWARE("nvidia/"#chip"/gsp/gsp-"#vers".bin") 40 41 struct nvkm_gsp_func { 42 const struct nvkm_falcon_func *flcn; 43 const struct nvkm_falcon_fw_func *fwsec; 44 45 char *sig_section; 46 47 struct { 48 int (*ctor)(struct nvkm_gsp *, const char *name, const struct firmware *, 49 struct nvkm_falcon *, struct nvkm_falcon_fw *); 50 } booter; 51 52 void (*dtor)(struct nvkm_gsp *); 53 int (*oneinit)(struct nvkm_gsp *); 54 int (*init)(struct nvkm_gsp *); 55 int (*fini)(struct nvkm_gsp *, bool suspend); 56 int (*reset)(struct nvkm_gsp *); 57 58 struct { 59 const struct nvkm_rm_gpu *gpu; 60 } rm; 61 }; 62 63 extern const struct nvkm_falcon_func tu102_gsp_flcn; 64 extern const struct nvkm_falcon_fw_func tu102_gsp_fwsec; 65 int tu102_gsp_booter_ctor(struct nvkm_gsp *, const char *, const struct firmware *, 66 struct nvkm_falcon *, struct nvkm_falcon_fw *); 67 int tu102_gsp_oneinit(struct nvkm_gsp *); 68 int tu102_gsp_init(struct nvkm_gsp *); 69 int tu102_gsp_fini(struct nvkm_gsp *, bool suspend); 70 int tu102_gsp_reset(struct nvkm_gsp *); 71 u64 tu102_gsp_wpr_heap_size(struct nvkm_gsp *); 72 73 extern const struct nvkm_falcon_func ga102_gsp_flcn; 74 extern const struct nvkm_falcon_fw_func ga102_gsp_fwsec; 75 int ga102_gsp_booter_ctor(struct nvkm_gsp *, const char *, const struct firmware *, 76 struct nvkm_falcon *, struct nvkm_falcon_fw *); 77 int ga102_gsp_reset(struct nvkm_gsp *); 78 79 int gh100_gsp_oneinit(struct nvkm_gsp *); 80 int gh100_gsp_init(struct nvkm_gsp *); 81 int gh100_gsp_fini(struct nvkm_gsp *, bool suspend); 82 83 void r535_gsp_dtor(struct nvkm_gsp *); 84 int r535_gsp_oneinit(struct nvkm_gsp *); 85 int r535_gsp_init(struct nvkm_gsp *); 86 int r535_gsp_fini(struct nvkm_gsp *, bool suspend); 87 88 int nvkm_gsp_new_(const struct nvkm_gsp_fwif *, struct nvkm_device *, enum nvkm_subdev_type, int, 89 struct nvkm_gsp **); 90 91 extern const struct nvkm_gsp_func gv100_gsp; 92 #endif 93