xref: /rockchip-linux_mpp/mpp/hal/rkdec/h264d/hal_h264d_rkv_reg.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1 /*
2 *
3 * Copyright 2015 Rockchip Electronics Co. LTD
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 
18 
19 #ifndef __HAL_H264D_RKV_REG_H__
20 #define __HAL_H264D_RKV_REG_H__
21 
22 #include "mpp_hal.h"
23 
24 typedef struct h264d_rkv_regs_t {
25     struct {
26         RK_U32    minor_ver : 8;
27         RK_U32    level : 1;
28         RK_U32    dec_support : 3;
29         RK_U32    profile : 1;
30         RK_U32    reserve0 : 1;
31         RK_U32    codec_flag : 1;
32         RK_U32    reserve1 : 1;
33         RK_U32    prod_num : 16;
34     } sw00;
35     struct {
36         RK_U32    dec_e : 1;//0
37         RK_U32    dec_clkgate_e : 1; // 1
38         RK_U32    reserve0 : 1;// 2
39         RK_U32    timeout_mode : 1; // 3
40         RK_U32    dec_irq_dis : 1;//4    // 4
41         RK_U32    dec_timeout_e : 1; //5
42         RK_U32    buf_empty_en : 1; // 6
43         RK_U32    stmerror_waitdecfifo_empty : 1; // 7
44         RK_U32    dec_irq : 1; // 8
45         RK_U32    dec_irq_raw : 1; // 9
46         RK_U32    reserve2 : 2;
47         RK_U32    dec_rdy_sta : 1; //12
48         RK_U32    dec_bus_sta : 1; //13
49         RK_U32    dec_error_sta : 1; // 14
50         RK_U32    dec_timeout_sta : 1; //15
51         RK_U32    dec_empty_sta : 1; // 16
52         RK_U32    colmv_ref_error_sta : 1; // 17
53         RK_U32    cabu_end_sta : 1; // 18
54         RK_U32    h264orvp9_error_mode : 1; //19
55         RK_U32    softrst_en_p : 1; //20
56         RK_U32    force_softreset_valid : 1; //21
57         RK_U32    softreset_rdy : 1; // 22
58         RK_U32    reserve1 : 9;
59     } sw01;
60     struct {
61         RK_U32    in_endian : 1;
62         RK_U32    in_swap32_e : 1;
63         RK_U32    in_swap64_e : 1;
64         RK_U32    str_endian : 1;
65         RK_U32    str_swap32_e : 1;
66         RK_U32    str_swap64_e : 1;
67         RK_U32    out_endian : 1;
68         RK_U32    out_swap32_e : 1;
69         RK_U32    out_cbcr_swap : 1;
70         RK_U32    reserve0 : 1;
71         RK_U32    rlc_mode_direct_write : 1;
72         RK_U32    rlc_mode : 1;
73         RK_U32    strm_start_bit : 7;
74         RK_U32    reserve1 : 1;
75         RK_U32    dec_mode : 2;
76         RK_U32    reserve2 : 2;
77         RK_U32    rps_mode : 1;
78         RK_U32    stream_mode : 1;
79         RK_U32    stream_lastpacket : 1;
80         RK_U32    firstslice_flag : 1;
81         RK_U32    frame_orslice : 1;
82         RK_U32    buspr_slot_disable : 1;
83         RK_U32    reverse3 : 2;
84     } sw02;
85     struct {
86         RK_U32    y_hor_virstride : 9;
87         RK_U32    reserve : 2;
88         RK_U32    slice_num_highbit : 1;
89         RK_U32    uv_hor_virstride : 9;
90         RK_U32    slice_num_lowbits : 11;
91     } sw03;
92     struct {
93         RK_U32    strm_rlc_base : 32;
94     } sw04;
95     struct {
96         RK_U32    stream_len : 27;
97         RK_U32    reverse0 : 5;
98     } sw05;
99     struct {
100         RK_U32    cabactbl_base : 32;
101     } sw06;
102     struct {
103         RK_U32    decout_base : 32;
104     } sw07;
105     struct {
106         RK_U32    y_virstride : 20;
107         RK_U32    reverse0 : 12;
108     } sw08;
109     struct {
110         RK_U32    yuv_virstride : 21;
111         RK_U32    reverse0 : 11;
112     } sw09;
113     struct {
114         /* bit0: ref0_14_field
115          * bit1: ref0_14_topfield_used
116          * bit2: ref0_14_botfield_used
117          * bit3: ref0_14_colmv_use_flag
118          */
119         RK_U32    ref0_14_base; /* bit4-bit31 */
120     } sw10_24[15];
121     struct {
122         RK_U32    ref0_14_poc : 32;
123     } sw25_39[15];
124     struct {
125         RK_U32    cur_poc : 32;
126     } sw40;
127     struct {
128         RK_U32    rlcwrite_base;
129     } sw41;
130     struct {
131         RK_U32    pps_base;
132     } sw42;
133     struct {
134         RK_U32    rps_base;
135     } sw43;
136     struct {
137         RK_U32    strmd_error_e : 28;
138         RK_U32    reserve : 4;
139     } sw44;
140     struct {
141         RK_U32    strmd_error_status : 28;
142         RK_U32    colmv_error_ref_picidx : 4;
143     } sw45;
144     struct {
145         RK_U32    strmd_error_ctu_xoffset : 8;
146         RK_U32    strmd_error_ctu_yoffset : 8;
147         RK_U32    streamfifo_space2full : 7;
148         RK_U32    reserve0 : 1;
149         RK_U32    vp9_error_ctu0_en : 1;
150         RK_U32    reverse1 : 7;
151     } sw46;
152     struct {
153         RK_U32    saowr_xoffet : 9;
154         RK_U32    reserve0 : 7;
155         RK_U32    saowr_yoffset : 10;
156         RK_U32    reverse1 : 6;
157     } sw47;
158     struct {
159         /* bit0: ref15_field
160          * bit1: ref15_topfield_used
161          * bit2: ref15_botfield_used
162          * bit3: ref15_colmv_use_flag
163          */
164         RK_U32    ref15_base; /* bit4-bit31 */
165     } sw48;
166     struct {
167         RK_U32    ref15_29_poc : 32;
168     } sw49_63[15];
169     struct {
170         RK_U32    performance_cycle : 32;
171     } sw64;
172     struct {
173         RK_U32    axi_ddr_rdata : 32;
174     } sw65;
175     struct {
176         RK_U32    axi_ddr_rdata : 32;
177     } sw66;
178     struct {
179         RK_U32    busifd_resetn : 1;
180         RK_U32    cabac_resetn : 1;
181         RK_U32    dec_ctrl_resetn : 1;
182         RK_U32    transd_resetn : 1;
183         RK_U32    intra_resetn : 1;
184         RK_U32    inter_resetn : 1;
185         RK_U32    recon_resetn : 1;
186         RK_U32    filer_resetn : 1;
187         RK_U32    reverse0 : 24;
188     } sw67;
189     struct {
190         RK_U32    perf_cnt0_sel : 6;
191         RK_U32    reserve0 : 2;
192         RK_U32    perf_cnt1_sel : 6;
193         RK_U32    reserve1 : 2;
194         RK_U32    perf_cnt2_sel : 6;
195         RK_U32    reverse1 : 10;
196     } sw68;
197     struct {
198         RK_U32    perf_cnt0 : 32;
199     } sw69;
200     struct {
201         RK_U32    perf_cnt1 : 32;
202     } sw70;
203     struct {
204         RK_U32    perf_cnt2 : 32;
205     } sw71;
206     struct {
207         RK_U32    ref30_poc;
208     } sw72;
209     struct {
210         RK_U32    ref31_poc;
211     } sw73;
212     struct {
213         RK_U32    cur_poc1 : 32;
214     } sw74;
215     struct {
216         RK_U32    errorinfo_base : 32;
217     } sw75;
218     struct {
219         RK_U32    slicedec_num : 14;
220         RK_U32    reserve0 : 1;
221         RK_U32    strmd_detect_error_flag : 1;
222         RK_U32    error_packet_num : 14;
223         RK_U32    reverse1 : 2;
224     } sw76;
225     struct {
226         RK_U32    error_en_highbits : 30;
227         RK_U32    reserve : 2;
228     } sw77;
229     RK_U32        reverse[2];
230 } H264dRkvRegs_t;
231 
232 
233 #ifdef __cplusplus
234 extern "C" {
235 #endif
236 
237 extern const MppHalApi hal_h264d_rkvdpu;
238 
239 #ifdef __cplusplus
240 }
241 #endif
242 
243 #endif /* __HAL_H264D_RKV_REG_H__ */
244