1
2
3
4#ifndef __IPU3_CSS_FW_H
5#define __IPU3_CSS_FW_H
6
7
8
9#define IMGU_FW_NAME "intel/ipu3-fw.bin"
10
11typedef u32 imgu_fw_ptr;
12
13enum imgu_fw_type {
14 IMGU_FW_SP_FIRMWARE,
15 IMGU_FW_SP1_FIRMWARE,
16 IMGU_FW_ISP_FIRMWARE,
17 IMGU_FW_BOOTLOADER_FIRMWARE,
18 IMGU_FW_ACC_FIRMWARE
19};
20
21enum imgu_fw_acc_type {
22 IMGU_FW_ACC_NONE,
23 IMGU_FW_ACC_OUTPUT,
24 IMGU_FW_ACC_VIEWFINDER,
25 IMGU_FW_ACC_STANDALONE,
26};
27
28struct imgu_fw_isp_parameter {
29 u32 offset;
30 u32 size;
31};
32
33struct imgu_fw_param_memory_offsets {
34 struct {
35 struct imgu_fw_isp_parameter lin;
36 struct imgu_fw_isp_parameter tnr3;
37 struct imgu_fw_isp_parameter xnr3;
38 } vmem;
39 struct {
40 struct imgu_fw_isp_parameter tnr;
41 struct imgu_fw_isp_parameter tnr3;
42 struct imgu_fw_isp_parameter xnr3;
43 struct imgu_fw_isp_parameter plane_io_config;
44 struct imgu_fw_isp_parameter rgbir;
45 } dmem;
46};
47
48struct imgu_fw_config_memory_offsets {
49 struct {
50 struct imgu_fw_isp_parameter iterator;
51 struct imgu_fw_isp_parameter dvs;
52 struct imgu_fw_isp_parameter output;
53 struct imgu_fw_isp_parameter raw;
54 struct imgu_fw_isp_parameter input_yuv;
55 struct imgu_fw_isp_parameter tnr;
56 struct imgu_fw_isp_parameter tnr3;
57 struct imgu_fw_isp_parameter ref;
58 } dmem;
59};
60
61struct imgu_fw_state_memory_offsets {
62 struct {
63 struct imgu_fw_isp_parameter tnr;
64 struct imgu_fw_isp_parameter tnr3;
65 struct imgu_fw_isp_parameter ref;
66 } dmem;
67};
68
69union imgu_fw_all_memory_offsets {
70 struct {
71 u64 imgu_fw_mem_offsets[3];
72 } offsets;
73 struct {
74 u64 ptr;
75 } array[IMGU_ABI_PARAM_CLASS_NUM];
76};
77
78struct imgu_fw_binary_xinfo {
79
80 struct imgu_abi_binary_info sp;
81
82
83 u32 type;
84
85 u32 num_output_formats __aligned(8);
86 u32 output_formats[IMGU_ABI_FRAME_FORMAT_NUM];
87
88
89 u32 num_vf_formats __aligned(8);
90
91 u32 vf_formats[IMGU_ABI_FRAME_FORMAT_NUM];
92 u8 num_output_pins;
93 imgu_fw_ptr xmem_addr;
94
95 u64 imgu_fw_blob_descr_ptr __aligned(8);
96 u32 blob_index __aligned(8);
97 union imgu_fw_all_memory_offsets mem_offsets __aligned(8);
98 struct imgu_fw_binary_xinfo *next __aligned(8);
99};
100
101struct imgu_fw_sp_info {
102 u32 init_dmem_data;
103 u32 per_frame_data;
104 u32 group;
105 u32 output;
106 u32 host_sp_queue;
107 u32 host_sp_com;
108 u32 isp_started;
109 u32 sw_state;
110 u32 host_sp_queues_initialized;
111 u32 sleep_mode;
112 u32 invalidate_tlb;
113 u32 debug_buffer_ddr_address;
114
115
116 u32 perf_counter_input_system_error;
117 u32 threads_stack;
118 u32 threads_stack_size;
119 u32 curr_binary_id;
120 u32 raw_copy_line_count;
121 u32 ddr_parameter_address;
122 u32 ddr_parameter_size;
123
124 u32 sp_entry;
125 u32 tagger_frames_addr;
126};
127
128struct imgu_fw_bl_info {
129 u32 num_dma_cmds;
130 u32 dma_cmd_list;
131 u32 sw_state;
132
133 u32 bl_entry;
134};
135
136struct imgu_fw_acc_info {
137 u32 per_frame_data;
138};
139
140union imgu_fw_union {
141 struct imgu_fw_binary_xinfo isp;
142 struct imgu_fw_sp_info sp;
143 struct imgu_fw_sp_info sp1;
144 struct imgu_fw_bl_info bl;
145 struct imgu_fw_acc_info acc;
146};
147
148struct imgu_fw_info {
149 size_t header_size;
150 u32 type __aligned(8);
151
152 union imgu_fw_union info;
153 struct imgu_abi_blob_info blob;
154
155 u64 next;
156
157 u32 loaded __aligned(8);
158 const u64 isp_code __aligned(8);
159
160 u32 handle __aligned(8);
161
162 struct imgu_abi_isp_param_segments mem_initializers;
163
164};
165
166struct imgu_fw_bi_file_h {
167 char version[64];
168 int binary_nr;
169 unsigned int h_size;
170};
171
172struct imgu_fw_header {
173 struct imgu_fw_bi_file_h file_header;
174 struct imgu_fw_info binary_header[1];
175};
176
177
178
179int imgu_css_fw_init(struct imgu_css *css);
180void imgu_css_fw_cleanup(struct imgu_css *css);
181
182unsigned int imgu_css_fw_obgrid_size(const struct imgu_fw_info *bi);
183void *imgu_css_fw_pipeline_params(struct imgu_css *css, unsigned int pipe,
184 enum imgu_abi_param_class cls,
185 enum imgu_abi_memories mem,
186 struct imgu_fw_isp_parameter *par,
187 size_t par_size, void *binary_params);
188
189#endif
190