xref: /linux/drivers/accel/ivpu/ivpu_fw.h (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (C) 2020-2023 Intel Corporation
4  */
5 
6 #ifndef __IVPU_FW_H__
7 #define __IVPU_FW_H__
8 
9 struct ivpu_device;
10 struct ivpu_bo;
11 struct vpu_boot_params;
12 
13 struct ivpu_fw_info {
14 	const struct firmware *file;
15 	const char *name;
16 	struct ivpu_bo *mem;
17 	struct ivpu_bo *mem_shave_nn;
18 	struct ivpu_bo *mem_log_crit;
19 	struct ivpu_bo *mem_log_verb;
20 	u64 runtime_addr;
21 	u32 runtime_size;
22 	u64 image_load_offset;
23 	u32 image_size;
24 	u32 shave_nn_size;
25 	u64 entry_point; /* Cold or warm boot entry point for next boot */
26 	u64 cold_boot_entry_point;
27 	u32 trace_level;
28 	u32 trace_destination_mask;
29 	u64 trace_hw_component_mask;
30 	u32 dvfs_mode;
31 	u32 primary_preempt_buf_size;
32 	u32 secondary_preempt_buf_size;
33 	u64 read_only_addr;
34 	u32 read_only_size;
35 };
36 
37 int ivpu_fw_init(struct ivpu_device *vdev);
38 void ivpu_fw_fini(struct ivpu_device *vdev);
39 void ivpu_fw_load(struct ivpu_device *vdev);
40 void ivpu_fw_boot_params_setup(struct ivpu_device *vdev, struct vpu_boot_params *bp);
41 
ivpu_fw_is_cold_boot(struct ivpu_device * vdev)42 static inline bool ivpu_fw_is_cold_boot(struct ivpu_device *vdev)
43 {
44 	return vdev->fw->entry_point == vdev->fw->cold_boot_entry_point;
45 }
46 
47 #endif /* __IVPU_FW_H__ */
48