xref: /rockchip-linux_mpp/mpp/vproc/vdpp/vdpp_reg.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1 /* SPDX-License-Identifier: Apache-2.0 OR MIT */
2 /*
3  * Copyright (c) 2024 Rockchip Electronics Co., Ltd.
4  */
5 
6 #ifndef __VDPP_REG_H__
7 #define __VDPP_REG_H__
8 
9 #include "rk_type.h"
10 
11 #define VDPP_REG_OFF_DMSR               (0x80)
12 #define VDPP_REG_OFF_YRGB_HOR_COE       (0x2000)
13 #define VDPP_REG_OFF_YRGB_VER_COE       (0x2200)
14 #define VDPP_REG_OFF_CBCR_HOR_COE       (0x2400)
15 #define VDPP_REG_OFF_CBCR_VER_COE       (0x2600)
16 #define VDPP_REG_OFF_ZME_COMMON         (0x2800)
17 
18 struct vdpp_reg {
19     struct {
20 
21         struct {
22             RK_U32 sw_vdpp_frm_en       : 1;
23         } reg0;         // 0x0000
24 
25         struct {
26             RK_U32 sw_vdpp_src_fmt      : 2;
27             RK_U32 sw_reserved_1        : 2;
28             RK_U32 sw_vdpp_src_yuv_swap : 2;
29             RK_U32 sw_reserved_2        : 2;
30             RK_U32 sw_vdpp_dst_fmt      : 2;
31             RK_U32 sw_reserved_3        : 2;
32             RK_U32 sw_vdpp_dst_yuv_swap : 2;
33             RK_U32 sw_reserved_4        : 2;
34             RK_U32 sw_vdpp_debug_data_en: 1;
35             RK_U32 sw_reserved_5        : 3;
36             RK_U32 sw_vdpp_rst_protect_dis      : 1;
37             RK_U32 sys_vdpp_sreset_p    : 1;
38             RK_U32 sw_vdpp_init_dis     : 1;
39             RK_U32 sw_reserved_6        : 1;
40             RK_U32 sw_vdpp_dbmsr_en     : 1;
41         } reg1;         // 0x0004
42 
43         struct {
44             RK_U32 sw_vdpp_working_mode : 2;
45         } reg2;         // 0x0008
46 
47         RK_U32 reg3;    // 0x000C
48 
49         struct {
50             RK_U32 sw_vdpp_clk_on       : 1;
51             RK_U32 sw_md_clk_on         : 1;
52             RK_U32 sw_dect_clk_on       : 1;
53             RK_U32 sw_me_clk_on         : 1;
54             RK_U32 sw_mc_clk_on         : 1;
55             RK_U32 sw_eedi_clk_on       : 1;
56             RK_U32 sw_ble_clk_on        : 1;
57             RK_U32 sw_out_clk_on        : 1;
58             RK_U32 sw_ctrl_clk_on       : 1;
59             RK_U32 sw_ram_clk_on        : 1;
60             RK_U32 sw_dma_clk_on        : 1;
61             RK_U32 sw_reg_clk_on        : 1;
62         } reg4;         // 0x0010
63 
64         struct {
65             RK_U32 ro_arst_finish_done  : 1;
66         } reg5;         // 0x0014
67 
68         RK_U32 reg6;    // 0x0018
69         RK_U32 reg7;    // 0x001c
70 
71         struct {
72             RK_U32 sw_vdpp_frm_done_en  : 1;
73             RK_U32 sw_vdpp_osd_max_en   : 1;
74             RK_U32 sw_reserved_1        : 2;
75             RK_U32 sw_vdpp_bus_error_en : 1;
76             RK_U32 sw_vdpp_timeout_int_en       : 1;
77             RK_U32 sw_vdpp_config_error_en      : 1;
78         } reg8;         // 0x0020
79 
80         struct {
81             RK_U32 sw_vdpp_frm_done_clr : 1;
82             RK_U32 sw_vdpp_osd_max_clr  : 1;
83             RK_U32 sw_reserved_1        : 2;
84             RK_U32 sw_vdpp_bus_error_clr: 1;
85             RK_U32 sw_vdpp_timeout_int_clr      : 1;
86             RK_U32 sw_vdpp_config_error_clr     : 1;
87         } reg9;        // 0x0024
88 
89         struct {
90             RK_U32 ro_frm_done_sts      : 1;
91             RK_U32 ro_osd_max_sts       : 1;
92             RK_U32 sw_reserved_1        : 2;
93             RK_U32 ro_bus_error_sts     : 1;
94             RK_U32 ro_timeout_sts       : 1;
95             RK_U32 ro_config_error_sts  : 1;
96         } reg10;        // 0x0028, read only
97 
98         struct {
99             RK_U32 ro_frm_done_raw      : 1;
100             RK_U32 ro_osd_max_raw       : 1;
101             RK_U32 sw_reserved_1        : 2;
102             RK_U32 ro_bus_error_raw     : 1;
103             RK_U32 ro_timeout_raw       : 1;
104             RK_U32 ro_config_error_raw  : 1;
105         } reg11;        // 0x002C, read only
106 
107         struct {
108             RK_U32 sw_vdpp_src_vir_y_stride     : 16;
109         } reg12;         // 0x0030
110 
111         struct {
112             RK_U32 sw_vdpp_dst_vir_y_stride     : 16;
113         } reg13;         // 0x0034
114 
115         struct {
116             RK_U32 sw_vdpp_src_pic_width        : 11;
117             RK_U32 sw_reserved_1        : 1;
118             RK_U32 sw_vdpp_src_right_redundant  : 4;
119             RK_U32 sw_vdpp_src_pic_height       : 11;
120             RK_U32 sw_reserved_2        : 1;
121             RK_U32 sw_vdpp_src_down_redundant   : 3;
122         } reg14;         // 0x0038
123 
124         struct {
125             RK_U32 sw_vdpp_dst_pic_width        : 11;
126             RK_U32 sw_reserved_1        : 1;
127             RK_U32 sw_vdpp_dst_right_redundant  : 4;
128             RK_U32 sw_vdpp_dst_pic_height       : 11;
129         } reg15;         // 0x003C
130 
131         RK_U32 reg16;    // 0x0040
132         RK_U32 reg17;    // 0x0044
133         RK_U32 reg18;    // 0x0048
134         RK_U32 reg19;    // 0x004C
135 
136         struct {
137             RK_U32 sw_vdpp_timeout_cnt  : 31;
138             RK_U32 sw_vdpp_timeout_en   : 1;
139         } reg20;         // 0x0050
140 
141         struct {
142             RK_U32 svnbuild     : 20;
143             RK_U32 minor        : 8;
144             RK_U32 major        : 4;
145         } reg21;         // 0x0054
146 
147         struct {
148             RK_U32 dbg_frm_cnt  : 16;
149         } reg22;         // 0x0058
150 
151         RK_U32 reg23;    // 0x005C
152 
153         struct {
154             RK_U32 sw_vdpp_src_addr_y   : 32;
155         } reg24;         // 0x0060
156 
157         struct {
158             RK_U32 sw_vdpp_src_addr_uv  : 32;
159         } reg25;         // 0x0064
160 
161         struct {
162             RK_U32 sw_vdpp_dst_addr_y   : 32;
163         } reg26;         // 0x0068
164 
165         struct {
166             RK_U32 sw_vdpp_dst_addr_uv  : 32;
167         } reg27;         // 0x006C
168 
169     } common;            // offset: 0x1000
170     RK_U32 reg_common_28_31[4];
171 
172 };
173 
174 #endif
175