Lines Matching refs:uc_fw

40 		       struct intel_uc_fw *uc_fw)  in intel_uc_fw_fetch()  argument
50 intel_uc_fw_type_repr(uc_fw->type), uc_fw->path); in intel_uc_fw_fetch()
52 if (!uc_fw->path) in intel_uc_fw_fetch()
55 uc_fw->fetch_status = INTEL_UC_FIRMWARE_PENDING; in intel_uc_fw_fetch()
57 intel_uc_fw_type_repr(uc_fw->type), in intel_uc_fw_fetch()
58 intel_uc_fw_status_repr(uc_fw->fetch_status)); in intel_uc_fw_fetch()
60 err = request_firmware(&fw, uc_fw->path, &pdev->dev); in intel_uc_fw_fetch()
63 intel_uc_fw_type_repr(uc_fw->type), err); in intel_uc_fw_fetch()
68 intel_uc_fw_type_repr(uc_fw->type), fw->size, fw); in intel_uc_fw_fetch()
73 intel_uc_fw_type_repr(uc_fw->type), in intel_uc_fw_fetch()
82 uc_fw->header_offset = 0; in intel_uc_fw_fetch()
83 uc_fw->header_size = (css->header_size_dw - css->modulus_size_dw - in intel_uc_fw_fetch()
87 if (uc_fw->header_size != sizeof(struct uc_css_header)) { in intel_uc_fw_fetch()
89 intel_uc_fw_type_repr(uc_fw->type)); in intel_uc_fw_fetch()
95 uc_fw->ucode_offset = uc_fw->header_offset + uc_fw->header_size; in intel_uc_fw_fetch()
96 uc_fw->ucode_size = (css->size_dw - css->header_size_dw) * sizeof(u32); in intel_uc_fw_fetch()
101 intel_uc_fw_type_repr(uc_fw->type), css->key_size_dw); in intel_uc_fw_fetch()
105 uc_fw->rsa_offset = uc_fw->ucode_offset + uc_fw->ucode_size; in intel_uc_fw_fetch()
106 uc_fw->rsa_size = css->key_size_dw * sizeof(u32); in intel_uc_fw_fetch()
109 size = uc_fw->header_size + uc_fw->ucode_size + uc_fw->rsa_size; in intel_uc_fw_fetch()
112 intel_uc_fw_type_repr(uc_fw->type), fw->size, size); in intel_uc_fw_fetch()
123 switch (uc_fw->type) { in intel_uc_fw_fetch()
125 uc_fw->major_ver_found = css->guc.sw_version >> 16; in intel_uc_fw_fetch()
126 uc_fw->minor_ver_found = css->guc.sw_version & 0xFFFF; in intel_uc_fw_fetch()
130 uc_fw->major_ver_found = css->huc.sw_version >> 16; in intel_uc_fw_fetch()
131 uc_fw->minor_ver_found = css->huc.sw_version & 0xFFFF; in intel_uc_fw_fetch()
135 MISSING_CASE(uc_fw->type); in intel_uc_fw_fetch()
140 intel_uc_fw_type_repr(uc_fw->type), in intel_uc_fw_fetch()
141 uc_fw->major_ver_found, uc_fw->minor_ver_found, in intel_uc_fw_fetch()
142 uc_fw->major_ver_wanted, uc_fw->minor_ver_wanted); in intel_uc_fw_fetch()
144 if (uc_fw->major_ver_wanted == 0 && uc_fw->minor_ver_wanted == 0) { in intel_uc_fw_fetch()
146 intel_uc_fw_type_repr(uc_fw->type)); in intel_uc_fw_fetch()
147 } else if (uc_fw->major_ver_found != uc_fw->major_ver_wanted || in intel_uc_fw_fetch()
148 uc_fw->minor_ver_found < uc_fw->minor_ver_wanted) { in intel_uc_fw_fetch()
150 intel_uc_fw_type_repr(uc_fw->type), in intel_uc_fw_fetch()
151 uc_fw->major_ver_found, uc_fw->minor_ver_found, in intel_uc_fw_fetch()
152 uc_fw->major_ver_wanted, uc_fw->minor_ver_wanted); in intel_uc_fw_fetch()
161 intel_uc_fw_type_repr(uc_fw->type), err); in intel_uc_fw_fetch()
165 uc_fw->obj = obj; in intel_uc_fw_fetch()
166 uc_fw->size = fw->size; in intel_uc_fw_fetch()
167 uc_fw->fetch_status = INTEL_UC_FIRMWARE_SUCCESS; in intel_uc_fw_fetch()
169 intel_uc_fw_type_repr(uc_fw->type), in intel_uc_fw_fetch()
170 intel_uc_fw_status_repr(uc_fw->fetch_status)); in intel_uc_fw_fetch()
176 uc_fw->fetch_status = INTEL_UC_FIRMWARE_FAIL; in intel_uc_fw_fetch()
178 intel_uc_fw_type_repr(uc_fw->type), in intel_uc_fw_fetch()
179 intel_uc_fw_status_repr(uc_fw->fetch_status)); in intel_uc_fw_fetch()
182 intel_uc_fw_type_repr(uc_fw->type), uc_fw->path, err); in intel_uc_fw_fetch()
184 intel_uc_fw_type_repr(uc_fw->type), INTEL_UC_FIRMWARE_URL); in intel_uc_fw_fetch()
198 int intel_uc_fw_upload(struct intel_uc_fw *uc_fw, in intel_uc_fw_upload() argument
199 int (*xfer)(struct intel_uc_fw *uc_fw, in intel_uc_fw_upload() argument
207 intel_uc_fw_type_repr(uc_fw->type), uc_fw->path); in intel_uc_fw_upload()
209 if (uc_fw->fetch_status != INTEL_UC_FIRMWARE_SUCCESS) in intel_uc_fw_upload()
212 uc_fw->load_status = INTEL_UC_FIRMWARE_PENDING; in intel_uc_fw_upload()
214 intel_uc_fw_type_repr(uc_fw->type), in intel_uc_fw_upload()
215 intel_uc_fw_status_repr(uc_fw->load_status)); in intel_uc_fw_upload()
218 err = i915_gem_object_set_to_gtt_domain(uc_fw->obj, false); in intel_uc_fw_upload()
221 intel_uc_fw_type_repr(uc_fw->type), err); in intel_uc_fw_upload()
225 ggtt_pin_bias = to_i915(uc_fw->obj->base.dev)->guc.ggtt_pin_bias; in intel_uc_fw_upload()
226 vma = i915_gem_object_ggtt_pin(uc_fw->obj, NULL, 0, 0, in intel_uc_fw_upload()
231 intel_uc_fw_type_repr(uc_fw->type), err); in intel_uc_fw_upload()
236 err = xfer(uc_fw, vma); in intel_uc_fw_upload()
247 uc_fw->load_status = INTEL_UC_FIRMWARE_SUCCESS; in intel_uc_fw_upload()
249 intel_uc_fw_type_repr(uc_fw->type), in intel_uc_fw_upload()
250 intel_uc_fw_status_repr(uc_fw->load_status)); in intel_uc_fw_upload()
253 intel_uc_fw_type_repr(uc_fw->type), in intel_uc_fw_upload()
254 uc_fw->path, in intel_uc_fw_upload()
255 uc_fw->major_ver_found, uc_fw->minor_ver_found); in intel_uc_fw_upload()
260 uc_fw->load_status = INTEL_UC_FIRMWARE_FAIL; in intel_uc_fw_upload()
262 intel_uc_fw_type_repr(uc_fw->type), in intel_uc_fw_upload()
263 intel_uc_fw_status_repr(uc_fw->load_status)); in intel_uc_fw_upload()
266 intel_uc_fw_type_repr(uc_fw->type), uc_fw->path, err); in intel_uc_fw_upload()
278 void intel_uc_fw_fini(struct intel_uc_fw *uc_fw) in intel_uc_fw_fini() argument
282 obj = fetch_and_zero(&uc_fw->obj); in intel_uc_fw_fini()
286 uc_fw->fetch_status = INTEL_UC_FIRMWARE_NONE; in intel_uc_fw_fini()
296 void intel_uc_fw_dump(const struct intel_uc_fw *uc_fw, struct drm_printer *p) in intel_uc_fw_dump() argument
299 intel_uc_fw_type_repr(uc_fw->type), uc_fw->path); in intel_uc_fw_dump()
301 intel_uc_fw_status_repr(uc_fw->fetch_status), in intel_uc_fw_dump()
302 intel_uc_fw_status_repr(uc_fw->load_status)); in intel_uc_fw_dump()
304 uc_fw->major_ver_wanted, uc_fw->minor_ver_wanted, in intel_uc_fw_dump()
305 uc_fw->major_ver_found, uc_fw->minor_ver_found); in intel_uc_fw_dump()
307 uc_fw->header_offset, uc_fw->header_size); in intel_uc_fw_dump()
309 uc_fw->ucode_offset, uc_fw->ucode_size); in intel_uc_fw_dump()
311 uc_fw->rsa_offset, uc_fw->rsa_size); in intel_uc_fw_dump()