xref: /rockchip-linux_mpp/mpp/hal/vpu/mpg4d/hal_m4vd_vdpu2_reg.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1 /*
2  * Copyright 2016 Rockchip Electronics Co. LTD
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __HAL_M4V_VDPU2_REG_TBL_H__
18 #define __HAL_M4V_VDPU2_REG_TBL_H__
19 
20 #include "rk_type.h"
21 
22 typedef struct  {
23     RK_U32      reg00_49[50];
24 
25     struct {
26         RK_U32  sw_dec_tiled_msb    : 1;
27         RK_U32  sw_dec_latency      : 6;
28         RK_U32  sw_pic_fixed_quant  : 1;
29         RK_U32  sw_dblk_flt_dis     : 1;
30         RK_U32  sw_skip_sel         : 1;
31         RK_U32  sw_dec_ascmd0_dis   : 1;
32         RK_U32  sw_adv_pref_dis     : 1;
33         RK_U32  sw_dec_tiled_lsb    : 1;
34         RK_U32  sw_refbuf_thrd      : 12;
35         RK_U32  sw_refbuf_pid       : 5;
36         RK_U32  reserve1            : 2;
37     } reg50_dec_ctrl;
38 
39     struct {
40         RK_U32  sw_stream_len       : 24;
41         RK_U32  reserve1            : 1;
42         RK_U32  sw_qp_init_val      : 6;
43         RK_U32  reserve2            : 1;
44     } reg51_stream_info;
45 
46     struct {
47         RK_U32  sw_ydim_mbst        : 8;
48         RK_U32  sw_xdim_mbst        : 9;
49         RK_U32  sw_adv_pref_thrd    : 14;
50         RK_U32  sw_reserve          : 1;
51     } reg52_error_concealment;
52 
53     RK_U32      reg53_dec_mode;
54 
55     struct {
56         RK_U32  sw_dec_in_endian    : 1;
57         RK_U32  sw_dec_out_endian   : 1;
58         RK_U32  sw_dec_in_wordsp    : 1;
59         RK_U32  sw_dec_out_wordsp   : 1;
60         RK_U32  sw_dec_strswap32_e  : 1;
61         RK_U32  sw_dec_strendian_e  : 1;
62         RK_U32  reserve3            : 26;
63     } reg54_endian;
64 
65     struct {
66         RK_U32  sw_dec_irq          : 1;
67         RK_U32  sw_dec_irq_dis      : 1;
68         RK_U32  reserve0            : 2;
69         RK_U32  sw_dec_rdy_int      : 1;
70         RK_U32  sw_pp_bus_sts       : 1;
71         RK_U32  sw_buf_emt_sts      : 1;
72         RK_U32  reserve1            : 1;
73         RK_U32  sw_aso_det_sts      : 1;
74         RK_U32  sw_slice_det_sts    : 1;
75         RK_U32  sw_bslice_det_sts   : 1;
76         RK_U32  reserve2            : 1;
77         RK_U32  sw_error_det_sts    : 1;
78         RK_U32  sw_timeout_det_sts  : 1;
79         RK_U32  reserve3            : 18;
80     } reg55_Interrupt;
81 
82     struct {
83         RK_U32  sw_dec_axi_id_rd    : 8;
84         RK_U32  sw_dec_axi_id_wr    : 8;
85         RK_U32  sw_dec_max_burlen   : 5;
86         RK_U32  reserve0            : 1;
87         RK_U32  sw_dec_data_discd_en: 1;
88         RK_U32  reserve1            : 9;
89     } reg56_axi_ctrl;
90 
91     struct {
92         RK_U32  sw_dec_st_work         : 1;
93         RK_U32  sw_refpic_buf2_en      : 1;
94         RK_U32  sw_dec_wr_extmem_dis   : 1;
95         RK_U32  reserve                : 1;
96         RK_U32  sw_dec_clkgate_en      : 1;
97         RK_U32  sw_timeout_sts_en      : 1;
98         RK_U32  sw_rd_cnt_tab_en       : 1;
99         RK_U32  sw_sequ_mbaff_en       : 1;
100         RK_U32  sw_first_reftop_en     : 1;
101         RK_U32  sw_reftop_en           : 1;
102         RK_U32  sw_dmmv_wr_en          : 1;
103         RK_U32  sw_sorspa_en           : 1;
104         RK_U32  sw_fwd_refpic_mode_sel : 1;
105         RK_U32  sw_pic_decfield_sel    : 1;
106         RK_U32  sw_pic_type_sel0       : 1;
107         RK_U32  sw_pic_type_sel1       : 1;
108         RK_U32  sw_curpic_stru_sel     : 1;
109         RK_U32  sw_curpic_code_sel     : 1;
110         RK_U32  sw_prog_jpeg_en        : 1;
111         RK_U32  sw_divx3_en            : 1;
112         RK_U32  sw_rlc_mode_en         : 1;
113         RK_U32  sw_addit_ch_fmt_wen    : 1;
114         RK_U32  sw_st_code_exist       : 1;
115         RK_U32  reserve1               : 8;
116         RK_U32  sw_dec_timeout_mode    : 1;
117     } reg57_enable_ctrl;
118 
119     struct {
120         RK_U32  sw_soft_rst         : 1;
121         RK_U32  reverse0            : 31;
122     } reg58;
123 
124     struct {
125         RK_U32  reserve             : 2;
126         RK_U32  sw_pflt_set0_tap2   : 10;
127         RK_U32  sw_pflt_set0_tap1   : 10;
128         RK_U32  sw_pflt_set0_tap0   : 10;
129     } reg59;
130 
131     RK_U32      reg60_addit_ch_st_base;
132     RK_U32      reg61_qtable_base;
133     RK_U32      reg62_directmv_base;
134     RK_U32      reg63_cur_pic_base;
135     RK_U32      reg64_input_stream_base;
136 
137     struct {
138         RK_U32  sw_refbuf_y_ofset        : 9;
139         RK_U32  sw_reserve               : 3;
140         RK_U32  sw_refbuf_fildpar_mod_e  : 1;
141         RK_U32  sw_refbuf_idcal_e        : 1;
142         RK_U32  sw_refbuf_picid          : 5;
143         RK_U32  sw_refbu_thr_level       : 12;
144         RK_U32  sw_refbu_e               : 1;
145     } reg65_refpicbuf_ctrl;
146 
147     struct {
148         RK_U32  build_ver           : 3;
149         RK_U32  ascii_id_en         : 1;
150         RK_U32  minor_num           : 8;
151         RK_U32  major_num           : 4;
152         RK_U32  prod_id             : 16;
153     } reg66_id;
154 
155     struct {
156         RK_U32  sw_reserve          : 25;
157         RK_U32  rom_imp_type        : 1;
158         RK_U32  rv_allow_flag       : 2;
159         RK_U32  refbuf2_allow_flag  : 1;
160         RK_U32  divx_allow_flag     : 1;
161         RK_U32  refbuf_allow_flag   : 1;
162         RK_U32  jpeg_allow_flag     : 1;
163     } reg67_synthesis_cfg;
164 
165     struct {
166         RK_U32  sw_refbuf_sum_bot    : 16;
167         RK_U32  sw_refbuf_sum_top    : 16;
168     } reg68_sum_of_partitions;
169 
170     struct {
171         RK_U32  sw_luma_sum_intra    : 16;
172         RK_U32  sw_refbuf_sum_hit    : 16;
173     } reg69_sum_inf;
174 
175     struct {
176         RK_U32  sw_ycomp_mv_sum     : 22;
177         RK_U32  sw_reserve          : 10;
178     } reg70_sum_mv;
179 
180     RK_U32      reg71_119_reserve[49];
181 
182     struct {
183         RK_U32  sw_reserve0         : 5;
184         RK_U32  sw_topfieldfirst_e  : 1;
185         RK_U32  sw_alt_scan_e       : 1;
186         RK_U32  sw_mb_height_off    : 4;
187         RK_U32  sw_pic_mb_hight_p   : 8;
188         RK_U32  sw_mb_width_off     : 4;
189         RK_U32  sw_pic_mb_width     : 9;
190     } reg120;
191 
192     struct {
193         RK_U32  sw_reserve          : 5;
194         RK_U32  sw_vp7_version      : 1;
195         RK_U32  sw_dc_match0        : 3;
196         RK_U32  sw_dc_match1        : 3;
197         RK_U32  sw_eable_bilinear   : 1;
198         RK_U32  sw_remain_mv        : 1;
199         RK_U32  sw_reserve1         : 6;
200         RK_U32  sw_dct2_start_bit   : 6;
201         RK_U32  sw_dct1_start_bit   : 6;
202     } reg121;
203 
204     struct {
205         RK_U32  sw_vop_time_incr    : 16;
206         RK_U32  sw_intradc_vlc_thr  : 3;
207         RK_U32  sw_ch_qp_offset     : 5;
208         RK_U32  sw_quant_type_1_en  : 1;
209         RK_U32  sw_sync_markers_en  : 1;
210         RK_U32  sw_stream_start_word: 6;
211     } reg122;
212 
213     struct {
214         RK_U32  sw_dc_comp1         : 16;
215         RK_U32  sw_dc_comp0         : 16;
216     } reg123;
217 
218     struct {
219         RK_U32  sw_stream1_len      : 24;
220         RK_U32  sw_coeffs_part_am   : 4;
221         RK_U32  sw_reserve          : 4;
222     } reg124;
223 
224     struct {
225         RK_U32  reserve             : 2;
226         RK_U32  sw_pred_bc_tap_5_3  : 10;
227         RK_U32  sw_pred_bc_tap_5_2  : 10;
228         RK_U32  sw_pred_bc_tap_5_1  : 10;
229     } reg125;
230 
231     struct {
232         RK_U32  reserve             : 2;
233         RK_U32  sw_pred_bc_tap_6_2  : 10;
234         RK_U32  sw_pred_bc_tap_6_1  : 10;
235         RK_U32  sw_pred_bc_tap_6_0  : 10;
236     } reg126;
237 
238     struct {
239         RK_U32  reserve             : 2;
240         RK_U32  sw_pred_bc_tap_7_1  : 10;
241         RK_U32  sw_pred_bc_tap_7_0  : 10;
242         RK_U32  sw_pred_bc_tap_6_3  : 10;
243     } reg127;
244 
245     struct {
246         RK_U32  sw_pred_tap_6_4     : 2;
247         RK_U32  sw_pred_tap_6_M1    : 2;
248         RK_U32  sw_pred_tap_4_4     : 2;
249         RK_U32  sw_pred_tap_4_M1    : 2;
250         RK_U32  sw_pred_tap_2_4     : 2;
251         RK_U32  sw_pred_tap_2_M1    : 2;
252         RK_U32  sw_pred_bc_tap_7_3  : 10;
253         RK_U32  sw_pred_bc_tap_7_2  : 10;
254     } reg128;
255 
256     struct {
257         RK_U32  sw_filt_level_3     : 6;
258         RK_U32  sw_filt_level_2     : 6;
259         RK_U32  sw_filt_level_1     : 6;
260         RK_U32  sw_filt_level_0     : 6;
261         RK_U32  reserve             : 8;
262     } reg129;
263 
264     struct {
265         RK_U32  sw_quant_1          : 11;
266         RK_U32  sw_quant_0          : 11;
267         RK_U32  sw_quant_delta_1    : 5;
268         RK_U32  sw_quant_delta_0    : 5;
269     } reg130;
270 
271 
272     RK_U32 reg131_ref0_base;
273 
274     struct {
275         RK_U32  sw_filt_mb_adj_3    : 7;
276         RK_U32  sw_filt_mb_adj_2    : 7;
277         RK_U32  sw_filt_mb_adj_1    : 7;
278         RK_U32  sw_filt_mb_adj_0    : 7;
279         RK_U32  sw_filt_sharpness   : 3;
280         RK_U32  sw_filt_type        : 1;
281     } reg132;
282 
283 
284     struct {
285         RK_U32  sw_filt_ref_adj_3   : 7;
286         RK_U32  sw_filt_ref_adj_2   : 7;
287         RK_U32  sw_filt_ref_adj_1   : 7;
288         RK_U32  sw_filt_ref_adj_0   : 7;
289         RK_U32  sw_reserve          : 4;
290     } reg133;
291 
292     RK_U32 reg134_ref2_base;
293     RK_U32 reg135_ref3_base;
294 
295     struct {
296         RK_U32  sw_prev_pic_type        : 1;
297         RK_U32  sw_rounding             : 1;
298         RK_U32  sw_fwd_mv_y_resolution  : 1;
299         RK_U32  sw_vrz_bit_of_bwd_mv    : 4;
300         RK_U32  sw_hrz_bit_of_bwd_mv    : 4;
301         RK_U32  sw_vrz_bit_of_fwd_mv    : 4;
302         RK_U32  sw_hrz_bit_of_fwd_mv    : 4;
303         RK_U32  sw_alt_scan_flag_e      : 1;
304         RK_U32  sw_reserve              : 12;
305     } reg136;
306 
307     struct {
308         RK_U32 sw_trb_per_trd_d0        : 27;
309         RK_U32 sw_reserve               : 5;
310     } reg137;
311 
312     struct {
313         RK_U32 sw_trb_per_trd_dm1       : 27;
314         RK_U32 sw_reserve               : 5;
315     } reg138;
316 
317     struct {
318         RK_U32 sw_trb_per_trd_d1        : 27;
319         RK_U32 sw_reserve               : 5;
320     } reg139;
321 
322     RK_U32 reg_dct_strm_base[5];
323     RK_U32 reg145_bitpl_ctrl_base;
324     RK_U32 reg_dct_strm1_base[2];
325 
326     RK_U32 reg148_ref1_base;
327 
328     RK_U32 reg149_segment_map_base;
329 
330 
331     struct {
332         RK_U32  sw_dct_start_bit_7   : 6;
333         RK_U32  sw_dct_start_bit_6   : 6;
334         RK_U32  sw_dct_start_bit_5   : 6;
335         RK_U32  sw_dct_start_bit_4   : 6;
336         RK_U32  sw_dct_start_bit_3   : 6;
337         RK_U32  sw_reserve           : 2;
338     } reg150;
339 
340     struct {
341         RK_U32  sw_quant_3           : 11;
342         RK_U32  sw_quant_2           : 11;
343         RK_U32  sw_quant_delta_3     : 5;
344         RK_U32  sw_quant_delta_2     : 5;
345     } reg151;
346 
347     struct {
348         RK_U32  sw_quant_5           : 11;
349         RK_U32  sw_quant_4           : 11;
350         RK_U32  sw_quant_delta_4     : 5;
351         RK_U32  sw_reserve           : 5;
352     } reg152;
353 
354     struct {
355         RK_U32  reserve              : 2;
356         RK_U32  sw_pred_bc_tap_1_1   : 10;
357         RK_U32  sw_pred_bc_tap_1_0   : 10;
358         RK_U32  sw_pred_bc_tap_0_3   : 10;
359     } reg153;
360 
361     struct {
362         RK_U32  reserve              : 2;
363         RK_U32  sw_pred_bc_tap_2_0   : 10;
364         RK_U32  sw_pred_bc_tap_1_3   : 10;
365         RK_U32  sw_pred_bc_tap_1_2   : 10;
366     } reg154;
367 
368     struct {
369         RK_U32  reserve              : 2;
370         RK_U32  sw_pred_bc_tap_2_3   : 10;
371         RK_U32  sw_pred_bc_tap_2_2   : 10;
372         RK_U32  sw_pred_bc_tap_2_1   : 10;
373     } reg155;
374 
375     struct {
376         RK_U32  reserve              : 2;
377         RK_U32  sw_pred_bc_tap_3_2   : 10;
378         RK_U32  sw_pred_bc_tap_3_1   : 10;
379         RK_U32  sw_pred_bc_tap_3_0   : 10;
380     } reg156;
381 
382     struct {
383         RK_U32  reserve              : 2;
384         RK_U32  sw_pred_bc_tap_4_1   : 10;
385         RK_U32  sw_pred_bc_tap_4_0   : 10;
386         RK_U32  sw_pred_bc_tap_3_3   : 10;
387     } reg157;
388 
389     struct {
390         RK_U32  reserve              : 2;
391         RK_U32  sw_pred_bc_tap_5_0   : 10;
392         RK_U32  sw_pred_bc_tap_4_3   : 10;
393         RK_U32  sw_pred_bc_tap_4_2   : 10;
394     } reg158;
395 } M4vdVdpu2Regs_t;
396 
397 #endif /*__HAL_M4V_VDPU2_REG_TBL_H__*/
398