1 /* SPDX-License-Identifier: MIT */
4 #define nvkm_acr(p) container_of((p), struct nvkm_acr, subdev)
5 #include <core/subdev.h>
6 #include <core/falcon.h>
10 NVKM_ACR_LSF_GSPLITE
= 1,
11 NVKM_ACR_LSF_FECS
= 2,
12 NVKM_ACR_LSF_GPCCS
= 3,
13 NVKM_ACR_LSF_NVDEC
= 4,
14 NVKM_ACR_LSF_SEC2
= 7,
15 NVKM_ACR_LSF_MINION
= 10,
19 static inline const char *
20 nvkm_acr_lsf_id(enum nvkm_acr_lsf_id id
)
23 case NVKM_ACR_LSF_PMU
: return "pmu";
24 case NVKM_ACR_LSF_GSPLITE
: return "gsplite";
25 case NVKM_ACR_LSF_FECS
: return "fecs";
26 case NVKM_ACR_LSF_GPCCS
: return "gpccs";
27 case NVKM_ACR_LSF_NVDEC
: return "nvdec";
28 case NVKM_ACR_LSF_SEC2
: return "sec2";
29 case NVKM_ACR_LSF_MINION
: return "minion";
36 const struct nvkm_acr_func
*func
;
37 struct nvkm_subdev subdev
;
39 struct list_head hsfw
, hsf
;
40 struct list_head lsfw
, lsf
;
42 struct nvkm_memory
*wpr
;
47 struct nvkm_memory
*inst
;
52 const struct firmware
*wpr_fw
;
57 bool nvkm_acr_managed_falcon(struct nvkm_device
*, enum nvkm_acr_lsf_id
);
58 int nvkm_acr_bootstrap_falcons(struct nvkm_device
*, unsigned long mask
);
60 int gm200_acr_new(struct nvkm_device
*, int, struct nvkm_acr
**);
61 int gm20b_acr_new(struct nvkm_device
*, int, struct nvkm_acr
**);
62 int gp102_acr_new(struct nvkm_device
*, int, struct nvkm_acr
**);
63 int gp108_acr_new(struct nvkm_device
*, int, struct nvkm_acr
**);
64 int gp10b_acr_new(struct nvkm_device
*, int, struct nvkm_acr
**);
65 int tu102_acr_new(struct nvkm_device
*, int, struct nvkm_acr
**);
67 struct nvkm_acr_lsfw
{
68 const struct nvkm_acr_lsf_func
*func
;
69 struct nvkm_falcon
*falcon
;
70 enum nvkm_acr_lsf_id id
;
72 struct list_head head
;
76 const struct firmware
*sig
;
79 u32 bootloader_imem_offset
;
84 u32 app_resident_code_offset
;
85 u32 app_resident_code_size
;
86 u32 app_resident_data_offset
;
87 u32 app_resident_data_size
;
100 struct nvkm_acr_lsf_func
{
101 /* The (currently) map directly to LSB header flags. */
102 #define NVKM_ACR_LSF_LOAD_CODE_AT_0 0x00000001
103 #define NVKM_ACR_LSF_DMACTL_REQ_CTX 0x00000004
104 #define NVKM_ACR_LSF_FORCE_PRIV_LOAD 0x00000008
107 void (*bld_write
)(struct nvkm_acr
*, u32 bld
, struct nvkm_acr_lsfw
*);
108 void (*bld_patch
)(struct nvkm_acr
*, u32 bld
, s64 adjust
);
109 int (*boot
)(struct nvkm_falcon
*);
110 int (*bootstrap_falcon
)(struct nvkm_falcon
*, enum nvkm_acr_lsf_id
);
111 int (*bootstrap_multiple_falcons
)(struct nvkm_falcon
*, u32 mask
);
115 nvkm_acr_lsfw_load_sig_image_desc(struct nvkm_subdev
*, struct nvkm_falcon
*,
116 enum nvkm_acr_lsf_id
, const char *path
,
117 int ver
, const struct nvkm_acr_lsf_func
*);
119 nvkm_acr_lsfw_load_sig_image_desc_v1(struct nvkm_subdev
*, struct nvkm_falcon
*,
120 enum nvkm_acr_lsf_id
, const char *path
,
121 int ver
, const struct nvkm_acr_lsf_func
*);
123 nvkm_acr_lsfw_load_bl_inst_data_sig(struct nvkm_subdev
*, struct nvkm_falcon
*,
124 enum nvkm_acr_lsf_id
, const char *path
,
125 int ver
, const struct nvkm_acr_lsf_func
*);