coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
dp-core.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 /* Header file for Samsung DP (Display Port) interface driver. */
4 
5 #ifndef CPU_SAMSUNG_EXYNOS5250_DP_CORE_H
6 #define CPU_SAMSUNG_EXYNOS5250_DP_CORE_H
7 
8 #define STREAM_ON_TIMEOUT 100
9 #define PLL_LOCK_TIMEOUT 10
10 #define DP_INIT_TRIES 10
11 #define MAX_CR_LOOP 5
12 #define MAX_EQ_LOOP 4
13 
14 /* Link rate type */
15 enum link_rate {
17  LINK_RATE_2_70GBPS = 0x0a
18 };
19 
20 /* Number of lanes supported */
24  LANE_COUNT4 = 4
25 };
26 
27 /* Pre emphasis level */
33 };
34 
35 /* Type of color space */
40 };
41 
42 /* Video input Bit Per Color */
47  COLOR_12
48 };
49 
50 /* Type of YCbCr coefficient */
54 };
55 
56 /* Color range */
59  CEA
60 };
61 
62 /* Status of PLL clock */
63 enum pll_status {
66 };
67 
68 /* To choose type of m_value */
72 };
73 
74 struct video_info {
79 
80  enum link_rate link_rate;
82 
83  char *name;
84 
85  unsigned int h_sync_polarity:1;
86  unsigned int v_sync_polarity:1;
87  unsigned int interlaced:1;
88 };
89 
90 struct link_train {
91  u8 link_rate;
92  u8 lane_count;
93 };
94 
95 struct s5p_dp_device {
96  unsigned int irq;
97  struct exynos5_dp *base;
99  struct link_train link_train;
100 };
101 
102 /* s5p_dp_reg.c */
103 
104 /*
105  * Reset DP module
106  *
107  * param dp pointer to main s5p-dp structure
108  */
109 void s5p_dp_reset(struct s5p_dp_device *dp);
110 /*
111  * Initialize DP to receive video stream
112  *
113  * param dp pointer to main s5p-dp structure
114  */
115 void s5p_dp_init_video(struct s5p_dp_device *dp);
116 /*
117  * Check whether PLL is locked
118  *
119  * param dp pointer to main s5p-dp structure
120  * return Lock status
121  */
122 unsigned int s5p_dp_get_pll_lock_status(struct s5p_dp_device *dp);
123 /*
124  * Initialize analog functions of DP
125  *
126  * param dp pointer to main s5p-dp structure
127  * return 0 on success
128  */
129 int s5p_dp_init_analog_func(struct s5p_dp_device *dp);
130 /*
131  * Initialize DP for AUX transaction
132  *
133  * param dp pointer to main s5p-dp structure
134  */
135 void s5p_dp_init_aux(struct s5p_dp_device *dp);
136 
137 /*
138  * Start an AUX transaction.
139  *
140  * param dp pointer to main s5p-dp structure
141  */
143 
144 /*
145  * Write a byte to DPCD register
146  *
147  * param dp pointer to main s5p-dp structure
148  * param reg_addr DPCD register to be written
149  * param data byte data to be written
150  * return write status
151  */
153  unsigned int reg_addr,
154  unsigned char data);
155 /*
156  * Read a byte from DPCD register
157  *
158  * param dp pointer to main s5p-dp structure
159  * param reg_addr DPCD register to read
160  * param data read byte data
161  * return read status
162  */
164  unsigned int reg_addr,
165  unsigned char *data);
166 /*
167  * Initialize DP video functions
168  *
169  * param dp pointer to main s5p-dp structure
170  */
171 //void s5p_dp_init_video(struct s5p_dp_device *dp);
172 
173 /*
174  * Set color parameters for display
175  *
176  * param dp pointer to main s5p-dp structure
177  * param color_depth Video input Bit Per Color
178  * param color_space Colorimetric format of input video
179  * param dynamic_range VESA range or CEA range
180  * param coeff YCbCr Coefficients of input video
181  */
183  unsigned int color_depth,
184  unsigned int color_space,
185  unsigned int dynamic_range,
186  unsigned int coeff);
187 /*
188  * Check whether video clock is on
189  *
190  * param dp pointer to main s5p-dp structure
191  * return clock status
192  */
194 /*
195  * Check whether video clock is on
196  *
197  * param dp pointer to main s5p-dp structure
198  * param type clock_recovery_m_value_type
199  * param m_value to calculate m_vid value
200  * param n_value to calculate n_vid value
201  */
202 void s5p_dp_set_video_cr_mn(struct s5p_dp_device *dp,
204  unsigned int m_value,
205  unsigned int n_value);
206 /*
207  * Set DP to video slave mode thereby enabling video master
208  *
209  * param dp pointer to main s5p-dp structure
210  */
212 /*
213  * Check whether video stream is on
214  *
215  * param dp pointer to main s5p-dp structure
216  * return video stream status
217  */
219 /*
220  * Configure DP in slave mode
221  *
222  * param dp pointer to main s5p-dp structure
223  * param video_info pointer to main video_info structure.
224  */
226  struct video_info *video_info);
227 
228 /*
229  * Wait unitl HW link training done
230  *
231  * param dp pointer to main s5p-dp structure
232  */
234 
235 /* startup and init */
236 struct exynos5_fimd_panel;
237 void fb_init(unsigned long int fb_size, void *lcdbase,
238  struct exynos5_fimd_panel *pd);
239 int dp_controller_init(struct s5p_dp_device *dp_device);
240 int lcd_ctrl_init(unsigned long int fb_size,
241  struct exynos5_fimd_panel *panel_data, void *lcdbase);
242 #endif /* CPU_SAMSUNG_EXYNOS5250_DP_CORE_H */
void fb_init(unsigned long int fb_size, void *lcdbase, struct exynos5_fimd_panel *pd)
Definition: fb.c:98
@ COLOR_YCBCR444
Definition: dp-core.h:39
@ COLOR_YCBCR422
Definition: dp-core.h:38
@ COLOR_RGB
Definition: dp-core.h:37
void s5p_dp_reset(struct s5p_dp_device *dp)
Definition: dp-reg.c:16
int s5p_dp_write_byte_to_dpcd(struct s5p_dp_device *dp, unsigned int reg_addr, unsigned char data)
Definition: dp-reg.c:201
void s5p_dp_init_aux(struct s5p_dp_device *dp)
Definition: dp-reg.c:138
int s5p_dp_read_byte_from_dpcd(struct s5p_dp_device *dp, unsigned int reg_addr, unsigned char *data)
Definition: dp-reg.c:248
void s5p_dp_enable_video_master(struct s5p_dp_device *dp)
Definition: dp-reg.c:404
@ CALCULATED_M
Definition: dp-core.h:70
@ REGISTER_M
Definition: dp-core.h:71
int lcd_ctrl_init(unsigned long int fb_size, struct exynos5_fimd_panel *panel_data, void *lcdbase)
Init the LCD controller.
Definition: fb.c:535
link_rate
Definition: dp-core.h:15
@ LINK_RATE_2_70GBPS
Definition: dp-core.h:17
@ LINK_RATE_1_62GBPS
Definition: dp-core.h:16
void s5p_dp_set_video_cr_mn(struct s5p_dp_device *dp, enum clock_recovery_m_value_type type, unsigned int m_value, unsigned int n_value)
Definition: dp-reg.c:367
int s5p_dp_is_slave_video_stream_clock_on(struct s5p_dp_device *dp)
Definition: dp-reg.c:341
void s5p_dp_wait_hw_link_training_done(struct s5p_dp_device *dp)
Definition: dp-reg.c:472
int s5p_dp_start_aux_transaction(struct s5p_dp_device *dp)
Definition: dp-reg.c:165
link_lane_count
Definition: dp-core.h:21
@ LANE_COUNT1
Definition: dp-core.h:22
@ LANE_COUNT2
Definition: dp-core.h:23
@ LANE_COUNT4
Definition: dp-core.h:24
@ COLOR_10
Definition: dp-core.h:46
@ COLOR_8
Definition: dp-core.h:45
@ COLOR_6
Definition: dp-core.h:44
@ COLOR_12
Definition: dp-core.h:47
int dp_controller_init(struct s5p_dp_device *dp_device)
Definition: fb.c:475
@ CEA
Definition: dp-core.h:59
@ VESA
Definition: dp-core.h:58
@ PLL_LOCKED
Definition: dp-core.h:65
@ PLL_UNLOCKED
Definition: dp-core.h:64
void s5p_dp_init_video(struct s5p_dp_device *dp)
Definition: dp-reg.c:297
@ COLOR_YCBCR709
Definition: dp-core.h:53
@ COLOR_YCBCR601
Definition: dp-core.h:52
int s5p_dp_init_analog_func(struct s5p_dp_device *dp)
Definition: dp-reg.c:103
void s5p_dp_set_video_color_format(struct s5p_dp_device *dp, unsigned int color_depth, unsigned int color_space, unsigned int dynamic_range, unsigned int coeff)
Definition: dp-reg.c:316
@ PRE_EMPHASIS_LEVEL_0
Definition: dp-core.h:29
@ PRE_EMPHASIS_LEVEL_2
Definition: dp-core.h:31
@ PRE_EMPHASIS_LEVEL_3
Definition: dp-core.h:32
@ PRE_EMPHASIS_LEVEL_1
Definition: dp-core.h:30
int s5p_dp_is_video_stream_on(struct s5p_dp_device *dp)
Definition: dp-reg.c:415
unsigned int s5p_dp_get_pll_lock_status(struct s5p_dp_device *dp)
Definition: dp-reg.c:92
void s5p_dp_config_video_slave_mode(struct s5p_dp_device *dp, struct video_info *video_info)
Definition: dp-reg.c:442
color_space
Definition: edp.h:571
clock_recovery_m_value_type
Definition: edp.h:553
color_depth
Definition: edp.h:577
dynamic_range
Definition: edp.h:543
pll_status
Definition: edp.h:548
color_coefficient
Definition: edp.h:538
pre_emphasis_level
Definition: edp.h:610
unsigned int type
Definition: edid.c:57
uint8_t u8
Definition: stdint.h:45
Definition: dp.h:11
unsigned int irq
Definition: dp-core.h:96
struct exynos5_dp * base
Definition: dp-core.h:97
struct video_info * video_info
Definition: dp-core.h:98
enum color_coefficient ycbcr_coeff
Definition: dp-core.h:77
enum color_depth color_depth
Definition: dp-core.h:78
char * name
Definition: dp-core.h:83
enum dynamic_range dynamic_range
Definition: dp-core.h:76
enum link_rate link_rate
Definition: dp-core.h:80
enum link_lane_count lane_count
Definition: dp-core.h:81
enum color_space color_space
Definition: dp-core.h:75
unsigned int h_sync_polarity
Definition: dp-core.h:85
unsigned int v_sync_polarity
Definition: dp-core.h:86
unsigned int interlaced
Definition: dp-core.h:87