xref: /dflybsd-src/sys/dev/drm/amd/display/dc/dcn10/dcn10_optc.h (revision b843c749addef9340ee7d4e250b09fdd492602a1)
1*b843c749SSergey Zigachev /*
2*b843c749SSergey Zigachev  * Copyright 2012-15 Advanced Micro Devices, Inc.
3*b843c749SSergey Zigachev  *
4*b843c749SSergey Zigachev  * Permission is hereby granted, free of charge, to any person obtaining a
5*b843c749SSergey Zigachev  * copy of this software and associated documentation files (the "Software"),
6*b843c749SSergey Zigachev  * to deal in the Software without restriction, including without limitation
7*b843c749SSergey Zigachev  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*b843c749SSergey Zigachev  *  and/or sell copies of the Software, and to permit persons to whom the
9*b843c749SSergey Zigachev  * Software is furnished to do so, subject to the following conditions:
10*b843c749SSergey Zigachev  *
11*b843c749SSergey Zigachev  * The above copyright notice and this permission notice shall be included in
12*b843c749SSergey Zigachev  * all copies or substantial portions of the Software.
13*b843c749SSergey Zigachev  *
14*b843c749SSergey Zigachev  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*b843c749SSergey Zigachev  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*b843c749SSergey Zigachev  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17*b843c749SSergey Zigachev  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18*b843c749SSergey Zigachev  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19*b843c749SSergey Zigachev  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20*b843c749SSergey Zigachev  * OTHER DEALINGS IN THE SOFTWARE.
21*b843c749SSergey Zigachev  *
22*b843c749SSergey Zigachev  * Authors: AMD
23*b843c749SSergey Zigachev  *
24*b843c749SSergey Zigachev  */
25*b843c749SSergey Zigachev 
26*b843c749SSergey Zigachev #ifndef __DC_TIMING_GENERATOR_DCN10_H__
27*b843c749SSergey Zigachev #define __DC_TIMING_GENERATOR_DCN10_H__
28*b843c749SSergey Zigachev 
29*b843c749SSergey Zigachev #include "timing_generator.h"
30*b843c749SSergey Zigachev 
31*b843c749SSergey Zigachev #define DCN10TG_FROM_TG(tg)\
32*b843c749SSergey Zigachev 	container_of(tg, struct optc, base)
33*b843c749SSergey Zigachev 
34*b843c749SSergey Zigachev #define TG_COMMON_REG_LIST_DCN(inst) \
35*b843c749SSergey Zigachev 	SRI(OTG_VSTARTUP_PARAM, OTG, inst),\
36*b843c749SSergey Zigachev 	SRI(OTG_VUPDATE_PARAM, OTG, inst),\
37*b843c749SSergey Zigachev 	SRI(OTG_VREADY_PARAM, OTG, inst),\
38*b843c749SSergey Zigachev 	SRI(OTG_BLANK_CONTROL, OTG, inst),\
39*b843c749SSergey Zigachev 	SRI(OTG_MASTER_UPDATE_LOCK, OTG, inst),\
40*b843c749SSergey Zigachev 	SRI(OTG_GLOBAL_CONTROL0, OTG, inst),\
41*b843c749SSergey Zigachev 	SRI(OTG_DOUBLE_BUFFER_CONTROL, OTG, inst),\
42*b843c749SSergey Zigachev 	SRI(OTG_H_TOTAL, OTG, inst),\
43*b843c749SSergey Zigachev 	SRI(OTG_H_BLANK_START_END, OTG, inst),\
44*b843c749SSergey Zigachev 	SRI(OTG_H_SYNC_A, OTG, inst),\
45*b843c749SSergey Zigachev 	SRI(OTG_H_SYNC_A_CNTL, OTG, inst),\
46*b843c749SSergey Zigachev 	SRI(OTG_H_TIMING_CNTL, OTG, inst),\
47*b843c749SSergey Zigachev 	SRI(OTG_V_TOTAL, OTG, inst),\
48*b843c749SSergey Zigachev 	SRI(OTG_V_BLANK_START_END, OTG, inst),\
49*b843c749SSergey Zigachev 	SRI(OTG_V_SYNC_A, OTG, inst),\
50*b843c749SSergey Zigachev 	SRI(OTG_V_SYNC_A_CNTL, OTG, inst),\
51*b843c749SSergey Zigachev 	SRI(OTG_INTERLACE_CONTROL, OTG, inst),\
52*b843c749SSergey Zigachev 	SRI(OTG_CONTROL, OTG, inst),\
53*b843c749SSergey Zigachev 	SRI(OTG_STEREO_CONTROL, OTG, inst),\
54*b843c749SSergey Zigachev 	SRI(OTG_3D_STRUCTURE_CONTROL, OTG, inst),\
55*b843c749SSergey Zigachev 	SRI(OTG_STEREO_STATUS, OTG, inst),\
56*b843c749SSergey Zigachev 	SRI(OTG_V_TOTAL_MAX, OTG, inst),\
57*b843c749SSergey Zigachev 	SRI(OTG_V_TOTAL_MIN, OTG, inst),\
58*b843c749SSergey Zigachev 	SRI(OTG_V_TOTAL_CONTROL, OTG, inst),\
59*b843c749SSergey Zigachev 	SRI(OTG_TRIGA_CNTL, OTG, inst),\
60*b843c749SSergey Zigachev 	SRI(OTG_FORCE_COUNT_NOW_CNTL, OTG, inst),\
61*b843c749SSergey Zigachev 	SRI(OTG_STATIC_SCREEN_CONTROL, OTG, inst),\
62*b843c749SSergey Zigachev 	SRI(OTG_STATUS_FRAME_COUNT, OTG, inst),\
63*b843c749SSergey Zigachev 	SRI(OTG_STATUS, OTG, inst),\
64*b843c749SSergey Zigachev 	SRI(OTG_STATUS_POSITION, OTG, inst),\
65*b843c749SSergey Zigachev 	SRI(OTG_NOM_VERT_POSITION, OTG, inst),\
66*b843c749SSergey Zigachev 	SRI(OTG_BLACK_COLOR, OTG, inst),\
67*b843c749SSergey Zigachev 	SRI(OTG_CLOCK_CONTROL, OTG, inst),\
68*b843c749SSergey Zigachev 	SRI(OTG_VERTICAL_INTERRUPT0_CONTROL, OTG, inst),\
69*b843c749SSergey Zigachev 	SRI(OTG_VERTICAL_INTERRUPT0_POSITION, OTG, inst),\
70*b843c749SSergey Zigachev 	SRI(OTG_VERTICAL_INTERRUPT2_CONTROL, OTG, inst),\
71*b843c749SSergey Zigachev 	SRI(OTG_VERTICAL_INTERRUPT2_POSITION, OTG, inst),\
72*b843c749SSergey Zigachev 	SRI(OPTC_INPUT_CLOCK_CONTROL, ODM, inst),\
73*b843c749SSergey Zigachev 	SRI(OPTC_DATA_SOURCE_SELECT, ODM, inst),\
74*b843c749SSergey Zigachev 	SRI(OPTC_INPUT_GLOBAL_CONTROL, ODM, inst),\
75*b843c749SSergey Zigachev 	SRI(CONTROL, VTG, inst),\
76*b843c749SSergey Zigachev 	SRI(OTG_VERT_SYNC_CONTROL, OTG, inst),\
77*b843c749SSergey Zigachev 	SRI(OTG_MASTER_UPDATE_MODE, OTG, inst),\
78*b843c749SSergey Zigachev 	SRI(OTG_GSL_CONTROL, OTG, inst),\
79*b843c749SSergey Zigachev 	SRI(OTG_CRC_CNTL, OTG, inst),\
80*b843c749SSergey Zigachev 	SRI(OTG_CRC0_DATA_RG, OTG, inst),\
81*b843c749SSergey Zigachev 	SRI(OTG_CRC0_DATA_B, OTG, inst),\
82*b843c749SSergey Zigachev 	SRI(OTG_CRC0_WINDOWA_X_CONTROL, OTG, inst),\
83*b843c749SSergey Zigachev 	SRI(OTG_CRC0_WINDOWA_Y_CONTROL, OTG, inst),\
84*b843c749SSergey Zigachev 	SRI(OTG_CRC0_WINDOWB_X_CONTROL, OTG, inst),\
85*b843c749SSergey Zigachev 	SRI(OTG_CRC0_WINDOWB_Y_CONTROL, OTG, inst)
86*b843c749SSergey Zigachev 
87*b843c749SSergey Zigachev #define TG_COMMON_REG_LIST_DCN1_0(inst) \
88*b843c749SSergey Zigachev 	TG_COMMON_REG_LIST_DCN(inst),\
89*b843c749SSergey Zigachev 	SRI(OTG_TEST_PATTERN_PARAMETERS, OTG, inst),\
90*b843c749SSergey Zigachev 	SRI(OTG_TEST_PATTERN_CONTROL, OTG, inst),\
91*b843c749SSergey Zigachev 	SRI(OTG_TEST_PATTERN_COLOR, OTG, inst)
92*b843c749SSergey Zigachev 
93*b843c749SSergey Zigachev 
94*b843c749SSergey Zigachev struct dcn_optc_registers {
95*b843c749SSergey Zigachev 	uint32_t OTG_GLOBAL_CONTROL1;
96*b843c749SSergey Zigachev 	uint32_t OTG_GLOBAL_CONTROL2;
97*b843c749SSergey Zigachev 	uint32_t OTG_VERT_SYNC_CONTROL;
98*b843c749SSergey Zigachev 	uint32_t OTG_MASTER_UPDATE_MODE;
99*b843c749SSergey Zigachev 	uint32_t OTG_GSL_CONTROL;
100*b843c749SSergey Zigachev 	uint32_t OTG_VSTARTUP_PARAM;
101*b843c749SSergey Zigachev 	uint32_t OTG_VUPDATE_PARAM;
102*b843c749SSergey Zigachev 	uint32_t OTG_VREADY_PARAM;
103*b843c749SSergey Zigachev 	uint32_t OTG_BLANK_CONTROL;
104*b843c749SSergey Zigachev 	uint32_t OTG_MASTER_UPDATE_LOCK;
105*b843c749SSergey Zigachev 	uint32_t OTG_GLOBAL_CONTROL0;
106*b843c749SSergey Zigachev 	uint32_t OTG_DOUBLE_BUFFER_CONTROL;
107*b843c749SSergey Zigachev 	uint32_t OTG_H_TOTAL;
108*b843c749SSergey Zigachev 	uint32_t OTG_H_BLANK_START_END;
109*b843c749SSergey Zigachev 	uint32_t OTG_H_SYNC_A;
110*b843c749SSergey Zigachev 	uint32_t OTG_H_SYNC_A_CNTL;
111*b843c749SSergey Zigachev 	uint32_t OTG_H_TIMING_CNTL;
112*b843c749SSergey Zigachev 	uint32_t OTG_V_TOTAL;
113*b843c749SSergey Zigachev 	uint32_t OTG_V_BLANK_START_END;
114*b843c749SSergey Zigachev 	uint32_t OTG_V_SYNC_A;
115*b843c749SSergey Zigachev 	uint32_t OTG_V_SYNC_A_CNTL;
116*b843c749SSergey Zigachev 	uint32_t OTG_INTERLACE_CONTROL;
117*b843c749SSergey Zigachev 	uint32_t OTG_CONTROL;
118*b843c749SSergey Zigachev 	uint32_t OTG_STEREO_CONTROL;
119*b843c749SSergey Zigachev 	uint32_t OTG_3D_STRUCTURE_CONTROL;
120*b843c749SSergey Zigachev 	uint32_t OTG_STEREO_STATUS;
121*b843c749SSergey Zigachev 	uint32_t OTG_V_TOTAL_MAX;
122*b843c749SSergey Zigachev 	uint32_t OTG_V_TOTAL_MIN;
123*b843c749SSergey Zigachev 	uint32_t OTG_V_TOTAL_CONTROL;
124*b843c749SSergey Zigachev 	uint32_t OTG_TRIGA_CNTL;
125*b843c749SSergey Zigachev 	uint32_t OTG_FORCE_COUNT_NOW_CNTL;
126*b843c749SSergey Zigachev 	uint32_t OTG_STATIC_SCREEN_CONTROL;
127*b843c749SSergey Zigachev 	uint32_t OTG_STATUS_FRAME_COUNT;
128*b843c749SSergey Zigachev 	uint32_t OTG_STATUS;
129*b843c749SSergey Zigachev 	uint32_t OTG_STATUS_POSITION;
130*b843c749SSergey Zigachev 	uint32_t OTG_NOM_VERT_POSITION;
131*b843c749SSergey Zigachev 	uint32_t OTG_BLACK_COLOR;
132*b843c749SSergey Zigachev 	uint32_t OTG_TEST_PATTERN_PARAMETERS;
133*b843c749SSergey Zigachev 	uint32_t OTG_TEST_PATTERN_CONTROL;
134*b843c749SSergey Zigachev 	uint32_t OTG_TEST_PATTERN_COLOR;
135*b843c749SSergey Zigachev 	uint32_t OTG_CLOCK_CONTROL;
136*b843c749SSergey Zigachev 	uint32_t OTG_VERTICAL_INTERRUPT0_CONTROL;
137*b843c749SSergey Zigachev 	uint32_t OTG_VERTICAL_INTERRUPT0_POSITION;
138*b843c749SSergey Zigachev 	uint32_t OTG_VERTICAL_INTERRUPT2_CONTROL;
139*b843c749SSergey Zigachev 	uint32_t OTG_VERTICAL_INTERRUPT2_POSITION;
140*b843c749SSergey Zigachev 	uint32_t OPTC_INPUT_CLOCK_CONTROL;
141*b843c749SSergey Zigachev 	uint32_t OPTC_DATA_SOURCE_SELECT;
142*b843c749SSergey Zigachev 	uint32_t OPTC_MEMORY_CONFIG;
143*b843c749SSergey Zigachev 	uint32_t OPTC_INPUT_GLOBAL_CONTROL;
144*b843c749SSergey Zigachev 	uint32_t CONTROL;
145*b843c749SSergey Zigachev 	uint32_t OTG_GSL_WINDOW_X;
146*b843c749SSergey Zigachev 	uint32_t OTG_GSL_WINDOW_Y;
147*b843c749SSergey Zigachev 	uint32_t OTG_VUPDATE_KEEPOUT;
148*b843c749SSergey Zigachev 	uint32_t OTG_CRC_CNTL;
149*b843c749SSergey Zigachev 	uint32_t OTG_CRC0_DATA_RG;
150*b843c749SSergey Zigachev 	uint32_t OTG_CRC0_DATA_B;
151*b843c749SSergey Zigachev 	uint32_t OTG_CRC0_WINDOWA_X_CONTROL;
152*b843c749SSergey Zigachev 	uint32_t OTG_CRC0_WINDOWA_Y_CONTROL;
153*b843c749SSergey Zigachev 	uint32_t OTG_CRC0_WINDOWB_X_CONTROL;
154*b843c749SSergey Zigachev 	uint32_t OTG_CRC0_WINDOWB_Y_CONTROL;
155*b843c749SSergey Zigachev };
156*b843c749SSergey Zigachev 
157*b843c749SSergey Zigachev #define TG_COMMON_MASK_SH_LIST_DCN(mask_sh)\
158*b843c749SSergey Zigachev 	SF(OTG0_OTG_VSTARTUP_PARAM, VSTARTUP_START, mask_sh),\
159*b843c749SSergey Zigachev 	SF(OTG0_OTG_VUPDATE_PARAM, VUPDATE_OFFSET, mask_sh),\
160*b843c749SSergey Zigachev 	SF(OTG0_OTG_VUPDATE_PARAM, VUPDATE_WIDTH, mask_sh),\
161*b843c749SSergey Zigachev 	SF(OTG0_OTG_VREADY_PARAM, VREADY_OFFSET, mask_sh),\
162*b843c749SSergey Zigachev 	SF(OTG0_OTG_BLANK_CONTROL, OTG_BLANK_DATA_EN, mask_sh),\
163*b843c749SSergey Zigachev 	SF(OTG0_OTG_BLANK_CONTROL, OTG_BLANK_DE_MODE, mask_sh),\
164*b843c749SSergey Zigachev 	SF(OTG0_OTG_BLANK_CONTROL, OTG_CURRENT_BLANK_STATE, mask_sh),\
165*b843c749SSergey Zigachev 	SF(OTG0_OTG_MASTER_UPDATE_LOCK, OTG_MASTER_UPDATE_LOCK, mask_sh),\
166*b843c749SSergey Zigachev 	SF(OTG0_OTG_MASTER_UPDATE_LOCK, UPDATE_LOCK_STATUS, mask_sh),\
167*b843c749SSergey Zigachev 	SF(OTG0_OTG_GLOBAL_CONTROL0, OTG_MASTER_UPDATE_LOCK_SEL, mask_sh),\
168*b843c749SSergey Zigachev 	SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_UPDATE_PENDING, mask_sh),\
169*b843c749SSergey Zigachev 	SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_BLANK_DATA_DOUBLE_BUFFER_EN, mask_sh),\
170*b843c749SSergey Zigachev 	SF(OTG0_OTG_H_TOTAL, OTG_H_TOTAL, mask_sh),\
171*b843c749SSergey Zigachev 	SF(OTG0_OTG_H_BLANK_START_END, OTG_H_BLANK_START, mask_sh),\
172*b843c749SSergey Zigachev 	SF(OTG0_OTG_H_BLANK_START_END, OTG_H_BLANK_END, mask_sh),\
173*b843c749SSergey Zigachev 	SF(OTG0_OTG_H_SYNC_A, OTG_H_SYNC_A_START, mask_sh),\
174*b843c749SSergey Zigachev 	SF(OTG0_OTG_H_SYNC_A, OTG_H_SYNC_A_END, mask_sh),\
175*b843c749SSergey Zigachev 	SF(OTG0_OTG_H_SYNC_A_CNTL, OTG_H_SYNC_A_POL, mask_sh),\
176*b843c749SSergey Zigachev 	SF(OTG0_OTG_H_TIMING_CNTL, OTG_H_TIMING_DIV_BY2, mask_sh),\
177*b843c749SSergey Zigachev 	SF(OTG0_OTG_V_TOTAL, OTG_V_TOTAL, mask_sh),\
178*b843c749SSergey Zigachev 	SF(OTG0_OTG_V_BLANK_START_END, OTG_V_BLANK_START, mask_sh),\
179*b843c749SSergey Zigachev 	SF(OTG0_OTG_V_BLANK_START_END, OTG_V_BLANK_END, mask_sh),\
180*b843c749SSergey Zigachev 	SF(OTG0_OTG_V_SYNC_A, OTG_V_SYNC_A_START, mask_sh),\
181*b843c749SSergey Zigachev 	SF(OTG0_OTG_V_SYNC_A, OTG_V_SYNC_A_END, mask_sh),\
182*b843c749SSergey Zigachev 	SF(OTG0_OTG_V_SYNC_A_CNTL, OTG_V_SYNC_A_POL, mask_sh),\
183*b843c749SSergey Zigachev 	SF(OTG0_OTG_INTERLACE_CONTROL, OTG_INTERLACE_ENABLE, mask_sh),\
184*b843c749SSergey Zigachev 	SF(OTG0_OTG_CONTROL, OTG_MASTER_EN, mask_sh),\
185*b843c749SSergey Zigachev 	SF(OTG0_OTG_CONTROL, OTG_START_POINT_CNTL, mask_sh),\
186*b843c749SSergey Zigachev 	SF(OTG0_OTG_CONTROL, OTG_DISABLE_POINT_CNTL, mask_sh),\
187*b843c749SSergey Zigachev 	SF(OTG0_OTG_CONTROL, OTG_FIELD_NUMBER_CNTL, mask_sh),\
188*b843c749SSergey Zigachev 	SF(OTG0_OTG_STEREO_CONTROL, OTG_STEREO_EN, mask_sh),\
189*b843c749SSergey Zigachev 	SF(OTG0_OTG_STEREO_CONTROL, OTG_STEREO_SYNC_OUTPUT_LINE_NUM, mask_sh),\
190*b843c749SSergey Zigachev 	SF(OTG0_OTG_STEREO_CONTROL, OTG_STEREO_SYNC_OUTPUT_POLARITY, mask_sh),\
191*b843c749SSergey Zigachev 	SF(OTG0_OTG_STEREO_CONTROL, OTG_STEREO_EYE_FLAG_POLARITY, mask_sh),\
192*b843c749SSergey Zigachev 	SF(OTG0_OTG_STEREO_CONTROL, OTG_DISABLE_STEREOSYNC_OUTPUT_FOR_DP, mask_sh),\
193*b843c749SSergey Zigachev 	SF(OTG0_OTG_STEREO_CONTROL, OTG_DISABLE_STEREOSYNC_OUTPUT_FOR_DP, mask_sh),\
194*b843c749SSergey Zigachev 	SF(OTG0_OTG_STEREO_STATUS, OTG_STEREO_CURRENT_EYE, mask_sh),\
195*b843c749SSergey Zigachev 	SF(OTG0_OTG_3D_STRUCTURE_CONTROL, OTG_3D_STRUCTURE_EN, mask_sh),\
196*b843c749SSergey Zigachev 	SF(OTG0_OTG_3D_STRUCTURE_CONTROL, OTG_3D_STRUCTURE_V_UPDATE_MODE, mask_sh),\
197*b843c749SSergey Zigachev 	SF(OTG0_OTG_3D_STRUCTURE_CONTROL, OTG_3D_STRUCTURE_STEREO_SEL_OVR, mask_sh),\
198*b843c749SSergey Zigachev 	SF(OTG0_OTG_V_TOTAL_MAX, OTG_V_TOTAL_MAX, mask_sh),\
199*b843c749SSergey Zigachev 	SF(OTG0_OTG_V_TOTAL_MIN, OTG_V_TOTAL_MIN, mask_sh),\
200*b843c749SSergey Zigachev 	SF(OTG0_OTG_V_TOTAL_CONTROL, OTG_V_TOTAL_MIN_SEL, mask_sh),\
201*b843c749SSergey Zigachev 	SF(OTG0_OTG_V_TOTAL_CONTROL, OTG_V_TOTAL_MAX_SEL, mask_sh),\
202*b843c749SSergey Zigachev 	SF(OTG0_OTG_V_TOTAL_CONTROL, OTG_FORCE_LOCK_ON_EVENT, mask_sh),\
203*b843c749SSergey Zigachev 	SF(OTG0_OTG_V_TOTAL_CONTROL, OTG_SET_V_TOTAL_MIN_MASK_EN, mask_sh),\
204*b843c749SSergey Zigachev 	SF(OTG0_OTG_V_TOTAL_CONTROL, OTG_SET_V_TOTAL_MIN_MASK, mask_sh),\
205*b843c749SSergey Zigachev 	SF(OTG0_OTG_FORCE_COUNT_NOW_CNTL, OTG_FORCE_COUNT_NOW_CLEAR, mask_sh),\
206*b843c749SSergey Zigachev 	SF(OTG0_OTG_FORCE_COUNT_NOW_CNTL, OTG_FORCE_COUNT_NOW_MODE, mask_sh),\
207*b843c749SSergey Zigachev 	SF(OTG0_OTG_FORCE_COUNT_NOW_CNTL, OTG_FORCE_COUNT_NOW_OCCURRED, mask_sh),\
208*b843c749SSergey Zigachev 	SF(OTG0_OTG_TRIGA_CNTL, OTG_TRIGA_SOURCE_SELECT, mask_sh),\
209*b843c749SSergey Zigachev 	SF(OTG0_OTG_TRIGA_CNTL, OTG_TRIGA_SOURCE_PIPE_SELECT, mask_sh),\
210*b843c749SSergey Zigachev 	SF(OTG0_OTG_TRIGA_CNTL, OTG_TRIGA_RISING_EDGE_DETECT_CNTL, mask_sh),\
211*b843c749SSergey Zigachev 	SF(OTG0_OTG_TRIGA_CNTL, OTG_TRIGA_FALLING_EDGE_DETECT_CNTL, mask_sh),\
212*b843c749SSergey Zigachev 	SF(OTG0_OTG_STATIC_SCREEN_CONTROL, OTG_STATIC_SCREEN_EVENT_MASK, mask_sh),\
213*b843c749SSergey Zigachev 	SF(OTG0_OTG_STATIC_SCREEN_CONTROL, OTG_STATIC_SCREEN_FRAME_COUNT, mask_sh),\
214*b843c749SSergey Zigachev 	SF(OTG0_OTG_STATUS_FRAME_COUNT, OTG_FRAME_COUNT, mask_sh),\
215*b843c749SSergey Zigachev 	SF(OTG0_OTG_STATUS, OTG_V_BLANK, mask_sh),\
216*b843c749SSergey Zigachev 	SF(OTG0_OTG_STATUS, OTG_V_ACTIVE_DISP, mask_sh),\
217*b843c749SSergey Zigachev 	SF(OTG0_OTG_STATUS_POSITION, OTG_HORZ_COUNT, mask_sh),\
218*b843c749SSergey Zigachev 	SF(OTG0_OTG_STATUS_POSITION, OTG_VERT_COUNT, mask_sh),\
219*b843c749SSergey Zigachev 	SF(OTG0_OTG_NOM_VERT_POSITION, OTG_VERT_COUNT_NOM, mask_sh),\
220*b843c749SSergey Zigachev 	SF(OTG0_OTG_BLACK_COLOR, OTG_BLACK_COLOR_B_CB, mask_sh),\
221*b843c749SSergey Zigachev 	SF(OTG0_OTG_BLACK_COLOR, OTG_BLACK_COLOR_G_Y, mask_sh),\
222*b843c749SSergey Zigachev 	SF(OTG0_OTG_BLACK_COLOR, OTG_BLACK_COLOR_R_CR, mask_sh),\
223*b843c749SSergey Zigachev 	SF(OTG0_OTG_CLOCK_CONTROL, OTG_BUSY, mask_sh),\
224*b843c749SSergey Zigachev 	SF(OTG0_OTG_CLOCK_CONTROL, OTG_CLOCK_EN, mask_sh),\
225*b843c749SSergey Zigachev 	SF(OTG0_OTG_CLOCK_CONTROL, OTG_CLOCK_ON, mask_sh),\
226*b843c749SSergey Zigachev 	SF(OTG0_OTG_CLOCK_CONTROL, OTG_CLOCK_GATE_DIS, mask_sh),\
227*b843c749SSergey Zigachev 	SF(OTG0_OTG_VERTICAL_INTERRUPT0_CONTROL, OTG_VERTICAL_INTERRUPT0_INT_ENABLE, mask_sh),\
228*b843c749SSergey Zigachev 	SF(OTG0_OTG_VERTICAL_INTERRUPT0_POSITION, OTG_VERTICAL_INTERRUPT0_LINE_START, mask_sh),\
229*b843c749SSergey Zigachev 	SF(OTG0_OTG_VERTICAL_INTERRUPT0_POSITION, OTG_VERTICAL_INTERRUPT0_LINE_END, mask_sh),\
230*b843c749SSergey Zigachev 	SF(OTG0_OTG_VERTICAL_INTERRUPT2_CONTROL, OTG_VERTICAL_INTERRUPT2_INT_ENABLE, mask_sh),\
231*b843c749SSergey Zigachev 	SF(OTG0_OTG_VERTICAL_INTERRUPT2_POSITION, OTG_VERTICAL_INTERRUPT2_LINE_START, mask_sh),\
232*b843c749SSergey Zigachev 	SF(ODM0_OPTC_INPUT_CLOCK_CONTROL, OPTC_INPUT_CLK_EN, mask_sh),\
233*b843c749SSergey Zigachev 	SF(ODM0_OPTC_INPUT_CLOCK_CONTROL, OPTC_INPUT_CLK_ON, mask_sh),\
234*b843c749SSergey Zigachev 	SF(ODM0_OPTC_INPUT_CLOCK_CONTROL, OPTC_INPUT_CLK_GATE_DIS, mask_sh),\
235*b843c749SSergey Zigachev 	SF(ODM0_OPTC_INPUT_GLOBAL_CONTROL, OPTC_UNDERFLOW_OCCURRED_STATUS, mask_sh),\
236*b843c749SSergey Zigachev 	SF(ODM0_OPTC_INPUT_GLOBAL_CONTROL, OPTC_UNDERFLOW_CLEAR, mask_sh),\
237*b843c749SSergey Zigachev 	SF(VTG0_CONTROL, VTG0_ENABLE, mask_sh),\
238*b843c749SSergey Zigachev 	SF(VTG0_CONTROL, VTG0_FP2, mask_sh),\
239*b843c749SSergey Zigachev 	SF(VTG0_CONTROL, VTG0_VCOUNT_INIT, mask_sh),\
240*b843c749SSergey Zigachev 	SF(OTG0_OTG_VERT_SYNC_CONTROL, OTG_FORCE_VSYNC_NEXT_LINE_OCCURRED, mask_sh),\
241*b843c749SSergey Zigachev 	SF(OTG0_OTG_VERT_SYNC_CONTROL, OTG_FORCE_VSYNC_NEXT_LINE_CLEAR, mask_sh),\
242*b843c749SSergey Zigachev 	SF(OTG0_OTG_VERT_SYNC_CONTROL, OTG_AUTO_FORCE_VSYNC_MODE, mask_sh),\
243*b843c749SSergey Zigachev 	SF(OTG0_OTG_MASTER_UPDATE_MODE, MASTER_UPDATE_INTERLACED_MODE, mask_sh),\
244*b843c749SSergey Zigachev 	SF(OTG0_OTG_GSL_CONTROL, OTG_GSL0_EN, mask_sh),\
245*b843c749SSergey Zigachev 	SF(OTG0_OTG_GSL_CONTROL, OTG_GSL1_EN, mask_sh),\
246*b843c749SSergey Zigachev 	SF(OTG0_OTG_GSL_CONTROL, OTG_GSL2_EN, mask_sh),\
247*b843c749SSergey Zigachev 	SF(OTG0_OTG_GSL_CONTROL, OTG_GSL_MASTER_EN, mask_sh),\
248*b843c749SSergey Zigachev 	SF(OTG0_OTG_GSL_CONTROL, OTG_GSL_FORCE_DELAY, mask_sh),\
249*b843c749SSergey Zigachev 	SF(OTG0_OTG_GSL_CONTROL, OTG_GSL_CHECK_ALL_FIELDS, mask_sh),\
250*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC_CNTL, OTG_CRC_CONT_EN, mask_sh),\
251*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC_CNTL, OTG_CRC0_SELECT, mask_sh),\
252*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC_CNTL, OTG_CRC_EN, mask_sh),\
253*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC0_DATA_RG, CRC0_R_CR, mask_sh),\
254*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC0_DATA_RG, CRC0_G_Y, mask_sh),\
255*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC0_DATA_B, CRC0_B_CB, mask_sh),\
256*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC0_WINDOWA_X_CONTROL, OTG_CRC0_WINDOWA_X_START, mask_sh),\
257*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC0_WINDOWA_X_CONTROL, OTG_CRC0_WINDOWA_X_END, mask_sh),\
258*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC0_WINDOWA_Y_CONTROL, OTG_CRC0_WINDOWA_Y_START, mask_sh),\
259*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC0_WINDOWA_Y_CONTROL, OTG_CRC0_WINDOWA_Y_END, mask_sh),\
260*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC0_WINDOWB_X_CONTROL, OTG_CRC0_WINDOWB_X_START, mask_sh),\
261*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC0_WINDOWB_X_CONTROL, OTG_CRC0_WINDOWB_X_END, mask_sh),\
262*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC0_WINDOWB_Y_CONTROL, OTG_CRC0_WINDOWB_Y_START, mask_sh),\
263*b843c749SSergey Zigachev 	SF(OTG0_OTG_CRC0_WINDOWB_Y_CONTROL, OTG_CRC0_WINDOWB_Y_END, mask_sh)
264*b843c749SSergey Zigachev 
265*b843c749SSergey Zigachev 
266*b843c749SSergey Zigachev #define TG_COMMON_MASK_SH_LIST_DCN1_0(mask_sh)\
267*b843c749SSergey Zigachev 	TG_COMMON_MASK_SH_LIST_DCN(mask_sh),\
268*b843c749SSergey Zigachev 	SF(OTG0_OTG_TEST_PATTERN_PARAMETERS, OTG_TEST_PATTERN_INC0, mask_sh),\
269*b843c749SSergey Zigachev 	SF(OTG0_OTG_TEST_PATTERN_PARAMETERS, OTG_TEST_PATTERN_INC1, mask_sh),\
270*b843c749SSergey Zigachev 	SF(OTG0_OTG_TEST_PATTERN_PARAMETERS, OTG_TEST_PATTERN_VRES, mask_sh),\
271*b843c749SSergey Zigachev 	SF(OTG0_OTG_TEST_PATTERN_PARAMETERS, OTG_TEST_PATTERN_HRES, mask_sh),\
272*b843c749SSergey Zigachev 	SF(OTG0_OTG_TEST_PATTERN_PARAMETERS, OTG_TEST_PATTERN_RAMP0_OFFSET, mask_sh),\
273*b843c749SSergey Zigachev 	SF(OTG0_OTG_TEST_PATTERN_CONTROL, OTG_TEST_PATTERN_EN, mask_sh),\
274*b843c749SSergey Zigachev 	SF(OTG0_OTG_TEST_PATTERN_CONTROL, OTG_TEST_PATTERN_MODE, mask_sh),\
275*b843c749SSergey Zigachev 	SF(OTG0_OTG_TEST_PATTERN_CONTROL, OTG_TEST_PATTERN_DYNAMIC_RANGE, mask_sh),\
276*b843c749SSergey Zigachev 	SF(OTG0_OTG_TEST_PATTERN_CONTROL, OTG_TEST_PATTERN_COLOR_FORMAT, mask_sh),\
277*b843c749SSergey Zigachev 	SF(OTG0_OTG_TEST_PATTERN_COLOR, OTG_TEST_PATTERN_MASK, mask_sh),\
278*b843c749SSergey Zigachev 	SF(OTG0_OTG_TEST_PATTERN_COLOR, OTG_TEST_PATTERN_DATA, mask_sh),\
279*b843c749SSergey Zigachev 	SF(ODM0_OPTC_DATA_SOURCE_SELECT, OPTC_SRC_SEL, mask_sh)
280*b843c749SSergey Zigachev 
281*b843c749SSergey Zigachev #define TG_REG_FIELD_LIST_DCN1_0(type) \
282*b843c749SSergey Zigachev 	type VSTARTUP_START;\
283*b843c749SSergey Zigachev 	type VUPDATE_OFFSET;\
284*b843c749SSergey Zigachev 	type VUPDATE_WIDTH;\
285*b843c749SSergey Zigachev 	type VREADY_OFFSET;\
286*b843c749SSergey Zigachev 	type OTG_BLANK_DATA_EN;\
287*b843c749SSergey Zigachev 	type OTG_BLANK_DE_MODE;\
288*b843c749SSergey Zigachev 	type OTG_CURRENT_BLANK_STATE;\
289*b843c749SSergey Zigachev 	type OTG_MASTER_UPDATE_LOCK;\
290*b843c749SSergey Zigachev 	type UPDATE_LOCK_STATUS;\
291*b843c749SSergey Zigachev 	type OTG_UPDATE_PENDING;\
292*b843c749SSergey Zigachev 	type OTG_MASTER_UPDATE_LOCK_SEL;\
293*b843c749SSergey Zigachev 	type OTG_BLANK_DATA_DOUBLE_BUFFER_EN;\
294*b843c749SSergey Zigachev 	type OTG_H_TOTAL;\
295*b843c749SSergey Zigachev 	type OTG_H_BLANK_START;\
296*b843c749SSergey Zigachev 	type OTG_H_BLANK_END;\
297*b843c749SSergey Zigachev 	type OTG_H_SYNC_A_START;\
298*b843c749SSergey Zigachev 	type OTG_H_SYNC_A_END;\
299*b843c749SSergey Zigachev 	type OTG_H_SYNC_A_POL;\
300*b843c749SSergey Zigachev 	type OTG_H_TIMING_DIV_BY2;\
301*b843c749SSergey Zigachev 	type OTG_V_TOTAL;\
302*b843c749SSergey Zigachev 	type OTG_V_BLANK_START;\
303*b843c749SSergey Zigachev 	type OTG_V_BLANK_END;\
304*b843c749SSergey Zigachev 	type OTG_V_SYNC_A_START;\
305*b843c749SSergey Zigachev 	type OTG_V_SYNC_A_END;\
306*b843c749SSergey Zigachev 	type OTG_V_SYNC_A_POL;\
307*b843c749SSergey Zigachev 	type OTG_INTERLACE_ENABLE;\
308*b843c749SSergey Zigachev 	type OTG_MASTER_EN;\
309*b843c749SSergey Zigachev 	type OTG_START_POINT_CNTL;\
310*b843c749SSergey Zigachev 	type OTG_DISABLE_POINT_CNTL;\
311*b843c749SSergey Zigachev 	type OTG_FIELD_NUMBER_CNTL;\
312*b843c749SSergey Zigachev 	type OTG_STEREO_EN;\
313*b843c749SSergey Zigachev 	type OTG_STEREO_SYNC_OUTPUT_LINE_NUM;\
314*b843c749SSergey Zigachev 	type OTG_STEREO_SYNC_OUTPUT_POLARITY;\
315*b843c749SSergey Zigachev 	type OTG_STEREO_EYE_FLAG_POLARITY;\
316*b843c749SSergey Zigachev 	type OTG_STEREO_CURRENT_EYE;\
317*b843c749SSergey Zigachev 	type OTG_DISABLE_STEREOSYNC_OUTPUT_FOR_DP;\
318*b843c749SSergey Zigachev 	type OTG_3D_STRUCTURE_EN;\
319*b843c749SSergey Zigachev 	type OTG_3D_STRUCTURE_V_UPDATE_MODE;\
320*b843c749SSergey Zigachev 	type OTG_3D_STRUCTURE_STEREO_SEL_OVR;\
321*b843c749SSergey Zigachev 	type OTG_V_TOTAL_MAX;\
322*b843c749SSergey Zigachev 	type OTG_V_TOTAL_MIN;\
323*b843c749SSergey Zigachev 	type OTG_V_TOTAL_MIN_SEL;\
324*b843c749SSergey Zigachev 	type OTG_V_TOTAL_MAX_SEL;\
325*b843c749SSergey Zigachev 	type OTG_FORCE_LOCK_ON_EVENT;\
326*b843c749SSergey Zigachev 	type OTG_SET_V_TOTAL_MIN_MASK_EN;\
327*b843c749SSergey Zigachev 	type OTG_SET_V_TOTAL_MIN_MASK;\
328*b843c749SSergey Zigachev 	type OTG_FORCE_COUNT_NOW_CLEAR;\
329*b843c749SSergey Zigachev 	type OTG_FORCE_COUNT_NOW_MODE;\
330*b843c749SSergey Zigachev 	type OTG_FORCE_COUNT_NOW_OCCURRED;\
331*b843c749SSergey Zigachev 	type OTG_TRIGA_SOURCE_SELECT;\
332*b843c749SSergey Zigachev 	type OTG_TRIGA_SOURCE_PIPE_SELECT;\
333*b843c749SSergey Zigachev 	type OTG_TRIGA_RISING_EDGE_DETECT_CNTL;\
334*b843c749SSergey Zigachev 	type OTG_TRIGA_FALLING_EDGE_DETECT_CNTL;\
335*b843c749SSergey Zigachev 	type OTG_STATIC_SCREEN_EVENT_MASK;\
336*b843c749SSergey Zigachev 	type OTG_STATIC_SCREEN_FRAME_COUNT;\
337*b843c749SSergey Zigachev 	type OTG_FRAME_COUNT;\
338*b843c749SSergey Zigachev 	type OTG_V_BLANK;\
339*b843c749SSergey Zigachev 	type OTG_V_ACTIVE_DISP;\
340*b843c749SSergey Zigachev 	type OTG_HORZ_COUNT;\
341*b843c749SSergey Zigachev 	type OTG_VERT_COUNT;\
342*b843c749SSergey Zigachev 	type OTG_VERT_COUNT_NOM;\
343*b843c749SSergey Zigachev 	type OTG_BLACK_COLOR_B_CB;\
344*b843c749SSergey Zigachev 	type OTG_BLACK_COLOR_G_Y;\
345*b843c749SSergey Zigachev 	type OTG_BLACK_COLOR_R_CR;\
346*b843c749SSergey Zigachev 	type OTG_TEST_PATTERN_INC0;\
347*b843c749SSergey Zigachev 	type OTG_TEST_PATTERN_INC1;\
348*b843c749SSergey Zigachev 	type OTG_TEST_PATTERN_VRES;\
349*b843c749SSergey Zigachev 	type OTG_TEST_PATTERN_HRES;\
350*b843c749SSergey Zigachev 	type OTG_TEST_PATTERN_RAMP0_OFFSET;\
351*b843c749SSergey Zigachev 	type OTG_TEST_PATTERN_EN;\
352*b843c749SSergey Zigachev 	type OTG_TEST_PATTERN_MODE;\
353*b843c749SSergey Zigachev 	type OTG_TEST_PATTERN_DYNAMIC_RANGE;\
354*b843c749SSergey Zigachev 	type OTG_TEST_PATTERN_COLOR_FORMAT;\
355*b843c749SSergey Zigachev 	type OTG_TEST_PATTERN_MASK;\
356*b843c749SSergey Zigachev 	type OTG_TEST_PATTERN_DATA;\
357*b843c749SSergey Zigachev 	type OTG_BUSY;\
358*b843c749SSergey Zigachev 	type OTG_CLOCK_EN;\
359*b843c749SSergey Zigachev 	type OTG_CLOCK_ON;\
360*b843c749SSergey Zigachev 	type OTG_CLOCK_GATE_DIS;\
361*b843c749SSergey Zigachev 	type OTG_VERTICAL_INTERRUPT0_INT_ENABLE;\
362*b843c749SSergey Zigachev 	type OTG_VERTICAL_INTERRUPT0_LINE_START;\
363*b843c749SSergey Zigachev 	type OTG_VERTICAL_INTERRUPT0_LINE_END;\
364*b843c749SSergey Zigachev 	type OTG_VERTICAL_INTERRUPT2_INT_ENABLE;\
365*b843c749SSergey Zigachev 	type OTG_VERTICAL_INTERRUPT2_LINE_START;\
366*b843c749SSergey Zigachev 	type OPTC_INPUT_CLK_EN;\
367*b843c749SSergey Zigachev 	type OPTC_INPUT_CLK_ON;\
368*b843c749SSergey Zigachev 	type OPTC_INPUT_CLK_GATE_DIS;\
369*b843c749SSergey Zigachev 	type OPTC_UNDERFLOW_OCCURRED_STATUS;\
370*b843c749SSergey Zigachev 	type OPTC_UNDERFLOW_CLEAR;\
371*b843c749SSergey Zigachev 	type OPTC_SRC_SEL;\
372*b843c749SSergey Zigachev 	type VTG0_ENABLE;\
373*b843c749SSergey Zigachev 	type VTG0_FP2;\
374*b843c749SSergey Zigachev 	type VTG0_VCOUNT_INIT;\
375*b843c749SSergey Zigachev 	type OTG_FORCE_VSYNC_NEXT_LINE_OCCURRED;\
376*b843c749SSergey Zigachev 	type OTG_FORCE_VSYNC_NEXT_LINE_CLEAR;\
377*b843c749SSergey Zigachev 	type OTG_AUTO_FORCE_VSYNC_MODE;\
378*b843c749SSergey Zigachev 	type MASTER_UPDATE_INTERLACED_MODE;\
379*b843c749SSergey Zigachev 	type OTG_GSL0_EN;\
380*b843c749SSergey Zigachev 	type OTG_GSL1_EN;\
381*b843c749SSergey Zigachev 	type OTG_GSL2_EN;\
382*b843c749SSergey Zigachev 	type OTG_GSL_MASTER_EN;\
383*b843c749SSergey Zigachev 	type OTG_GSL_FORCE_DELAY;\
384*b843c749SSergey Zigachev 	type OTG_GSL_CHECK_ALL_FIELDS;\
385*b843c749SSergey Zigachev 	type OTG_GSL_WINDOW_START_X;\
386*b843c749SSergey Zigachev 	type OTG_GSL_WINDOW_END_X;\
387*b843c749SSergey Zigachev 	type OTG_GSL_WINDOW_START_Y;\
388*b843c749SSergey Zigachev 	type OTG_GSL_WINDOW_END_Y;\
389*b843c749SSergey Zigachev 	type OTG_RANGE_TIMING_DBUF_UPDATE_MODE;\
390*b843c749SSergey Zigachev 	type OTG_GSL_MASTER_MODE;\
391*b843c749SSergey Zigachev 	type OTG_MASTER_UPDATE_LOCK_GSL_EN;\
392*b843c749SSergey Zigachev 	type MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_START_OFFSET;\
393*b843c749SSergey Zigachev 	type MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_END_OFFSET;\
394*b843c749SSergey Zigachev 	type OTG_MASTER_UPDATE_LOCK_VUPDATE_KEEPOUT_EN;\
395*b843c749SSergey Zigachev 	type OTG_CRC_CONT_EN;\
396*b843c749SSergey Zigachev 	type OTG_CRC0_SELECT;\
397*b843c749SSergey Zigachev 	type OTG_CRC_EN;\
398*b843c749SSergey Zigachev 	type CRC0_R_CR;\
399*b843c749SSergey Zigachev 	type CRC0_G_Y;\
400*b843c749SSergey Zigachev 	type CRC0_B_CB;\
401*b843c749SSergey Zigachev 	type OTG_CRC0_WINDOWA_X_START;\
402*b843c749SSergey Zigachev 	type OTG_CRC0_WINDOWA_X_END;\
403*b843c749SSergey Zigachev 	type OTG_CRC0_WINDOWA_Y_START;\
404*b843c749SSergey Zigachev 	type OTG_CRC0_WINDOWA_Y_END;\
405*b843c749SSergey Zigachev 	type OTG_CRC0_WINDOWB_X_START;\
406*b843c749SSergey Zigachev 	type OTG_CRC0_WINDOWB_X_END;\
407*b843c749SSergey Zigachev 	type OTG_CRC0_WINDOWB_Y_START;\
408*b843c749SSergey Zigachev 	type OTG_CRC0_WINDOWB_Y_END;
409*b843c749SSergey Zigachev 
410*b843c749SSergey Zigachev 
411*b843c749SSergey Zigachev #define TG_REG_FIELD_LIST(type) \
412*b843c749SSergey Zigachev 	TG_REG_FIELD_LIST_DCN1_0(type)
413*b843c749SSergey Zigachev 
414*b843c749SSergey Zigachev 
415*b843c749SSergey Zigachev struct dcn_optc_shift {
416*b843c749SSergey Zigachev 	TG_REG_FIELD_LIST(uint8_t)
417*b843c749SSergey Zigachev };
418*b843c749SSergey Zigachev 
419*b843c749SSergey Zigachev struct dcn_optc_mask {
420*b843c749SSergey Zigachev 	TG_REG_FIELD_LIST(uint32_t)
421*b843c749SSergey Zigachev };
422*b843c749SSergey Zigachev 
423*b843c749SSergey Zigachev struct optc {
424*b843c749SSergey Zigachev 	struct timing_generator base;
425*b843c749SSergey Zigachev 
426*b843c749SSergey Zigachev 	const struct dcn_optc_registers *tg_regs;
427*b843c749SSergey Zigachev 	const struct dcn_optc_shift *tg_shift;
428*b843c749SSergey Zigachev 	const struct dcn_optc_mask *tg_mask;
429*b843c749SSergey Zigachev 
430*b843c749SSergey Zigachev 	enum controller_id controller_id;
431*b843c749SSergey Zigachev 
432*b843c749SSergey Zigachev 	uint32_t max_h_total;
433*b843c749SSergey Zigachev 	uint32_t max_v_total;
434*b843c749SSergey Zigachev 
435*b843c749SSergey Zigachev 	uint32_t min_h_blank;
436*b843c749SSergey Zigachev 
437*b843c749SSergey Zigachev 	uint32_t min_h_sync_width;
438*b843c749SSergey Zigachev 	uint32_t min_v_sync_width;
439*b843c749SSergey Zigachev 	uint32_t min_v_blank;
440*b843c749SSergey Zigachev 	uint32_t min_v_blank_interlace;
441*b843c749SSergey Zigachev };
442*b843c749SSergey Zigachev 
443*b843c749SSergey Zigachev void dcn10_timing_generator_init(struct optc *optc);
444*b843c749SSergey Zigachev 
445*b843c749SSergey Zigachev struct dcn_otg_state {
446*b843c749SSergey Zigachev 	uint32_t v_blank_start;
447*b843c749SSergey Zigachev 	uint32_t v_blank_end;
448*b843c749SSergey Zigachev 	uint32_t v_sync_a_pol;
449*b843c749SSergey Zigachev 	uint32_t v_total;
450*b843c749SSergey Zigachev 	uint32_t v_total_max;
451*b843c749SSergey Zigachev 	uint32_t v_total_min;
452*b843c749SSergey Zigachev 	uint32_t v_total_min_sel;
453*b843c749SSergey Zigachev 	uint32_t v_total_max_sel;
454*b843c749SSergey Zigachev 	uint32_t v_sync_a_start;
455*b843c749SSergey Zigachev 	uint32_t v_sync_a_end;
456*b843c749SSergey Zigachev 	uint32_t h_blank_start;
457*b843c749SSergey Zigachev 	uint32_t h_blank_end;
458*b843c749SSergey Zigachev 	uint32_t h_sync_a_start;
459*b843c749SSergey Zigachev 	uint32_t h_sync_a_end;
460*b843c749SSergey Zigachev 	uint32_t h_sync_a_pol;
461*b843c749SSergey Zigachev 	uint32_t h_total;
462*b843c749SSergey Zigachev 	uint32_t underflow_occurred_status;
463*b843c749SSergey Zigachev 	uint32_t otg_enabled;
464*b843c749SSergey Zigachev };
465*b843c749SSergey Zigachev 
466*b843c749SSergey Zigachev void optc1_read_otg_state(struct optc *optc1,
467*b843c749SSergey Zigachev 		struct dcn_otg_state *s);
468*b843c749SSergey Zigachev 
469*b843c749SSergey Zigachev bool optc1_validate_timing(
470*b843c749SSergey Zigachev 	struct timing_generator *optc,
471*b843c749SSergey Zigachev 	const struct dc_crtc_timing *timing);
472*b843c749SSergey Zigachev 
473*b843c749SSergey Zigachev void optc1_program_timing(
474*b843c749SSergey Zigachev 	struct timing_generator *optc,
475*b843c749SSergey Zigachev 	const struct dc_crtc_timing *dc_crtc_timing,
476*b843c749SSergey Zigachev 	bool use_vbios);
477*b843c749SSergey Zigachev 
478*b843c749SSergey Zigachev void optc1_program_vline_interrupt(struct timing_generator *optc,
479*b843c749SSergey Zigachev 		const struct dc_crtc_timing *dc_crtc_timing,
480*b843c749SSergey Zigachev 		unsigned long long vsync_delta);
481*b843c749SSergey Zigachev 
482*b843c749SSergey Zigachev void optc1_program_global_sync(
483*b843c749SSergey Zigachev 		struct timing_generator *optc);
484*b843c749SSergey Zigachev 
485*b843c749SSergey Zigachev bool optc1_disable_crtc(struct timing_generator *optc);
486*b843c749SSergey Zigachev 
487*b843c749SSergey Zigachev bool optc1_is_counter_moving(struct timing_generator *optc);
488*b843c749SSergey Zigachev 
489*b843c749SSergey Zigachev void optc1_get_position(struct timing_generator *optc,
490*b843c749SSergey Zigachev 		struct crtc_position *position);
491*b843c749SSergey Zigachev 
492*b843c749SSergey Zigachev uint32_t optc1_get_vblank_counter(struct timing_generator *optc);
493*b843c749SSergey Zigachev 
494*b843c749SSergey Zigachev void optc1_get_crtc_scanoutpos(
495*b843c749SSergey Zigachev 	struct timing_generator *optc,
496*b843c749SSergey Zigachev 	uint32_t *v_blank_start,
497*b843c749SSergey Zigachev 	uint32_t *v_blank_end,
498*b843c749SSergey Zigachev 	uint32_t *h_position,
499*b843c749SSergey Zigachev 	uint32_t *v_position);
500*b843c749SSergey Zigachev 
501*b843c749SSergey Zigachev void optc1_set_early_control(
502*b843c749SSergey Zigachev 	struct timing_generator *optc,
503*b843c749SSergey Zigachev 	uint32_t early_cntl);
504*b843c749SSergey Zigachev 
505*b843c749SSergey Zigachev void optc1_wait_for_state(struct timing_generator *optc,
506*b843c749SSergey Zigachev 		enum crtc_state state);
507*b843c749SSergey Zigachev 
508*b843c749SSergey Zigachev void optc1_set_blank(struct timing_generator *optc,
509*b843c749SSergey Zigachev 		bool enable_blanking);
510*b843c749SSergey Zigachev 
511*b843c749SSergey Zigachev bool optc1_is_blanked(struct timing_generator *optc);
512*b843c749SSergey Zigachev 
513*b843c749SSergey Zigachev void optc1_program_blank_color(
514*b843c749SSergey Zigachev 		struct timing_generator *optc,
515*b843c749SSergey Zigachev 		const struct tg_color *black_color);
516*b843c749SSergey Zigachev 
517*b843c749SSergey Zigachev bool optc1_did_triggered_reset_occur(
518*b843c749SSergey Zigachev 	struct timing_generator *optc);
519*b843c749SSergey Zigachev 
520*b843c749SSergey Zigachev void optc1_enable_reset_trigger(struct timing_generator *optc, int source_tg_inst);
521*b843c749SSergey Zigachev 
522*b843c749SSergey Zigachev void optc1_disable_reset_trigger(struct timing_generator *optc);
523*b843c749SSergey Zigachev 
524*b843c749SSergey Zigachev void optc1_lock(struct timing_generator *optc);
525*b843c749SSergey Zigachev 
526*b843c749SSergey Zigachev void optc1_unlock(struct timing_generator *optc);
527*b843c749SSergey Zigachev 
528*b843c749SSergey Zigachev void optc1_enable_optc_clock(struct timing_generator *optc, bool enable);
529*b843c749SSergey Zigachev 
530*b843c749SSergey Zigachev void optc1_set_drr(
531*b843c749SSergey Zigachev 	struct timing_generator *optc,
532*b843c749SSergey Zigachev 	const struct drr_params *params);
533*b843c749SSergey Zigachev 
534*b843c749SSergey Zigachev void optc1_set_static_screen_control(
535*b843c749SSergey Zigachev 	struct timing_generator *optc,
536*b843c749SSergey Zigachev 	uint32_t value);
537*b843c749SSergey Zigachev 
538*b843c749SSergey Zigachev void optc1_program_stereo(struct timing_generator *optc,
539*b843c749SSergey Zigachev 	const struct dc_crtc_timing *timing, struct crtc_stereo_flags *flags);
540*b843c749SSergey Zigachev 
541*b843c749SSergey Zigachev bool optc1_is_stereo_left_eye(struct timing_generator *optc);
542*b843c749SSergey Zigachev 
543*b843c749SSergey Zigachev void optc1_clear_optc_underflow(struct timing_generator *optc);
544*b843c749SSergey Zigachev 
545*b843c749SSergey Zigachev void optc1_tg_init(struct timing_generator *optc);
546*b843c749SSergey Zigachev 
547*b843c749SSergey Zigachev bool optc1_is_tg_enabled(struct timing_generator *optc);
548*b843c749SSergey Zigachev 
549*b843c749SSergey Zigachev bool optc1_is_optc_underflow_occurred(struct timing_generator *optc);
550*b843c749SSergey Zigachev 
551*b843c749SSergey Zigachev void optc1_set_blank_data_double_buffer(struct timing_generator *optc, bool enable);
552*b843c749SSergey Zigachev 
553*b843c749SSergey Zigachev bool optc1_get_otg_active_size(struct timing_generator *optc,
554*b843c749SSergey Zigachev 		uint32_t *otg_active_width,
555*b843c749SSergey Zigachev 		uint32_t *otg_active_height);
556*b843c749SSergey Zigachev 
557*b843c749SSergey Zigachev void optc1_enable_crtc_reset(
558*b843c749SSergey Zigachev 		struct timing_generator *optc,
559*b843c749SSergey Zigachev 		int source_tg_inst,
560*b843c749SSergey Zigachev 		struct crtc_trigger_info *crtc_tp);
561*b843c749SSergey Zigachev 
562*b843c749SSergey Zigachev bool optc1_configure_crc(struct timing_generator *optc,
563*b843c749SSergey Zigachev 			  const struct crc_params *params);
564*b843c749SSergey Zigachev 
565*b843c749SSergey Zigachev bool optc1_get_crc(struct timing_generator *optc,
566*b843c749SSergey Zigachev 		    uint32_t *r_cr, uint32_t *g_y, uint32_t *b_cb);
567*b843c749SSergey Zigachev 
568*b843c749SSergey Zigachev #endif /* __DC_TIMING_GENERATOR_DCN10_H__ */
569