Lines Matching refs:lsfw
29 nvkm_acr_lsfw_del(struct nvkm_acr_lsfw *lsfw) in nvkm_acr_lsfw_del() argument
31 nvkm_blob_dtor(&lsfw->img); in nvkm_acr_lsfw_del()
32 nvkm_firmware_put(lsfw->sig); in nvkm_acr_lsfw_del()
33 list_del(&lsfw->head); in nvkm_acr_lsfw_del()
34 kfree(lsfw); in nvkm_acr_lsfw_del()
40 struct nvkm_acr_lsfw *lsfw, *lsft; in nvkm_acr_lsfw_del_all() local
41 list_for_each_entry_safe(lsfw, lsft, &acr->lsfw, head) { in nvkm_acr_lsfw_del_all()
42 nvkm_acr_lsfw_del(lsfw); in nvkm_acr_lsfw_del_all()
49 struct nvkm_acr_lsfw *lsfw; in nvkm_acr_lsfw_get() local
50 list_for_each_entry(lsfw, &acr->lsfw, head) { in nvkm_acr_lsfw_get()
51 if (lsfw->id == id) in nvkm_acr_lsfw_get()
52 return lsfw; in nvkm_acr_lsfw_get()
61 struct nvkm_acr_lsfw *lsfw; in nvkm_acr_lsfw_add() local
66 lsfw = nvkm_acr_lsfw_get(acr, id); in nvkm_acr_lsfw_add()
67 if (lsfw && lsfw->func) { in nvkm_acr_lsfw_add()
72 if (!lsfw) { in nvkm_acr_lsfw_add()
73 if (!(lsfw = kzalloc(sizeof(*lsfw), GFP_KERNEL))) in nvkm_acr_lsfw_add()
76 lsfw->id = id; in nvkm_acr_lsfw_add()
77 list_add_tail(&lsfw->head, &acr->lsfw); in nvkm_acr_lsfw_add()
80 lsfw->func = func; in nvkm_acr_lsfw_add()
81 lsfw->falcon = falcon; in nvkm_acr_lsfw_add()
82 return lsfw; in nvkm_acr_lsfw_add()
94 struct nvkm_acr_lsfw *lsfw; in nvkm_acr_lsfw_load_sig_image_desc_() local
97 if (IS_ERR((lsfw = nvkm_acr_lsfw_add(func, acr, falcon, id)))) in nvkm_acr_lsfw_load_sig_image_desc_()
98 return lsfw; in nvkm_acr_lsfw_load_sig_image_desc_()
100 ret = nvkm_firmware_load_name(subdev, path, "sig", ver, &lsfw->sig); in nvkm_acr_lsfw_load_sig_image_desc_()
104 ret = nvkm_firmware_load_blob(subdev, path, "image", ver, &lsfw->img); in nvkm_acr_lsfw_load_sig_image_desc_()
111 nvkm_acr_lsfw_del(lsfw); in nvkm_acr_lsfw_load_sig_image_desc_()
115 return lsfw; in nvkm_acr_lsfw_load_sig_image_desc_()
120 struct nvkm_acr_lsfw *lsfw) in nvkm_acr_lsfw_from_desc() argument
122 lsfw->bootloader_size = ALIGN(desc->bootloader_size, 256); in nvkm_acr_lsfw_from_desc()
123 lsfw->bootloader_imem_offset = desc->bootloader_imem_offset; in nvkm_acr_lsfw_from_desc()
125 lsfw->app_size = ALIGN(desc->app_size, 256); in nvkm_acr_lsfw_from_desc()
126 lsfw->app_start_offset = desc->app_start_offset; in nvkm_acr_lsfw_from_desc()
127 lsfw->app_imem_entry = desc->app_imem_entry; in nvkm_acr_lsfw_from_desc()
128 lsfw->app_resident_code_offset = desc->app_resident_code_offset; in nvkm_acr_lsfw_from_desc()
129 lsfw->app_resident_code_size = desc->app_resident_code_size; in nvkm_acr_lsfw_from_desc()
130 lsfw->app_resident_data_offset = desc->app_resident_data_offset; in nvkm_acr_lsfw_from_desc()
131 lsfw->app_resident_data_size = desc->app_resident_data_size; in nvkm_acr_lsfw_from_desc()
133 lsfw->ucode_size = ALIGN(lsfw->app_resident_data_offset, 256) + in nvkm_acr_lsfw_from_desc()
134 lsfw->bootloader_size; in nvkm_acr_lsfw_from_desc()
135 lsfw->data_size = lsfw->app_size + lsfw->bootloader_size - in nvkm_acr_lsfw_from_desc()
136 lsfw->ucode_size; in nvkm_acr_lsfw_from_desc()
147 struct nvkm_acr_lsfw *lsfw; in nvkm_acr_lsfw_load_sig_image_desc() local
149 lsfw = nvkm_acr_lsfw_load_sig_image_desc_(subdev, falcon, id, path, ver, in nvkm_acr_lsfw_load_sig_image_desc()
151 if (IS_ERR(lsfw)) in nvkm_acr_lsfw_load_sig_image_desc()
152 return PTR_ERR(lsfw); in nvkm_acr_lsfw_load_sig_image_desc()
154 nvkm_acr_lsfw_from_desc(&nvfw_ls_desc(subdev, fw->data)->head, lsfw); in nvkm_acr_lsfw_load_sig_image_desc()
167 struct nvkm_acr_lsfw *lsfw; in nvkm_acr_lsfw_load_sig_image_desc_v1() local
169 lsfw = nvkm_acr_lsfw_load_sig_image_desc_(subdev, falcon, id, path, ver, in nvkm_acr_lsfw_load_sig_image_desc_v1()
171 if (IS_ERR(lsfw)) in nvkm_acr_lsfw_load_sig_image_desc_v1()
172 return PTR_ERR(lsfw); in nvkm_acr_lsfw_load_sig_image_desc_v1()
174 nvkm_acr_lsfw_from_desc(&nvfw_ls_desc_v1(subdev, fw->data)->head, lsfw); in nvkm_acr_lsfw_load_sig_image_desc_v1()
187 struct nvkm_acr_lsfw *lsfw; in nvkm_acr_lsfw_load_bl_inst_data_sig() local
194 if (IS_ERR((lsfw = nvkm_acr_lsfw_add(func, acr, falcon, id)))) in nvkm_acr_lsfw_load_bl_inst_data_sig()
195 return PTR_ERR(lsfw); in nvkm_acr_lsfw_load_bl_inst_data_sig()
213 ret = nvkm_firmware_load_name(subdev, path, "sig", ver, &lsfw->sig); in nvkm_acr_lsfw_load_bl_inst_data_sig()
217 lsfw->bootloader_size = ALIGN(desc->code_size, 256); in nvkm_acr_lsfw_load_bl_inst_data_sig()
218 lsfw->bootloader_imem_offset = desc->start_tag << 8; in nvkm_acr_lsfw_load_bl_inst_data_sig()
220 lsfw->app_start_offset = lsfw->bootloader_size; in nvkm_acr_lsfw_load_bl_inst_data_sig()
221 lsfw->app_imem_entry = 0; in nvkm_acr_lsfw_load_bl_inst_data_sig()
222 lsfw->app_resident_code_offset = 0; in nvkm_acr_lsfw_load_bl_inst_data_sig()
223 lsfw->app_resident_code_size = ALIGN(inst->size, 256); in nvkm_acr_lsfw_load_bl_inst_data_sig()
224 lsfw->app_resident_data_offset = lsfw->app_resident_code_size; in nvkm_acr_lsfw_load_bl_inst_data_sig()
225 lsfw->app_resident_data_size = ALIGN(data->size, 256); in nvkm_acr_lsfw_load_bl_inst_data_sig()
226 lsfw->app_size = lsfw->app_resident_code_size + in nvkm_acr_lsfw_load_bl_inst_data_sig()
227 lsfw->app_resident_data_size; in nvkm_acr_lsfw_load_bl_inst_data_sig()
229 lsfw->img.size = lsfw->bootloader_size + lsfw->app_size; in nvkm_acr_lsfw_load_bl_inst_data_sig()
230 if (!(lsfw->img.data = kzalloc(lsfw->img.size, GFP_KERNEL))) { in nvkm_acr_lsfw_load_bl_inst_data_sig()
235 memcpy(lsfw->img.data, bldata, lsfw->bootloader_size); in nvkm_acr_lsfw_load_bl_inst_data_sig()
236 memcpy(lsfw->img.data + lsfw->app_start_offset + in nvkm_acr_lsfw_load_bl_inst_data_sig()
237 lsfw->app_resident_code_offset, inst->data, inst->size); in nvkm_acr_lsfw_load_bl_inst_data_sig()
238 memcpy(lsfw->img.data + lsfw->app_start_offset + in nvkm_acr_lsfw_load_bl_inst_data_sig()
239 lsfw->app_resident_data_offset, data->data, data->size); in nvkm_acr_lsfw_load_bl_inst_data_sig()
241 lsfw->ucode_size = ALIGN(lsfw->app_resident_data_offset, 256) + in nvkm_acr_lsfw_load_bl_inst_data_sig()
242 lsfw->bootloader_size; in nvkm_acr_lsfw_load_bl_inst_data_sig()
243 lsfw->data_size = lsfw->app_size + lsfw->bootloader_size - in nvkm_acr_lsfw_load_bl_inst_data_sig()
244 lsfw->ucode_size; in nvkm_acr_lsfw_load_bl_inst_data_sig()
248 nvkm_acr_lsfw_del(lsfw); in nvkm_acr_lsfw_load_bl_inst_data_sig()