1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2020-2023 Intel Corporation
6 #include <linux/firmware.h>
7 #include <linux/highmem.h>
8 #include <linux/moduleparam.h>
11 #include "vpu_boot_api.h"
14 #include "ivpu_fw_log.h"
20 #define FW_GLOBAL_MEM_START (2ull * SZ_1G)
21 #define FW_GLOBAL_MEM_END (3ull * SZ_1G)
22 #define FW_SHARED_MEM_SIZE SZ_256M /* Must be aligned to FW_SHARED_MEM_ALIGNMENT */
23 #define FW_SHARED_MEM_ALIGNMENT SZ_128K /* VPU MTRR limitation */
24 #define FW_RUNTIME_MAX_SIZE SZ_512M
25 #define FW_SHAVE_NN_MAX_SIZE SZ_2M
26 #define FW_RUNTIME_MIN_ADDR (FW_GLOBAL_MEM_START)
27 #define FW_RUNTIME_MAX_ADDR (FW_GLOBAL_MEM_END - FW_SHARED_MEM_SIZE)
28 #define FW_VERSION_HEADER_SIZE SZ_4K
29 #define FW_FILE_IMAGE_OFFSET (VPU_FW_HEADER_SIZE + FW_VERSION_HEADER_SIZE)
31 #define WATCHDOG_MSS_REDIRECT 32
32 #define WATCHDOG_NCE_REDIRECT 33
34 #define ADDR_TO_L2_CACHE_CFG(addr) ((addr) >> 31)
36 /* Check if FW API is compatible with the driver */
37 #define IVPU_FW_CHECK_API_COMPAT(vdev, fw_hdr, name, min_major) \
38 ivpu_fw_check_api(vdev, fw_hdr, #name, \
39 VPU_##name##_API_VER_INDEX, \
40 VPU_##name##_API_VER_MAJOR, \
41 VPU_##name##_API_VER_MINOR, min_major)
43 /* Check if API version is lower that the given version */
44 #define IVPU_FW_CHECK_API_VER_LT(vdev, fw_hdr, name, major, minor) \
45 ivpu_fw_check_api_ver_lt(vdev, fw_hdr, #name, VPU_##name##_API_VER_INDEX, major, minor)
47 static char *ivpu_firmware;
48 module_param_named_unsafe(firmware, ivpu_firmware, charp, 0644);
49 MODULE_PARM_DESC(firmware, "VPU firmware binary in /lib/firmware/..");
56 { IVPU_HW_37XX, "/*(DEBLOBBED)*/" },
57 { IVPU_HW_37XX, "/*(DEBLOBBED)*/" },
58 { IVPU_HW_37XX, "/*(DEBLOBBED)*/" },
59 { IVPU_HW_40XX, "/*(DEBLOBBED)*/" },
60 { IVPU_HW_40XX, "/*(DEBLOBBED)*/" },
63 static int ivpu_fw_request(struct ivpu_device *vdev)
69 ret = reject_firmware(&vdev->fw->file, ivpu_firmware, vdev->drm.dev);
71 vdev->fw->name = ivpu_firmware;
75 for (i = 0; i < ARRAY_SIZE(fw_names); i++) {
76 if (fw_names[i].gen != ivpu_hw_gen(vdev))
79 ret = firmware_reject_nowarn(&vdev->fw->file, fw_names[i].name, vdev->drm.dev);
81 vdev->fw->name = fw_names[i].name;
86 ivpu_err(vdev, "Failed to request firmware: %d\n", ret);
91 ivpu_fw_check_api(struct ivpu_device *vdev, const struct vpu_firmware_header *fw_hdr,
92 const char *str, int index, u16 expected_major, u16 expected_minor,
95 u16 major = (u16)(fw_hdr->api_version[index] >> 16);
96 u16 minor = (u16)(fw_hdr->api_version[index]);
98 if (major < min_major) {
99 ivpu_err(vdev, "Incompatible FW %s API version: %d.%d, required %d.0 or later\n",
100 str, major, minor, min_major);
103 if (major != expected_major) {
104 ivpu_warn(vdev, "Major FW %s API version different: %d.%d (expected %d.%d)\n",
105 str, major, minor, expected_major, expected_minor);
107 ivpu_dbg(vdev, FW_BOOT, "FW %s API version: %d.%d (expected %d.%d)\n",
108 str, major, minor, expected_major, expected_minor);
114 ivpu_fw_check_api_ver_lt(struct ivpu_device *vdev, const struct vpu_firmware_header *fw_hdr,
115 const char *str, int index, u16 major, u16 minor)
117 u16 fw_major = (u16)(fw_hdr->api_version[index] >> 16);
118 u16 fw_minor = (u16)(fw_hdr->api_version[index]);
120 if (fw_major < major || (fw_major == major && fw_minor < minor))
126 static int ivpu_fw_parse(struct ivpu_device *vdev)
128 struct ivpu_fw_info *fw = vdev->fw;
129 const struct vpu_firmware_header *fw_hdr = (const void *)fw->file->data;
130 u64 runtime_addr, image_load_addr, runtime_size, image_size;
132 if (fw->file->size <= FW_FILE_IMAGE_OFFSET) {
133 ivpu_err(vdev, "Firmware file is too small: %zu\n", fw->file->size);
137 if (fw_hdr->header_version != VPU_FW_HEADER_VERSION) {
138 ivpu_err(vdev, "Invalid firmware header version: %u\n", fw_hdr->header_version);
142 runtime_addr = fw_hdr->boot_params_load_address;
143 runtime_size = fw_hdr->runtime_size;
144 image_load_addr = fw_hdr->image_load_address;
145 image_size = fw_hdr->image_size;
147 if (runtime_addr < FW_RUNTIME_MIN_ADDR || runtime_addr > FW_RUNTIME_MAX_ADDR) {
148 ivpu_err(vdev, "Invalid firmware runtime address: 0x%llx\n", runtime_addr);
152 if (runtime_size < fw->file->size || runtime_size > FW_RUNTIME_MAX_SIZE) {
153 ivpu_err(vdev, "Invalid firmware runtime size: %llu\n", runtime_size);
157 if (FW_FILE_IMAGE_OFFSET + image_size > fw->file->size) {
158 ivpu_err(vdev, "Invalid image size: %llu\n", image_size);
162 if (image_load_addr < runtime_addr ||
163 image_load_addr + image_size > runtime_addr + runtime_size) {
164 ivpu_err(vdev, "Invalid firmware load address size: 0x%llx and size %llu\n",
165 image_load_addr, image_size);
169 if (fw_hdr->shave_nn_fw_size > FW_SHAVE_NN_MAX_SIZE) {
170 ivpu_err(vdev, "SHAVE NN firmware is too big: %u\n", fw_hdr->shave_nn_fw_size);
174 if (fw_hdr->entry_point < image_load_addr ||
175 fw_hdr->entry_point >= image_load_addr + image_size) {
176 ivpu_err(vdev, "Invalid entry point: 0x%llx\n", fw_hdr->entry_point);
179 ivpu_dbg(vdev, FW_BOOT, "Header version: 0x%x, format 0x%x\n",
180 fw_hdr->header_version, fw_hdr->image_format);
182 ivpu_info(vdev, "Firmware: %s, version: %s", fw->name,
183 (const char *)fw_hdr + VPU_FW_HEADER_SIZE);
185 if (IVPU_FW_CHECK_API_COMPAT(vdev, fw_hdr, BOOT, 3))
187 if (IVPU_FW_CHECK_API_COMPAT(vdev, fw_hdr, JSM, 3))
190 fw->runtime_addr = runtime_addr;
191 fw->runtime_size = runtime_size;
192 fw->image_load_offset = image_load_addr - runtime_addr;
193 fw->image_size = image_size;
194 fw->shave_nn_size = PAGE_ALIGN(fw_hdr->shave_nn_fw_size);
196 fw->cold_boot_entry_point = fw_hdr->entry_point;
197 fw->entry_point = fw->cold_boot_entry_point;
199 fw->trace_level = min_t(u32, ivpu_log_level, IVPU_FW_LOG_FATAL);
200 fw->trace_destination_mask = VPU_TRACE_DESTINATION_VERBOSE_TRACING;
201 fw->trace_hw_component_mask = -1;
205 ivpu_dbg(vdev, FW_BOOT, "Size: file %lu image %u runtime %u shavenn %u\n",
206 fw->file->size, fw->image_size, fw->runtime_size, fw->shave_nn_size);
207 ivpu_dbg(vdev, FW_BOOT, "Address: runtime 0x%llx, load 0x%llx, entry point 0x%llx\n",
208 fw->runtime_addr, image_load_addr, fw->entry_point);
213 static void ivpu_fw_release(struct ivpu_device *vdev)
215 release_firmware(vdev->fw->file);
218 /* Initialize workarounds that depend on FW version */
220 ivpu_fw_init_wa(struct ivpu_device *vdev)
222 const struct vpu_firmware_header *fw_hdr = (const void *)vdev->fw->file->data;
224 if (IVPU_FW_CHECK_API_VER_LT(vdev, fw_hdr, BOOT, 3, 17) ||
225 (ivpu_test_mode & IVPU_TEST_MODE_D0I3_MSG_DISABLE))
226 vdev->wa.disable_d0i3_msg = true;
228 /* Force enable the feature for testing purposes */
229 if (ivpu_test_mode & IVPU_TEST_MODE_D0I3_MSG_ENABLE)
230 vdev->wa.disable_d0i3_msg = false;
232 IVPU_PRINT_WA(disable_d0i3_msg);
235 static int ivpu_fw_update_global_range(struct ivpu_device *vdev)
237 struct ivpu_fw_info *fw = vdev->fw;
238 u64 start = ALIGN(fw->runtime_addr + fw->runtime_size, FW_SHARED_MEM_ALIGNMENT);
239 u64 size = FW_SHARED_MEM_SIZE;
241 if (start + size > FW_GLOBAL_MEM_END) {
242 ivpu_err(vdev, "No space for shared region, start %lld, size %lld\n", start, size);
246 ivpu_hw_init_range(&vdev->hw->ranges.global, start, size);
250 static int ivpu_fw_mem_init(struct ivpu_device *vdev)
252 struct ivpu_fw_info *fw = vdev->fw;
256 ret = ivpu_fw_update_global_range(vdev);
260 fw->mem = ivpu_bo_alloc_internal(vdev, fw->runtime_addr, fw->runtime_size, DRM_IVPU_BO_WC);
262 ivpu_err(vdev, "Failed to allocate firmware runtime memory\n");
266 fw->mem_log_crit = ivpu_bo_alloc_internal(vdev, 0, IVPU_FW_CRITICAL_BUFFER_SIZE,
268 if (!fw->mem_log_crit) {
269 ivpu_err(vdev, "Failed to allocate critical log buffer\n");
271 goto err_free_fw_mem;
274 if (ivpu_log_level <= IVPU_FW_LOG_INFO)
275 log_verb_size = IVPU_FW_VERBOSE_BUFFER_LARGE_SIZE;
277 log_verb_size = IVPU_FW_VERBOSE_BUFFER_SMALL_SIZE;
279 fw->mem_log_verb = ivpu_bo_alloc_internal(vdev, 0, log_verb_size, DRM_IVPU_BO_CACHED);
280 if (!fw->mem_log_verb) {
281 ivpu_err(vdev, "Failed to allocate verbose log buffer\n");
283 goto err_free_log_crit;
286 if (fw->shave_nn_size) {
287 fw->mem_shave_nn = ivpu_bo_alloc_internal(vdev, vdev->hw->ranges.shave.start,
288 fw->shave_nn_size, DRM_IVPU_BO_WC);
289 if (!fw->mem_shave_nn) {
290 ivpu_err(vdev, "Failed to allocate shavenn buffer\n");
292 goto err_free_log_verb;
299 ivpu_bo_free_internal(fw->mem_log_verb);
301 ivpu_bo_free_internal(fw->mem_log_crit);
303 ivpu_bo_free_internal(fw->mem);
307 static void ivpu_fw_mem_fini(struct ivpu_device *vdev)
309 struct ivpu_fw_info *fw = vdev->fw;
311 if (fw->mem_shave_nn) {
312 ivpu_bo_free_internal(fw->mem_shave_nn);
313 fw->mem_shave_nn = NULL;
316 ivpu_bo_free_internal(fw->mem_log_verb);
317 ivpu_bo_free_internal(fw->mem_log_crit);
318 ivpu_bo_free_internal(fw->mem);
320 fw->mem_log_verb = NULL;
321 fw->mem_log_crit = NULL;
325 int ivpu_fw_init(struct ivpu_device *vdev)
329 ret = ivpu_fw_request(vdev);
333 ret = ivpu_fw_parse(vdev);
337 ivpu_fw_init_wa(vdev);
339 ret = ivpu_fw_mem_init(vdev);
348 ivpu_fw_release(vdev);
352 void ivpu_fw_fini(struct ivpu_device *vdev)
354 ivpu_fw_mem_fini(vdev);
355 ivpu_fw_release(vdev);
358 void ivpu_fw_load(struct ivpu_device *vdev)
360 struct ivpu_fw_info *fw = vdev->fw;
361 u64 image_end_offset = fw->image_load_offset + fw->image_size;
363 memset(ivpu_bo_vaddr(fw->mem), 0, fw->image_load_offset);
364 memcpy(ivpu_bo_vaddr(fw->mem) + fw->image_load_offset,
365 fw->file->data + FW_FILE_IMAGE_OFFSET, fw->image_size);
367 if (IVPU_WA(clear_runtime_mem)) {
368 u8 *start = ivpu_bo_vaddr(fw->mem) + image_end_offset;
369 u64 size = ivpu_bo_size(fw->mem) - image_end_offset;
371 memset(start, 0, size);
374 wmb(); /* Flush WC buffers after writing fw->mem */
377 static void ivpu_fw_boot_params_print(struct ivpu_device *vdev, struct vpu_boot_params *boot_params)
379 ivpu_dbg(vdev, FW_BOOT, "boot_params.magic = 0x%x\n",
381 ivpu_dbg(vdev, FW_BOOT, "boot_params.vpu_id = 0x%x\n",
382 boot_params->vpu_id);
383 ivpu_dbg(vdev, FW_BOOT, "boot_params.vpu_count = 0x%x\n",
384 boot_params->vpu_count);
385 ivpu_dbg(vdev, FW_BOOT, "boot_params.frequency = %u\n",
386 boot_params->frequency);
387 ivpu_dbg(vdev, FW_BOOT, "boot_params.perf_clk_frequency = %u\n",
388 boot_params->perf_clk_frequency);
390 ivpu_dbg(vdev, FW_BOOT, "boot_params.ipc_header_area_start = 0x%llx\n",
391 boot_params->ipc_header_area_start);
392 ivpu_dbg(vdev, FW_BOOT, "boot_params.ipc_header_area_size = 0x%x\n",
393 boot_params->ipc_header_area_size);
394 ivpu_dbg(vdev, FW_BOOT, "boot_params.shared_region_base = 0x%llx\n",
395 boot_params->shared_region_base);
396 ivpu_dbg(vdev, FW_BOOT, "boot_params.shared_region_size = 0x%x\n",
397 boot_params->shared_region_size);
398 ivpu_dbg(vdev, FW_BOOT, "boot_params.ipc_payload_area_start = 0x%llx\n",
399 boot_params->ipc_payload_area_start);
400 ivpu_dbg(vdev, FW_BOOT, "boot_params.ipc_payload_area_size = 0x%x\n",
401 boot_params->ipc_payload_area_size);
402 ivpu_dbg(vdev, FW_BOOT, "boot_params.global_aliased_pio_base = 0x%llx\n",
403 boot_params->global_aliased_pio_base);
404 ivpu_dbg(vdev, FW_BOOT, "boot_params.global_aliased_pio_size = 0x%x\n",
405 boot_params->global_aliased_pio_size);
407 ivpu_dbg(vdev, FW_BOOT, "boot_params.autoconfig = 0x%x\n",
408 boot_params->autoconfig);
410 ivpu_dbg(vdev, FW_BOOT, "boot_params.cache_defaults[VPU_BOOT_L2_CACHE_CFG_NN].use = 0x%x\n",
411 boot_params->cache_defaults[VPU_BOOT_L2_CACHE_CFG_NN].use);
412 ivpu_dbg(vdev, FW_BOOT, "boot_params.cache_defaults[VPU_BOOT_L2_CACHE_CFG_NN].cfg = 0x%x\n",
413 boot_params->cache_defaults[VPU_BOOT_L2_CACHE_CFG_NN].cfg);
415 ivpu_dbg(vdev, FW_BOOT, "boot_params.global_memory_allocator_base = 0x%llx\n",
416 boot_params->global_memory_allocator_base);
417 ivpu_dbg(vdev, FW_BOOT, "boot_params.global_memory_allocator_size = 0x%x\n",
418 boot_params->global_memory_allocator_size);
420 ivpu_dbg(vdev, FW_BOOT, "boot_params.shave_nn_fw_base = 0x%llx\n",
421 boot_params->shave_nn_fw_base);
423 ivpu_dbg(vdev, FW_BOOT, "boot_params.watchdog_irq_mss = 0x%x\n",
424 boot_params->watchdog_irq_mss);
425 ivpu_dbg(vdev, FW_BOOT, "boot_params.watchdog_irq_nce = 0x%x\n",
426 boot_params->watchdog_irq_nce);
427 ivpu_dbg(vdev, FW_BOOT, "boot_params.host_to_vpu_irq = 0x%x\n",
428 boot_params->host_to_vpu_irq);
429 ivpu_dbg(vdev, FW_BOOT, "boot_params.job_done_irq = 0x%x\n",
430 boot_params->job_done_irq);
432 ivpu_dbg(vdev, FW_BOOT, "boot_params.host_version_id = 0x%x\n",
433 boot_params->host_version_id);
434 ivpu_dbg(vdev, FW_BOOT, "boot_params.si_stepping = 0x%x\n",
435 boot_params->si_stepping);
436 ivpu_dbg(vdev, FW_BOOT, "boot_params.device_id = 0x%llx\n",
437 boot_params->device_id);
438 ivpu_dbg(vdev, FW_BOOT, "boot_params.feature_exclusion = 0x%llx\n",
439 boot_params->feature_exclusion);
440 ivpu_dbg(vdev, FW_BOOT, "boot_params.sku = 0x%llx\n",
442 ivpu_dbg(vdev, FW_BOOT, "boot_params.min_freq_pll_ratio = 0x%x\n",
443 boot_params->min_freq_pll_ratio);
444 ivpu_dbg(vdev, FW_BOOT, "boot_params.pn_freq_pll_ratio = 0x%x\n",
445 boot_params->pn_freq_pll_ratio);
446 ivpu_dbg(vdev, FW_BOOT, "boot_params.max_freq_pll_ratio = 0x%x\n",
447 boot_params->max_freq_pll_ratio);
448 ivpu_dbg(vdev, FW_BOOT, "boot_params.default_trace_level = 0x%x\n",
449 boot_params->default_trace_level);
450 ivpu_dbg(vdev, FW_BOOT, "boot_params.tracing_buff_message_format_mask = 0x%llx\n",
451 boot_params->tracing_buff_message_format_mask);
452 ivpu_dbg(vdev, FW_BOOT, "boot_params.trace_destination_mask = 0x%x\n",
453 boot_params->trace_destination_mask);
454 ivpu_dbg(vdev, FW_BOOT, "boot_params.trace_hw_component_mask = 0x%llx\n",
455 boot_params->trace_hw_component_mask);
456 ivpu_dbg(vdev, FW_BOOT, "boot_params.boot_type = 0x%x\n",
457 boot_params->boot_type);
458 ivpu_dbg(vdev, FW_BOOT, "boot_params.punit_telemetry_sram_base = 0x%llx\n",
459 boot_params->punit_telemetry_sram_base);
460 ivpu_dbg(vdev, FW_BOOT, "boot_params.punit_telemetry_sram_size = 0x%llx\n",
461 boot_params->punit_telemetry_sram_size);
462 ivpu_dbg(vdev, FW_BOOT, "boot_params.vpu_telemetry_enable = 0x%x\n",
463 boot_params->vpu_telemetry_enable);
464 ivpu_dbg(vdev, FW_BOOT, "boot_params.dvfs_mode = %u\n",
465 boot_params->dvfs_mode);
466 ivpu_dbg(vdev, FW_BOOT, "boot_params.d0i3_delayed_entry = %d\n",
467 boot_params->d0i3_delayed_entry);
468 ivpu_dbg(vdev, FW_BOOT, "boot_params.d0i3_residency_time_us = %lld\n",
469 boot_params->d0i3_residency_time_us);
470 ivpu_dbg(vdev, FW_BOOT, "boot_params.d0i3_entry_vpu_ts = %llu\n",
471 boot_params->d0i3_entry_vpu_ts);
474 void ivpu_fw_boot_params_setup(struct ivpu_device *vdev, struct vpu_boot_params *boot_params)
476 struct ivpu_bo *ipc_mem_rx = vdev->ipc->mem_rx;
478 /* In case of warm boot only update variable params */
479 if (!ivpu_fw_is_cold_boot(vdev)) {
480 boot_params->d0i3_residency_time_us =
481 ktime_us_delta(ktime_get_boottime(), vdev->hw->d0i3_entry_host_ts);
482 boot_params->d0i3_entry_vpu_ts = vdev->hw->d0i3_entry_vpu_ts;
484 ivpu_dbg(vdev, FW_BOOT, "boot_params.d0i3_residency_time_us = %lld\n",
485 boot_params->d0i3_residency_time_us);
486 ivpu_dbg(vdev, FW_BOOT, "boot_params.d0i3_entry_vpu_ts = %llu\n",
487 boot_params->d0i3_entry_vpu_ts);
489 boot_params->save_restore_ret_address = 0;
490 vdev->pm->is_warmboot = true;
491 wmb(); /* Flush WC buffers after writing save_restore_ret_address */
495 vdev->pm->is_warmboot = false;
497 boot_params->magic = VPU_BOOT_PARAMS_MAGIC;
498 boot_params->vpu_id = to_pci_dev(vdev->drm.dev)->bus->number;
499 boot_params->frequency = ivpu_hw_reg_pll_freq_get(vdev);
502 * This param is a debug firmware feature. It switches default clock
503 * to higher resolution one for fine-grained and more accurate firmware
506 boot_params->perf_clk_frequency = ivpu_hw_profiling_freq_get(vdev);
509 * Uncached region of VPU address space, covers IPC buffers, job queues
510 * and log buffers, programmable to L2$ Uncached by VPU MTRR
512 boot_params->shared_region_base = vdev->hw->ranges.global.start;
513 boot_params->shared_region_size = vdev->hw->ranges.global.end -
514 vdev->hw->ranges.global.start;
516 boot_params->ipc_header_area_start = ipc_mem_rx->vpu_addr;
517 boot_params->ipc_header_area_size = ivpu_bo_size(ipc_mem_rx) / 2;
519 boot_params->ipc_payload_area_start = ipc_mem_rx->vpu_addr + ivpu_bo_size(ipc_mem_rx) / 2;
520 boot_params->ipc_payload_area_size = ivpu_bo_size(ipc_mem_rx) / 2;
522 boot_params->global_aliased_pio_base = vdev->hw->ranges.user.start;
523 boot_params->global_aliased_pio_size = ivpu_hw_range_size(&vdev->hw->ranges.user);
525 /* Allow configuration for L2C_PAGE_TABLE with boot param value */
526 boot_params->autoconfig = 1;
528 /* Enable L2 cache for first 2GB of high memory */
529 boot_params->cache_defaults[VPU_BOOT_L2_CACHE_CFG_NN].use = 1;
530 boot_params->cache_defaults[VPU_BOOT_L2_CACHE_CFG_NN].cfg =
531 ADDR_TO_L2_CACHE_CFG(vdev->hw->ranges.shave.start);
533 if (vdev->fw->mem_shave_nn)
534 boot_params->shave_nn_fw_base = vdev->fw->mem_shave_nn->vpu_addr;
536 boot_params->watchdog_irq_mss = WATCHDOG_MSS_REDIRECT;
537 boot_params->watchdog_irq_nce = WATCHDOG_NCE_REDIRECT;
538 boot_params->si_stepping = ivpu_revision(vdev);
539 boot_params->device_id = ivpu_device_id(vdev);
540 boot_params->feature_exclusion = vdev->hw->tile_fuse;
541 boot_params->sku = vdev->hw->sku;
543 boot_params->min_freq_pll_ratio = vdev->hw->pll.min_ratio;
544 boot_params->pn_freq_pll_ratio = vdev->hw->pll.pn_ratio;
545 boot_params->max_freq_pll_ratio = vdev->hw->pll.max_ratio;
547 boot_params->default_trace_level = vdev->fw->trace_level;
548 boot_params->tracing_buff_message_format_mask = BIT(VPU_TRACING_FORMAT_STRING);
549 boot_params->trace_destination_mask = vdev->fw->trace_destination_mask;
550 boot_params->trace_hw_component_mask = vdev->fw->trace_hw_component_mask;
551 boot_params->crit_tracing_buff_addr = vdev->fw->mem_log_crit->vpu_addr;
552 boot_params->crit_tracing_buff_size = ivpu_bo_size(vdev->fw->mem_log_crit);
553 boot_params->verbose_tracing_buff_addr = vdev->fw->mem_log_verb->vpu_addr;
554 boot_params->verbose_tracing_buff_size = ivpu_bo_size(vdev->fw->mem_log_verb);
556 boot_params->punit_telemetry_sram_base = ivpu_hw_reg_telemetry_offset_get(vdev);
557 boot_params->punit_telemetry_sram_size = ivpu_hw_reg_telemetry_size_get(vdev);
558 boot_params->vpu_telemetry_enable = ivpu_hw_reg_telemetry_enable_get(vdev);
559 boot_params->dvfs_mode = vdev->fw->dvfs_mode;
560 if (!IVPU_WA(disable_d0i3_msg))
561 boot_params->d0i3_delayed_entry = 1;
562 boot_params->d0i3_residency_time_us = 0;
563 boot_params->d0i3_entry_vpu_ts = 0;
565 wmb(); /* Flush WC buffers after writing bootparams */
567 ivpu_fw_boot_params_print(vdev, boot_params);