This source file includes following definitions.
- hsf_load_header_app_off
- hsf_load_header_app_size
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #ifndef __NVKM_SECBOOT_ACR_R352_H__
23 #define __NVKM_SECBOOT_ACR_R352_H__
24
25 #include "acr.h"
26 #include "ls_ucode.h"
27 #include "hs_ucode.h"
28
29 struct ls_ucode_img;
30
31 #define ACR_R352_MAX_APPS 8
32
33 #define LSF_FLAG_LOAD_CODE_AT_0 1
34 #define LSF_FLAG_DMACTL_REQ_CTX 4
35 #define LSF_FLAG_FORCE_PRIV_LOAD 8
36
37 static inline u32
38 hsf_load_header_app_off(const struct hsf_load_header *hdr, u32 app)
39 {
40 return hdr->apps[app];
41 }
42
43 static inline u32
44 hsf_load_header_app_size(const struct hsf_load_header *hdr, u32 app)
45 {
46 return hdr->apps[hdr->num_apps + app];
47 }
48
49
50
51
52
53
54
55
56
57 struct acr_r352_lsf_func {
58 void (*generate_bl_desc)(const struct nvkm_acr *,
59 const struct ls_ucode_img *, u64, void *);
60 u32 bl_desc_size;
61 u32 lhdr_flags;
62 };
63
64
65
66
67
68
69
70 struct acr_r352_ls_func {
71 int (*load)(const struct nvkm_secboot *, int maxver,
72 struct ls_ucode_img *);
73 int (*post_run)(const struct nvkm_acr *, const struct nvkm_secboot *);
74 int version_max;
75 const struct acr_r352_lsf_func *version[];
76 };
77
78 struct acr_r352;
79
80
81
82
83
84
85
86
87 struct acr_r352_func {
88 void (*generate_hs_bl_desc)(const struct hsf_load_header *, void *,
89 u64);
90 void (*fixup_hs_desc)(struct acr_r352 *, struct nvkm_secboot *, void *);
91 u32 hs_bl_desc_size;
92 bool shadow_blob;
93
94 struct ls_ucode_img *(*ls_ucode_img_load)(const struct acr_r352 *,
95 const struct nvkm_secboot *,
96 enum nvkm_secboot_falcon);
97 int (*ls_fill_headers)(struct acr_r352 *, struct list_head *);
98 int (*ls_write_wpr)(struct acr_r352 *, struct list_head *,
99 struct nvkm_gpuobj *, u64);
100
101 const struct acr_r352_ls_func *ls_func[NVKM_SECBOOT_FALCON_END];
102 };
103
104
105
106
107 struct acr_r352 {
108 struct nvkm_acr base;
109 const struct acr_r352_func *func;
110
111
112
113
114
115 struct nvkm_gpuobj *load_blob;
116 struct {
117 struct hsf_load_header load_bl_header;
118 u32 __load_apps[ACR_R352_MAX_APPS * 2];
119 };
120
121
122 struct nvkm_gpuobj *unload_blob;
123 struct {
124 struct hsf_load_header unload_bl_header;
125 u32 __unload_apps[ACR_R352_MAX_APPS * 2];
126 };
127
128
129 void *hsbl_blob;
130
131
132 void *hsbl_unload_blob;
133
134
135 struct nvkm_gpuobj *ls_blob;
136
137
138 bool firmware_ok;
139
140
141 u32 lazy_bootstrap;
142
143
144 enum {
145
146 NON_SECURE = 0,
147
148 RESET,
149
150 RUNNING,
151 } falcon_state[NVKM_SECBOOT_FALCON_END];
152 };
153 #define acr_r352(acr) container_of(acr, struct acr_r352, base)
154
155 struct nvkm_acr *acr_r352_new_(const struct acr_r352_func *,
156 enum nvkm_secboot_falcon, unsigned long);
157
158 struct ls_ucode_img *acr_r352_ls_ucode_img_load(const struct acr_r352 *,
159 const struct nvkm_secboot *,
160 enum nvkm_secboot_falcon);
161 int acr_r352_ls_fill_headers(struct acr_r352 *, struct list_head *);
162 int acr_r352_ls_write_wpr(struct acr_r352 *, struct list_head *,
163 struct nvkm_gpuobj *, u64);
164
165 void acr_r352_fixup_hs_desc(struct acr_r352 *, struct nvkm_secboot *, void *);
166
167 #endif