coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
dp_lowlevel.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <device/mmio.h>
4 #include <console/console.h>
5 #include <delay.h>
6 #include <soc/dp.h>
7 #include <soc/fimd.h>
8 #include <soc/i2c.h>
9 #include <soc/power.h>
10 #include <soc/sysreg.h>
11 
12 /* FIXME: I think the DP controller shouldn't be hardcoded here... */
13 static struct exynos_dp * const dp_regs = (void *)EXYNOS5_DP1_BASE;
14 
15 /* for debugging, it's nice to get control on a per-file basis.
16  * I had a bit of a discussion with myself (boring!) about
17  * how to do this and for the moment this is the easiest way.
18  * These debugging statements allowed me to find the final bugs.
19  */
20 
21 #if 0
22 static inline void fwadl(unsigned long l,void *v) {
23  writel(l, v);
24  printk(BIOS_SPEW, "W %p %p\n", v, (void *)l);
25 }
26 #define lwrite32(a,b) fwadl((unsigned long)(a), (void *)(b))
27 
28 static inline unsigned long fradl(void *v) {
29  unsigned long l = readl(v);
30  printk(BIOS_SPEW, "R %p %p\n", v, (void *)l);
31  return l;
32 }
33 
34 #define lread32(a) fradl((void *)(a))
35 #else
36 #define lwrite32(a,b) write32((void *)(b), (unsigned long)(a))
37 #define lread32(a) read32((void *)(a))
38 #endif
39 
40 static void exynos_dp_enable_video_input(u32 enable)
41 {
42  u32 reg;
43 
44  reg = lread32(&dp_regs->video_ctl1);
45  reg &= ~VIDEO_EN_MASK;
46 
47  /* enable video input*/
48  if (enable)
49  reg |= VIDEO_EN_MASK;
50 
51  lwrite32(reg, &dp_regs->video_ctl1);
52 }
53 
55 {
56  u32 reg;
57  reg = lread32(&dp_regs->video_ctl4);
58  reg &= ~VIDEO_BIST_MASK;
59  lwrite32(reg, &dp_regs->video_ctl4);
60 }
61 
62 void exynos_dp_enable_video_mute(unsigned int enable)
63 {
64  u32 reg;
65 
66  reg = lread32(&dp_regs->video_ctl1);
67  reg &= ~(VIDEO_MUTE_MASK);
68  if (enable)
69  reg |= VIDEO_MUTE_MASK;
70 
71  lwrite32(reg, &dp_regs->video_ctl1);
72 }
73 
74 static void exynos_dp_init_analog_param(void)
75 {
76  u32 reg;
77 
78  /*
79  * Set termination
80  * Normal bandgap, Normal swing, Tx terminal resistor 61 ohm
81  * 24M Phy clock, TX digital logic power is 100:1.0625V
82  */
86 
89 
90  /*
91  * Set power source for internal clk driver to 1.0625v.
92  * Select current reference of TX driver current to 00:Ipp/2+Ic/2.
93  * Set VCO range of PLL +- 0uA
94  */
97 
98  /*
99  * Set AUX TX terminal resistor to 102 ohm
100  * Set AUX channel amplitude control
101  */
104 
105  /*
106  * PLL loop filter bandwidth
107  * For 2.7Gbps: 175KHz, For 1.62Gbps: 234KHz
108  * PLL digital power select: 1.2500V
109  */
111 
113 
114  /*
115  * PLL loop filter bandwidth
116  * For 2.7Gbps: 175KHz, For 1.62Gbps: 234KHz
117  * PLL digital power select: 1.1250V
118  */
120  lwrite32(reg, &dp_regs->pll_ctl);
121 }
122 
123 static void exynos_dp_init_interrupt(void)
124 {
125  /* Set interrupt registers to initial states */
126 
127  /*
128  * Disable interrupt
129  * INT pin assertion polarity. It must be configured
130  * correctly according to ICU setting.
131  * 1 = assert high, 0 = assert low
132  */
134 
135  /* Clear pending registers */
140  lwrite32(0xff, &dp_regs->int_sta);
141 
142  /* 0:mask,1: unmask */
143  lwrite32(0x00, &dp_regs->int_sta_mask1);
144  lwrite32(0x00, &dp_regs->int_sta_mask2);
145  lwrite32(0x00, &dp_regs->int_sta_mask3);
146  lwrite32(0x00, &dp_regs->int_sta_mask4);
147  lwrite32(0x00, &dp_regs->int_sta_mask);
148 }
149 
150 void exynos_dp_reset(void)
151 {
152  u32 reg_func_1;
153 
154  /*dp tx sw reset*/
156 
160 
161  /* software reset */
165 
166  lwrite32(reg_func_1, &dp_regs->func_en1);
167  lwrite32(reg_func_1, &dp_regs->func_en2);
168 
169  mdelay(1);
170 
173 }
174 
175 void exynos_dp_enable_sw_func(unsigned int enable)
176 {
177  u32 reg;
178 
179  reg = lread32(&dp_regs->func_en1);
180  reg &= ~(SW_FUNC_EN_N);
181 
182  if (!enable)
183  reg |= SW_FUNC_EN_N;
184 
185  lwrite32(reg, &dp_regs->func_en1);
186 }
187 
188 unsigned int exynos_dp_set_analog_power_down(unsigned int block, u32 enable)
189 {
190  u32 reg;
191 
192  reg = lread32(&dp_regs->phy_pd);
193  switch (block) {
194  case AUX_BLOCK:
195  reg &= ~(AUX_PD);
196  if (enable)
197  reg |= AUX_PD;
198  break;
199  case CH0_BLOCK:
200  reg &= ~(CH0_PD);
201  if (enable)
202  reg |= CH0_PD;
203  break;
204  case CH1_BLOCK:
205  reg &= ~(CH1_PD);
206  if (enable)
207  reg |= CH1_PD;
208  break;
209  case CH2_BLOCK:
210  reg &= ~(CH2_PD);
211  if (enable)
212  reg |= CH2_PD;
213  break;
214  case CH3_BLOCK:
215  reg &= ~(CH3_PD);
216  if (enable)
217  reg |= CH3_PD;
218  break;
219  case ANALOG_TOTAL:
220  reg &= ~PHY_PD;
221  if (enable)
222  reg |= PHY_PD;
223  break;
224  case POWER_ALL:
225  reg &= ~(PHY_PD | AUX_PD | CH0_PD | CH1_PD | CH2_PD |
226  CH3_PD);
227  if (enable)
228  reg |= (PHY_PD | AUX_PD | CH0_PD | CH1_PD |
229  CH2_PD | CH3_PD);
230  break;
231  default:
232  printk(BIOS_ERR, "DP undefined block number : %d\n", block);
233  return -1;
234  }
235 
236  lwrite32(reg, &dp_regs->phy_pd);
237 
238  return 0;
239 }
240 
242 {
243  u32 reg;
244 
245  reg = lread32(&dp_regs->debug_ctl);
246 
247  if (reg & PLL_LOCK)
248  return PLL_LOCKED;
249  else
250  return PLL_UNLOCKED;
251 }
252 
253 static void exynos_dp_set_pll_power(unsigned int enable)
254 {
255  u32 reg;
256 
257  reg = lread32(&dp_regs->pll_ctl);
258  reg &= ~(DP_PLL_PD);
259 
260  if (!enable)
261  reg |= DP_PLL_PD;
262 
263  lwrite32(reg, &dp_regs->pll_ctl);
264 }
265 
267 {
268  int ret = EXYNOS_DP_SUCCESS;
269  unsigned int retry_cnt = 10;
270  u32 reg;
271 
272  /*Power On All Analog block */
274 
275  reg = PLL_LOCK_CHG;
277 
278  reg = lread32(&dp_regs->debug_ctl);
279  reg &= ~(F_PLL_LOCK | PLL_LOCK_CTRL);
280  lwrite32(reg, &dp_regs->debug_ctl);
281 
282  /*Assert DP PLL Reset*/
283  reg = lread32(&dp_regs->pll_ctl);
284  reg |= DP_PLL_RESET;
285  lwrite32(reg, &dp_regs->pll_ctl);
286 
287  mdelay(1);
288 
289  /*Deassert DP PLL Reset*/
290  reg = lread32(&dp_regs->pll_ctl);
291  reg &= ~(DP_PLL_RESET);
292  lwrite32(reg, &dp_regs->pll_ctl);
293 
295 
297  mdelay(1);
298  retry_cnt--;
299  if (retry_cnt == 0) {
300  printk(BIOS_ERR, "DP dp's pll lock failed : retry : %d\n",
301  retry_cnt);
302  return -1;
303  }
304  }
305 
306  printk(BIOS_DEBUG, "dp's pll lock success(%d)\n", retry_cnt);
307 
308  /* Enable Serdes FIFO function and Link symbol clock domain module */
309  reg = lread32(&dp_regs->func_en2);
311  | AUX_FUNC_EN_N);
312  lwrite32(reg, &dp_regs->func_en2);
313 
314  return ret;
315 }
316 
318 {
319  u32 reg;
320 
321  /* Clear interrupts related to Hot Plug Detect */
322  reg = HOTPLUG_CHG | HPD_LOST | PLUG;
324 
325  reg = INT_HPD;
326  lwrite32(reg, &dp_regs->int_sta);
327 
328  reg = lread32(&dp_regs->sys_ctl3);
329  reg &= ~(F_HPD | HPD_CTRL);
330  lwrite32(reg, &dp_regs->sys_ctl3);
331 }
332 
333 static inline void exynos_dp_reset_aux(void)
334 {
335  u32 reg;
336 
337  /* Disable AUX channel module */
338  reg = lread32(&dp_regs->func_en2);
339  reg |= AUX_FUNC_EN_N;
340  lwrite32(reg, &dp_regs->func_en2);
341 }
342 
344 {
345  u32 reg;
346 
347  /* Clear interrupts related to AUX channel */
348  reg = RPLY_RECEIV | AUX_ERR;
349  lwrite32(reg, &dp_regs->int_sta);
350 
352 
353  /* Disable AUX transaction H/W retry */
357 
358  /* Receive AUX Channel DEFER commands equal to DEFFER_COUNT*64 */
359  reg = DEFER_CTRL_EN | DEFER_COUNT(1);
361 
362  /* Enable AUX channel module */
363  reg = lread32(&dp_regs->func_en2);
364  reg &= ~AUX_FUNC_EN_N;
365  lwrite32(reg, &dp_regs->func_en2);
366 }
367 
369 {
370  u32 reg;
371 
372  /* 0: mask, 1: unmask */
373  reg = COMMON_INT_MASK_1;
375 
376  reg = COMMON_INT_MASK_2;
378 
379  reg = COMMON_INT_MASK_3;
381 
382  reg = COMMON_INT_MASK_4;
384 
385  reg = INT_STA_MASK;
386  lwrite32(reg, &dp_regs->int_sta_mask);
387 }
388 
390 {
391  u32 reg;
392 
393  reg = lread32(&dp_regs->sys_ctl3);
394  if (reg & HPD_STATUS)
395  return 0;
396 
397  return -1;
398 }
399 
400 unsigned int exynos_dp_detect_hpd(void)
401 {
402  int timeout_loop = DP_TIMEOUT_LOOP_COUNT;
403 
404  mdelay(2);
405 
406  while (exynos_dp_get_plug_in_status() != 0) {
407  if (timeout_loop == 0)
408  return -1;
409  mdelay(1);
410  timeout_loop--;
411  }
412 
413  return EXYNOS_DP_SUCCESS;
414 }
415 
417 {
418  u32 reg;
419  unsigned int ret = 0;
420  unsigned int retry_cnt;
421 
422  /* Enable AUX CH operation */
423  reg = lread32(&dp_regs->aux_ch_ctl2);
424  reg |= AUX_EN;
425  lwrite32(reg, &dp_regs->aux_ch_ctl2);
426 
427  retry_cnt = 10;
428  while (retry_cnt) {
429  reg = lread32(&dp_regs->int_sta);
430  if (!(reg & RPLY_RECEIV)) {
431  if (retry_cnt == 0) {
432  printk(BIOS_ERR, "DP Reply Timeout!!\n");
433  ret = -1;
434  return ret;
435  }
436  mdelay(1);
437  retry_cnt--;
438  } else
439  break;
440  }
441 
442  /* Clear interrupt source for AUX CH command reply */
443  lwrite32(reg, &dp_regs->int_sta);
444 
445  /* Clear interrupt source for AUX CH access error */
446  reg = lread32(&dp_regs->int_sta);
447  if (reg & AUX_ERR) {
448  printk(BIOS_ERR, "DP Aux Access Error\n");
450  ret = -1;
451  return ret;
452  }
453 
454  /* Check AUX CH error access status */
455  reg = lread32(&dp_regs->aux_ch_sta);
456  if ((reg & AUX_STATUS_MASK) != 0) {
457  printk(BIOS_DEBUG, "DP AUX CH error happens: %x\n", reg & AUX_STATUS_MASK);
458  ret = -1;
459  return ret;
460  }
461  return EXYNOS_DP_SUCCESS;
462 }
463 
464 unsigned int exynos_dp_write_byte_to_dpcd(u32 reg_addr, u8 data)
465 {
466  u32 reg;
467  unsigned int ret;
468 
469  /* Clear AUX CH data buffer */
470  reg = BUF_CLR;
472 
473  /* Select DPCD device address */
474  reg = AUX_ADDR_7_0(reg_addr);
475  lwrite32(reg, &dp_regs->aux_addr_7_0);
476  reg = AUX_ADDR_15_8(reg_addr);
478  reg = AUX_ADDR_19_16(reg_addr);
480 
481  /* Write data buffer */
482  reg = data;
483  lwrite32(reg, &dp_regs->buf_data0);
484 
485  /*
486  * Set DisplayPort transaction and write 1 byte
487  * If bit 3 is 1, DisplayPort transaction.
488  * If Bit 3 is 0, I2C transaction.
489  */
491  lwrite32(reg, &dp_regs->aux_ch_ctl1);
492 
493  /* Start AUX transaction */
495  if (ret != EXYNOS_DP_SUCCESS) {
496  printk(BIOS_ERR, "DP Aux transaction failed\n");
497  }
498 
499  return ret;
500 }
501 
502 unsigned int exynos_dp_read_byte_from_dpcd(u32 reg_addr,
503  unsigned char *data)
504 {
505  u32 reg;
506  int retval;
507 
508  /* Clear AUX CH data buffer */
509  reg = BUF_CLR;
511 
512  /* Select DPCD device address */
513  reg = AUX_ADDR_7_0(reg_addr);
514  lwrite32(reg, &dp_regs->aux_addr_7_0);
515  reg = AUX_ADDR_15_8(reg_addr);
517  reg = AUX_ADDR_19_16(reg_addr);
519 
520  /*
521  * Set DisplayPort transaction and read 1 byte
522  * If bit 3 is 1, DisplayPort transaction.
523  * If Bit 3 is 0, I2C transaction.
524  */
526  lwrite32(reg, &dp_regs->aux_ch_ctl1);
527 
528  /* Start AUX transaction */
530  if (retval != EXYNOS_DP_SUCCESS)
531  printk(BIOS_DEBUG, "DP Aux Transaction fail!\n");
532 
533  /* Read data buffer */
534  reg = lread32(&dp_regs->buf_data0);
535  *data = (unsigned char)(reg & 0xff);
536 
537  return retval;
538 }
539 
540 unsigned int exynos_dp_write_bytes_to_dpcd(u32 reg_addr,
541  unsigned int count,
542  unsigned char data[])
543 {
544  u32 reg;
545  unsigned int start_offset;
546  unsigned int cur_data_count;
547  unsigned int cur_data_idx;
548  unsigned int retry_cnt;
549  unsigned int ret = 0;
550 
551  /* Clear AUX CH data buffer */
552  reg = BUF_CLR;
554 
555  start_offset = 0;
556  while (start_offset < count) {
557  /* Buffer size of AUX CH is 16 * 4bytes */
558  if ((count - start_offset) > 16)
559  cur_data_count = 16;
560  else
561  cur_data_count = count - start_offset;
562 
563  retry_cnt = 5;
564  while (retry_cnt) {
565  /* Select DPCD device address */
566  reg = AUX_ADDR_7_0(reg_addr + start_offset);
567  lwrite32(reg, &dp_regs->aux_addr_7_0);
568  reg = AUX_ADDR_15_8(reg_addr + start_offset);
570  reg = AUX_ADDR_19_16(reg_addr + start_offset);
572 
573  for (cur_data_idx = 0; cur_data_idx < cur_data_count;
574  cur_data_idx++) {
575  reg = data[start_offset + cur_data_idx];
576  lwrite32(reg, (void *)((unsigned int)&dp_regs->buf_data0 +
577  (4 * cur_data_idx)));
578  }
579  /*
580  * Set DisplayPort transaction and write
581  * If bit 3 is 1, DisplayPort transaction.
582  * If Bit 3 is 0, I2C transaction.
583  */
584  reg = AUX_LENGTH(cur_data_count) |
586  lwrite32(reg, &dp_regs->aux_ch_ctl1);
587 
588  /* Start AUX transaction */
590  if (ret != EXYNOS_DP_SUCCESS) {
591  if (retry_cnt == 0) {
592  printk(BIOS_ERR, "DP Aux Transaction failed\n");
593  return ret;
594  }
595  retry_cnt--;
596  } else
597  break;
598  }
599  start_offset += cur_data_count;
600  }
601 
602  return ret;
603 }
604 
605 unsigned int exynos_dp_read_bytes_from_dpcd(u32 reg_addr,
606  unsigned int count,
607  unsigned char data[])
608 {
609  u32 reg;
610  unsigned int start_offset;
611  unsigned int cur_data_count;
612  unsigned int cur_data_idx;
613  unsigned int retry_cnt;
614  unsigned int ret = 0;
615 
616  /* Clear AUX CH data buffer */
617  reg = BUF_CLR;
619 
620  start_offset = 0;
621  while (start_offset < count) {
622  /* Buffer size of AUX CH is 16 * 4bytes */
623  if ((count - start_offset) > 16)
624  cur_data_count = 16;
625  else
626  cur_data_count = count - start_offset;
627 
628  retry_cnt = 5;
629  while (retry_cnt) {
630  /* Select DPCD device address */
631  reg = AUX_ADDR_7_0(reg_addr + start_offset);
632  lwrite32(reg, &dp_regs->aux_addr_7_0);
633  reg = AUX_ADDR_15_8(reg_addr + start_offset);
635  reg = AUX_ADDR_19_16(reg_addr + start_offset);
637  /*
638  * Set DisplayPort transaction and read
639  * If bit 3 is 1, DisplayPort transaction.
640  * If Bit 3 is 0, I2C transaction.
641  */
642  reg = AUX_LENGTH(cur_data_count) |
644  lwrite32(reg, &dp_regs->aux_ch_ctl1);
645 
646  /* Start AUX transaction */
648  if (ret != EXYNOS_DP_SUCCESS) {
649  if (retry_cnt == 0) {
650  printk(BIOS_ERR, "DP Aux Transaction failed\n");
651  return ret;
652  }
653  retry_cnt--;
654  } else
655  break;
656  }
657 
658  for (cur_data_idx = 0; cur_data_idx < cur_data_count;
659  cur_data_idx++) {
660  reg = lread32((void *)((u32)&dp_regs->buf_data0 +
661  4 * cur_data_idx));
662  data[start_offset + cur_data_idx] = (unsigned char)reg;
663  }
664 
665  start_offset += cur_data_count;
666  }
667 
668  return ret;
669 }
670 
672  u32 reg_addr)
673 {
674  u32 reg;
675  int retval;
676 
677  /* Set EDID device address */
678  reg = device_addr;
679  lwrite32(reg, &dp_regs->aux_addr_7_0);
682 
683  /* Set offset from base address of EDID device */
684  lwrite32(reg_addr, &dp_regs->buf_data0);
685 
686  /*
687  * Set I2C transaction and write address
688  * If bit 3 is 1, DisplayPort transaction.
689  * If Bit 3 is 0, I2C transaction.
690  */
693  lwrite32(reg, &dp_regs->aux_ch_ctl1);
694 
695  /* Start AUX transaction */
697  if (retval != 0)
698  printk(BIOS_DEBUG, "%s: DP Aux Transaction fail!\n", __func__);
699 
700  return retval;
701 }
702 
704  u32 reg_addr,
705  unsigned int *data)
706 {
707  u32 reg;
708  int i;
709  int retval;
710 
711  for (i = 0; i < 10; i++) {
712  /* Clear AUX CH data buffer */
713  reg = BUF_CLR;
715 
716  /* Select EDID device */
717  retval = exynos_dp_select_i2c_device(device_addr, reg_addr);
718  if (retval != 0) {
719  printk(BIOS_DEBUG, "DP Select EDID device fail. retry !\n");
720  continue;
721  }
722 
723  /*
724  * Set I2C transaction and read data
725  * If bit 3 is 1, DisplayPort transaction.
726  * If Bit 3 is 0, I2C transaction.
727  */
730  lwrite32(reg, &dp_regs->aux_ch_ctl1);
731 
732  /* Start AUX transaction */
734  if (retval != EXYNOS_DP_SUCCESS)
735  printk(BIOS_DEBUG, "%s: DP Aux Transaction fail!\n", __func__);
736  }
737 
738  /* Read data */
739  if (retval == 0)
740  *data = lread32(&dp_regs->buf_data0);
741 
742  return retval;
743 }
744 
746  u32 reg_addr, unsigned int count, unsigned char edid[])
747 {
748  u32 reg;
749  unsigned int i, j;
750  unsigned int cur_data_idx;
751  unsigned int defer = 0;
752  int retval = 0;
753 
754  for (i = 0; i < count; i += 16) { /* use 16 burst */
755  for (j = 0; j < 100; j++) {
756  /* Clear AUX CH data buffer */
757  reg = BUF_CLR;
759 
760  /* Set normal AUX CH command */
761  reg = lread32(&dp_regs->aux_ch_ctl2);
762  reg &= ~ADDR_ONLY;
763  lwrite32(reg, &dp_regs->aux_ch_ctl2);
764 
765  /*
766  * If Rx sends defer, Tx sends only reads
767  * request without sending address
768  */
769  if (!defer)
770  retval =
771  exynos_dp_select_i2c_device(device_addr,
772  reg_addr + i);
773  else
774  defer = 0;
775 
776  if (retval == EXYNOS_DP_SUCCESS) {
777  /*
778  * Set I2C transaction and write data
779  * If bit 3 is 1, DisplayPort transaction.
780  * If Bit 3 is 0, I2C transaction.
781  */
782  reg = AUX_LENGTH(16) |
785  lwrite32(reg, &dp_regs->aux_ch_ctl1);
786 
787  /* Start AUX transaction */
789  if (retval == 0)
790  break;
791  else
792  printk(BIOS_ERR, "DP Aux Transaction fail!\n");
793  }
794  /* Check if Rx sends defer */
795  reg = lread32(&dp_regs->aux_rx_comm);
796  if (reg == AUX_RX_COMM_AUX_DEFER ||
797  reg == AUX_RX_COMM_I2C_DEFER) {
798  printk(BIOS_ERR, "DP Defer: %d\n\n", reg);
799  defer = 1;
800  }
801  }
802 
803  for (cur_data_idx = 0; cur_data_idx < 16; cur_data_idx++) {
804  reg = lread32((void *)((u32)&dp_regs->buf_data0
805  + 4 * cur_data_idx));
806  edid[i + cur_data_idx] = (unsigned char)reg;
807  }
808  }
809 
810  return retval;
811 }
812 
814 {
815  u32 reg;
816 
817  reg = lread32(&dp_regs->phy_test);
818  reg |= MACRO_RST;
819  lwrite32(reg, &dp_regs->phy_test);
820 
821  /* 10 us is the minimum Macro reset time. */
822  udelay(50);
823 
824  reg &= ~MACRO_RST;
825  lwrite32(reg, &dp_regs->phy_test);
826 }
827 
828 void exynos_dp_set_link_bandwidth(unsigned char bwtype)
829 {
830  u32 reg;
831 
832  reg = (u32)bwtype;
833 
834  /* Set bandwidth to 2.7G or 1.62G */
835  if ((bwtype == DP_LANE_BW_1_62) || (bwtype == DP_LANE_BW_2_70))
836  lwrite32(reg, &dp_regs->link_bw_set);
837 }
838 
839 unsigned char exynos_dp_get_link_bandwidth(void)
840 {
841  unsigned char ret;
842  u32 reg;
843 
844  reg = lread32(&dp_regs->link_bw_set);
845  ret = (unsigned char)reg;
846 
847  return ret;
848 }
849 
850 void exynos_dp_set_lane_count(unsigned char count)
851 {
852  u32 reg;
853 
854  reg = (u32)count;
855 
856  if ((count == DP_LANE_CNT_1) || (count == DP_LANE_CNT_2) ||
857  (count == DP_LANE_CNT_4))
859 }
860 
861 unsigned int exynos_dp_get_lane_count(void)
862 {
863  u32 reg;
864 
865  reg = lread32(&dp_regs->lane_count_set);
866 
867  return reg;
868 }
869 
870 unsigned char exynos_dp_get_lanex_pre_emphasis(unsigned char lanecnt)
871 {
872  void *reg_list[DP_LANE_CNT_4] = {
877  };
878 
879  return lread32(reg_list[lanecnt]);
880 }
881 
882 void exynos_dp_set_lanex_pre_emphasis(unsigned char request_val,
883  unsigned char lanecnt)
884 {
885  void *reg_list[DP_LANE_CNT_4] = {
890  };
891 
892  lwrite32(request_val, reg_list[lanecnt]);
893 }
894 
895 void exynos_dp_set_lane_pre_emphasis(unsigned int level, unsigned char lanecnt)
896 {
897  unsigned char i;
898  u32 reg;
899  void *reg_list[DP_LANE_CNT_4] = {
904  };
905  u32 reg_shift[DP_LANE_CNT_4] = {
910  };
911 
912  for (i = 0; i < lanecnt; i++) {
913  reg = level << reg_shift[i];
914  lwrite32(reg, reg_list[i]);
915  }
916 }
917 
919 {
920  u32 reg = 0;
921 
922  switch (pattern) {
923  case PRBS7:
925  break;
926  case D10_2:
928  break;
929  case TRAINING_PTN1:
931  break;
932  case TRAINING_PTN2:
934  break;
935  case DP_NONE:
938  break;
939  default:
940  break;
941  }
942 
944 }
945 
946 void exynos_dp_enable_enhanced_mode(unsigned char enable)
947 {
948  u32 reg;
949 
950  reg = lread32(&dp_regs->sys_ctl4);
951  reg &= ~ENHANCED;
952 
953  if (enable)
954  reg |= ENHANCED;
955 
956  lwrite32(reg, &dp_regs->sys_ctl4);
957 }
958 
959 void exynos_dp_enable_scrambling(unsigned int enable)
960 {
961  u32 reg;
962 
964  reg &= ~(SCRAMBLING_DISABLE);
965 
966  if (!enable)
967  reg |= SCRAMBLING_DISABLE;
968 
970 }
972 {
973  unsigned int reg;
974 
975  /* Clear VID_CLK_CHG[1] and VID_FORMAT_CHG[3] and VSYNC_DET[7] */
978 
979  /* I_STRM__CLK detect : DE_CTL : Auto detect */
980  reg &= ~DET_CTRL;
981  lwrite32(reg, &dp_regs->sys_ctl1);
982  return 0;
983 }
984 
986 {
987  u32 reg;
988 
989  /* Video Slave mode setting */
990  reg = lread32(&dp_regs->func_en1);
992  reg |= MASTER_VID_FUNC_EN_N;
993  lwrite32(reg, &dp_regs->func_en1);
994 
995  /* Configure Interlaced for slave mode video */
996  reg = lread32(&dp_regs->video_ctl10);
997  reg &= ~INTERACE_SCAN_CFG;
999  printk(BIOS_SPEW, "interlaced %d\n", video_info->interlaced);
1000  lwrite32(reg, &dp_regs->video_ctl10);
1001 
1002  /* Configure V sync polarity for slave mode video */
1003  reg = lread32(&dp_regs->video_ctl10);
1004  reg &= ~VSYNC_POLARITY_CFG;
1006  lwrite32(reg, &dp_regs->video_ctl10);
1007 
1008  /* Configure H sync polarity for slave mode video */
1009  reg = lread32(&dp_regs->video_ctl10);
1010  reg &= ~HSYNC_POLARITY_CFG;
1012  lwrite32(reg, &dp_regs->video_ctl10);
1013 
1014  /*Set video mode to slave mode */
1017 }
1018 
1020 {
1021  u32 reg;
1022 
1023  /* Configure the input color depth, color space, dynamic range */
1027  lwrite32(reg, &dp_regs->video_ctl2);
1028 
1029  /* Set Input Color YCbCr Coefficients to ITU601 or ITU709 */
1030  reg = lread32(&dp_regs->video_ctl3);
1031  reg &= ~IN_YC_COEFFI_MASK;
1032  if (video_info->ycbcr_coeff)
1033  reg |= IN_YC_COEFFI_ITU709;
1034  else
1035  reg |= IN_YC_COEFFI_ITU601;
1036  lwrite32(reg, &dp_regs->video_ctl3);
1037 }
1038 
1040 {
1041  u32 reg;
1042 
1043  /* Update Video stream clk detect status */
1044  reg = lread32(&dp_regs->sys_ctl1);
1045  lwrite32(reg, &dp_regs->sys_ctl1);
1046 
1047  reg = lread32(&dp_regs->sys_ctl1);
1048 
1049  if (!(reg & DET_STA)) {
1050  printk(BIOS_DEBUG, "DP Input stream clock not detected.\n");
1051  return -1;
1052  }
1053 
1054  return EXYNOS_DP_SUCCESS;
1055 }
1056 
1057 void exynos_dp_set_video_cr_mn(unsigned int type, unsigned int m_value,
1058  unsigned int n_value)
1059 {
1060  u32 reg;
1061 
1062  if (type == REGISTER_M) {
1063  reg = lread32(&dp_regs->sys_ctl4);
1064  reg |= FIX_M_VID;
1065  lwrite32(reg, &dp_regs->sys_ctl4);
1066  reg = M_VID0_CFG(m_value);
1067  lwrite32(reg, &dp_regs->m_vid0);
1068  reg = M_VID1_CFG(m_value);
1069  lwrite32(reg, &dp_regs->m_vid1);
1070  reg = M_VID2_CFG(m_value);
1071  lwrite32(reg, &dp_regs->m_vid2);
1072 
1073  reg = N_VID0_CFG(n_value);
1074  lwrite32(reg, &dp_regs->n_vid0);
1075  reg = N_VID1_CFG(n_value);
1076  lwrite32(reg, &dp_regs->n_vid1);
1077  reg = N_VID2_CFG(n_value);
1078  lwrite32(reg, &dp_regs->n_vid2);
1079  } else {
1080  reg = lread32(&dp_regs->sys_ctl4);
1081  reg &= ~FIX_M_VID;
1082  lwrite32(reg, &dp_regs->sys_ctl4);
1083  }
1084 }
1085 
1087 {
1088  u32 reg;
1089 
1090  reg = lread32(&dp_regs->video_ctl10);
1091  reg &= ~FORMAT_SEL;
1092 
1094  reg |= FORMAT_SEL;
1095 
1096  lwrite32(reg, &dp_regs->video_ctl10);
1097 }
1098 
1099 void exynos_dp_enable_video_master(unsigned int enable)
1100 {
1101  u32 reg;
1102 
1103  reg = lread32(&dp_regs->soc_general_ctl);
1104  if (enable) {
1105  reg &= ~VIDEO_MODE_MASK;
1107  } else {
1108  reg &= ~VIDEO_MODE_MASK;
1109  reg |= VIDEO_MODE_SLAVE_MODE;
1110  }
1111 
1113 }
1114 
1116 {
1117  u32 reg;
1118 
1119  /* Enable Video input and disable Mute */
1120  reg = lread32(&dp_regs->video_ctl1);
1121  reg |= VIDEO_EN;
1122  lwrite32(reg, &dp_regs->video_ctl1);
1123 }
1124 
1126 {
1127  u32 reg;
1128 
1129  /* Update STRM_VALID */
1130  reg = lread32(&dp_regs->sys_ctl3);
1131  lwrite32(reg, &dp_regs->sys_ctl3);
1132 
1133  reg = lread32(&dp_regs->sys_ctl3);
1134 
1135  if (!(reg & STRM_VALID))
1136  return -1;
1137 
1138  return EXYNOS_DP_SUCCESS;
1139 }
1140 
1141 void dp_phy_control(unsigned int enable)
1142 {
1143  u32 cfg;
1144 
1146  if (enable)
1147  cfg |= EXYNOS_DP_PHY_ENABLE;
1148  else
1149  cfg &= ~EXYNOS_DP_PHY_ENABLE;
1151 }
#define HPD_STATUS
Definition: anx7625.h:68
static const u32 pattern[8]
Definition: ast_post.c:428
#define printk(level,...)
Definition: stdlib.h:16
void mdelay(unsigned int msecs)
Definition: delay.c:2
@ PLL_UNLOCKED
Definition: dp-core.h:64
unsigned int exynos_dp_write_bytes_to_dpcd(u32 reg_addr, unsigned int count, unsigned char data[])
Definition: dp_lowlevel.c:540
unsigned int exynos_dp_read_bytes_from_dpcd(u32 reg_addr, unsigned int count, unsigned char data[])
Definition: dp_lowlevel.c:605
static void exynos_dp_reset_aux(void)
Definition: dp_lowlevel.c:333
void exynos_dp_set_video_cr_mn(unsigned int type, unsigned int m_value, unsigned int n_value)
Definition: dp_lowlevel.c:1057
unsigned int exynos_dp_get_plug_in_status(void)
Definition: dp_lowlevel.c:389
void exynos_dp_enable_video_master(unsigned int enable)
Definition: dp_lowlevel.c:1099
static void exynos_dp_init_interrupt(void)
Definition: dp_lowlevel.c:123
static struct exynos_dp *const dp_regs
Definition: dp_lowlevel.c:13
#define lwrite32(a, b)
Definition: dp_lowlevel.c:36
#define lread32(a)
Definition: dp_lowlevel.c:37
void exynos_dp_config_interrupt(void)
Definition: dp_lowlevel.c:368
int exynos_dp_read_byte_from_i2c(u32 device_addr, u32 reg_addr, unsigned int *data)
Definition: dp_lowlevel.c:703
unsigned int exynos_dp_detect_hpd(void)
Definition: dp_lowlevel.c:400
unsigned int exynos_dp_get_lane_count(void)
Definition: dp_lowlevel.c:861
void exynos_dp_reset(void)
Definition: dp_lowlevel.c:150
unsigned int exynos_dp_is_slave_video_stream_clock_on(void)
Definition: dp_lowlevel.c:1039
void exynos_dp_set_link_bandwidth(unsigned char bwtype)
Definition: dp_lowlevel.c:828
unsigned int exynos_dp_read_byte_from_dpcd(u32 reg_addr, unsigned char *data)
Definition: dp_lowlevel.c:502
int exynos_dp_read_bytes_from_i2c(u32 device_addr, u32 reg_addr, unsigned int count, unsigned char edid[])
Definition: dp_lowlevel.c:745
unsigned int exynos_dp_get_pll_lock_status(void)
Definition: dp_lowlevel.c:241
void exynos_dp_enable_sw_func(unsigned int enable)
Definition: dp_lowlevel.c:175
void dp_phy_control(unsigned int enable)
Definition: dp_lowlevel.c:1141
void exynos_dp_set_video_color_format(struct edp_video_info *video_info)
Definition: dp_lowlevel.c:1019
int exynos_dp_select_i2c_device(u32 device_addr, u32 reg_addr)
Definition: dp_lowlevel.c:671
unsigned char exynos_dp_get_lanex_pre_emphasis(unsigned char lanecnt)
Definition: dp_lowlevel.c:870
void exynos_dp_set_lane_count(unsigned char count)
Definition: dp_lowlevel.c:850
unsigned int exynos_dp_is_video_stream_on(void)
Definition: dp_lowlevel.c:1125
void exynos_dp_set_training_pattern(unsigned int pattern)
Definition: dp_lowlevel.c:918
int exynos_dp_init_video(void)
Definition: dp_lowlevel.c:971
void exynos_dp_disable_video_bist(void)
Definition: dp_lowlevel.c:54
unsigned int exynos_dp_start_aux_transaction(void)
Definition: dp_lowlevel.c:416
void exynos_dp_enable_enhanced_mode(unsigned char enable)
Definition: dp_lowlevel.c:946
unsigned int exynos_dp_write_byte_to_dpcd(u32 reg_addr, u8 data)
Definition: dp_lowlevel.c:464
void exynos_dp_set_lane_pre_emphasis(unsigned int level, unsigned char lanecnt)
Definition: dp_lowlevel.c:895
void exynos_dp_start_video(void)
Definition: dp_lowlevel.c:1115
int exynos_dp_init_analog_func(void)
Definition: dp_lowlevel.c:266
void exynos_dp_enable_scrambling(unsigned int enable)
Definition: dp_lowlevel.c:959
void exynos_dp_init_aux(void)
Definition: dp_lowlevel.c:343
void exynos_dp_enable_video_mute(unsigned int enable)
Definition: dp_lowlevel.c:62
static void exynos_dp_init_analog_param(void)
Definition: dp_lowlevel.c:74
unsigned char exynos_dp_get_link_bandwidth(void)
Definition: dp_lowlevel.c:839
static void exynos_dp_set_pll_power(unsigned int enable)
Definition: dp_lowlevel.c:253
void exynos_dp_set_lanex_pre_emphasis(unsigned char request_val, unsigned char lanecnt)
Definition: dp_lowlevel.c:882
static void exynos_dp_enable_video_input(u32 enable)
Definition: dp_lowlevel.c:40
void exynos_dp_config_video_slave_mode(struct edp_video_info *video_info)
Definition: dp_lowlevel.c:985
void exynos_dp_reset_macro(void)
Definition: dp_lowlevel.c:813
void exynos_dp_init_hpd(void)
Definition: dp_lowlevel.c:317
unsigned int exynos_dp_set_analog_power_down(unsigned int block, u32 enable)
Definition: dp_lowlevel.c:188
void exynos_dp_set_video_timing_mode(unsigned int type)
Definition: dp_lowlevel.c:1086
#define TX_CUR1_2X
Definition: edp.h:441
#define AUX_RX_COMM_I2C_DEFER
Definition: edp.h:403
@ CH0_BLOCK
Definition: edp.h:619
@ POWER_ALL
Definition: edp.h:624
@ AUX_BLOCK
Definition: edp.h:618
@ CH1_BLOCK
Definition: edp.h:620
@ CH3_BLOCK
Definition: edp.h:622
@ ANALOG_TOTAL
Definition: edp.h:623
@ CH2_BLOCK
Definition: edp.h:621
#define VSYNC_POLARITY_CFG
Definition: edp.h:217
#define VSYNC_DET
Definition: edp.h:254
#define LS_CLK_DOMAIN_FUNC_EN_N
Definition: edp.h:168
#define VID_CLK_CHG
Definition: edp.h:260
#define PLL_LOCK_CTRL
Definition: edp.h:390
#define RPLY_RECEIV
Definition: edp.h:288
#define FIX_M_VID
Definition: edp.h:318
@ DP_NONE
Definition: edp.h:568
@ TRAINING_PTN2
Definition: edp.h:567
@ D10_2
Definition: edp.h:565
@ TRAINING_PTN1
Definition: edp.h:566
#define IN_BPC_SHIFT
Definition: edp.h:180
#define SW_FUNC_EN_N
Definition: edp.h:162
#define AUX_ERR
Definition: edp.h:289
#define ADDR_ONLY
Definition: edp.h:422
#define DET_STA
Definition: edp.h:296
#define VIDEO_EN
Definition: edp.h:171
#define PD_RING_OSC
Definition: edp.h:436
@ REGISTER_M
Definition: edp.h:555
#define SW_TRAINING_PATTERN_SET_PTN1
Definition: edp.h:379
#define AUX_TX_COMM_I2C_TRANSACTION
Definition: edp.h:415
#define SCRAMBLING_ENABLE
Definition: edp.h:370
#define AUD_FUNC_EN_N
Definition: edp.h:160
#define F_HPD
Definition: edp.h:308
#define IN_YC_COEFFI_MASK
Definition: edp.h:192
#define INTERACE_SCAN_CFG
Definition: edp.h:215
#define AUX_ADDR_7_0(x)
Definition: edp.h:513
#define DRIVE_DVDD_BIT_1_0625V
Definition: edp.h:432
#define AUX_ADDR_19_16(x)
Definition: edp.h:515
#define HPD_LOST
Definition: edp.h:280
#define AUX_ADDR_15_8(x)
Definition: edp.h:514
#define AUX_STATUS_MASK
Definition: edp.h:396
#define AUX_TX_COMM_DP_TRANSACTION
Definition: edp.h:414
#define IN_YC_COEFFI_ITU601
Definition: edp.h:195
#define LINK_QUAL_PATTERN_SET_PRBS7
Definition: edp.h:374
#define INT_HPD
Definition: edp.h:284
#define INT_POL
Definition: edp.h:293
#define LINK_QUAL_PATTERN_SET_DISABLE
Definition: edp.h:376
#define HDCP_FUNC_EN_N
Definition: edp.h:161
#define DEFER_COUNT(x)
Definition: edp.h:400
#define IN_COLOR_F_SHIFT
Definition: edp.h:186
#define F_PLL_LOCK
Definition: edp.h:389
#define AUX_TX_COMM_MOT
Definition: edp.h:416
#define AUD_FIFO_FUNC_EN_N
Definition: edp.h:159
#define SERDES_FIFO_FUNC_EN_N
Definition: edp.h:167
#define HPD_CTRL
Definition: edp.h:309
#define AUX_EN
Definition: edp.h:423
#define HOTPLUG_CHG
Definition: edp.h:279
#define AUX_RX_COMM_AUX_DEFER
Definition: edp.h:404
#define SEL_24M
Definition: edp.h:251
#define IN_D_RANGE_SHIFT
Definition: edp.h:176
#define ENHANCED
Definition: edp.h:317
#define AUX_TX_COMM_WRITE
Definition: edp.h:417
#define DEFER_CTRL_EN
Definition: edp.h:399
#define BUF_CLR
Definition: edp.h:407
#define SW_TRAINING_PATTERN_SET_PTN2
Definition: edp.h:378
#define STRM_VALID
Definition: edp.h:311
#define AUX_FUNC_EN_N
Definition: edp.h:166
#define IN_YC_COEFFI_ITU709
Definition: edp.h:194
#define PLUG
Definition: edp.h:281
@ VIDEO_TIMING_FROM_CAPTURE
Definition: edp.h:559
#define SCRAMBLING_DISABLE
Definition: edp.h:369
#define DET_CTRL
Definition: edp.h:298
#define VID_FORMAT_CHG
Definition: edp.h:258
#define LINK_QUAL_PATTERN_SET_D10_2
Definition: edp.h:375
#define HSYNC_POLARITY_CFG
Definition: edp.h:219
#define PLL_LOCK
Definition: edp.h:388
#define AUX_LENGTH(x)
Definition: edp.h:412
#define AUX_TX_COMM_READ
Definition: edp.h:418
#define PLL_LOCK_CHG
Definition: edp.h:255
#define FORMAT_SEL
Definition: dp.h:205
#define AUX_PD
Definition: dp.h:350
#define VIDEO_MODE_MASK
Definition: dp.h:413
#define AUDIO_MODE_SPDIF_MODE
Definition: dp.h:408
#define VIDEO_MODE_SLAVE_MODE
Definition: dp.h:414
#define VIDEO_MODE_MASTER_MODE
Definition: dp.h:415
#define CH0_PD
Definition: dp.h:354
#define CH2_PD
Definition: dp.h:352
#define DP_PLL_PD
Definition: dp.h:342
#define MACRO_RST
Definition: dp.h:357
#define MASTER_VID_FUNC_EN_N
Definition: dp.h:159
#define CH3_PD
Definition: dp.h:351
#define DP_PLL_RESET
Definition: dp.h:343
#define CH1_PD
Definition: dp.h:353
#define VIDEO_MASTER_MODE_EN
Definition: dp.h:412
#define SLAVE_VID_FUNC_EN_N
Definition: dp.h:160
#define SW_TRAINING_PATTERN_SET_NORMAL
Definition: dp.h:320
#define DP_PLL_REF_BIT_1_1250V
Definition: dp.h:345
#define DP_PLL_LOOP_BIT_DEFAULT
Definition: dp.h:344
#define RESET_DP_TX
Definition: dp.h:156
#define COMMON_INT_MASK_3
Definition: dp.h:354
#define VCO_BIT_000_MICRO
Definition: dp.h:229
#define PHY_PD
Definition: dp.h:288
#define VIDEO_EN_MASK
Definition: dp.h:201
#define N_VID0_CFG(x)
Definition: dp.h:605
#define EXYNOS_DP_SUCCESS
Definition: dp.h:1177
#define COMMON_INT_MASK_2
Definition: dp.h:353
#define M_VID2_CFG(x)
Definition: dp.h:602
#define TX_DVDD_BIT_1_0625V
Definition: dp.h:221
#define VIDEO_BIST_MASK
Definition: dp.h:205
#define TX_TERMINAL_CTRL_61_OHM
Definition: dp.h:211
#define SEL_BG_NEW_BANDGAP
Definition: dp.h:208
#define SWING_A_30PER_G_NORMAL
Definition: dp.h:215
#define PRE_EMPHASIS_SET_3_SHIFT
Definition: dp.h:490
#define PRE_EMPHASIS_SET_1_SHIFT
Definition: dp.h:452
#define AUX_TERMINAL_CTRL_52_OHM
Definition: dp.h:240
#define COMMON_INT_MASK_4
Definition: dp.h:355
#define N_VID2_CFG(x)
Definition: dp.h:607
#define AUX_BIT_PERIOD_EXPECTED_DELAY(x)
Definition: dp.h:340
#define PRE_EMPHASIS_SET_2_SHIFT
Definition: dp.h:471
#define COMMON_INT_MASK_1
Definition: dp.h:352
#define TX_CUR_4_MA
Definition: dp.h:250
#define AUX_HW_RETRY_COUNT_SEL(x)
Definition: dp.h:346
#define CH0_AMP_0_MV
Definition: dp.h:256
#define M_VID1_CFG(x)
Definition: dp.h:601
#define VIDEO_MUTE_MASK
Definition: dp.h:202
#define CH3_AMP_0_MV
Definition: dp.h:253
#define INT_STA_MASK
Definition: dp.h:356
#define N_VID1_CFG(x)
Definition: dp.h:606
#define CH1_AMP_0_MV
Definition: dp.h:255
#define CH2_AMP_0_MV
Definition: dp.h:254
#define PRE_EMPHASIS_SET_0_SHIFT
Definition: dp.h:433
#define SEL_CURRENT_DEFAULT
Definition: dp.h:228
#define M_VID0_CFG(x)
Definition: dp.h:600
#define INTERACE_SCAN_CFG_SHIFT
Definition: dp.h:507
@ DP_LANE_CNT_1
Definition: dp.h:1276
@ DP_LANE_CNT_2
Definition: dp.h:1277
@ DP_LANE_CNT_4
Definition: dp.h:1278
@ DP_DISABLE
Definition: dp.h:1180
@ DP_ENABLE
Definition: dp.h:1181
#define AUX_HW_RETRY_INTERVAL_600_MICROSECONDS
Definition: dp.h:342
#define H_S_POLARITY_CFG_SHIFT
Definition: dp.h:511
#define DP_TIMEOUT_LOOP_COUNT
Definition: dp.h:1173
@ DP_LANE_BW_2_70
Definition: dp.h:1272
@ DP_LANE_BW_1_62
Definition: dp.h:1271
#define V_S_POLARITY_CFG_SHIFT
Definition: dp.h:509
#define PLL_LOCKED
Definition: setup.h:255
unsigned int type
Definition: edid.c:57
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
Definition: loglevel.h:72
#define BIOS_SPEW
BIOS_SPEW - Excessively verbose output.
Definition: loglevel.h:142
static struct exynos5_power *const exynos_power
Definition: power.h:52
#define EXYNOS_DP_PHY_ENABLE
Definition: power.h:20
@ PRBS7
#define EXYNOS5_DP1_BASE
Definition: cpu.h:49
uint32_t u32
Definition: stdint.h:51
uint8_t u8
Definition: stdint.h:45
Definition: edid.h:49
uint32_t dptx_phy_control
Definition: power.h:39
Definition: dp.h:11
u32 training_ptn_set
Definition: dp.h:104
u32 m_vid1
Definition: dp.h:123
u32 phy_test
Definition: dp.h:131
u32 m_vid2
Definition: dp.h:124
u32 n_vid0
Definition: dp.h:125
u32 analog_ctl3
Definition: dp.h:72
u32 video_ctl2
Definition: dp.h:18
u32 int_sta_mask3
Definition: dp.h:174
u32 debug_ctl
Definition: dp.h:113
u32 func_en1
Definition: dp.h:15
u32 n_vid1
Definition: dp.h:126
u32 int_sta_mask1
Definition: dp.h:172
u32 lane_count_set
Definition: dp.h:103
u32 ln1_link_training_ctl
Definition: dp.h:106
u32 common_int_mask3
Definition: dp.h:170
u32 aux_ch_ctl2
Definition: dp.h:157
u32 int_sta_mask2
Definition: dp.h:173
u32 video_ctl1
Definition: dp.h:17
u32 func_en2
Definition: dp.h:16
u32 ln0_link_training_ctl
Definition: dp.h:105
u32 analog_ctl2
Definition: dp.h:71
u32 sys_ctl3
Definition: dp.h:93
u32 ln3_link_training_ctl
Definition: dp.h:108
u32 aux_ch_ctl1
Definition: dp.h:153
u32 phy_pd
Definition: dp.h:130
u32 tx_sw_reset
Definition: dp.h:14
u32 aux_hw_retry_ctl
Definition: dp.h:78
u32 common_int_sta4
Definition: dp.h:84
u32 aux_addr_19_16
Definition: dp.h:156
u32 common_int_sta1
Definition: dp.h:81
u32 aux_addr_15_8
Definition: dp.h:155
u32 ln2_link_training_ctl
Definition: dp.h:107
u32 int_sta_mask4
Definition: dp.h:175
u32 common_int_mask2
Definition: dp.h:169
u32 buf_data0
Definition: dp.h:159
u32 video_ctl10
Definition: dp.h:26
u32 common_int_sta2
Definition: dp.h:82
u32 aux_ch_defer_ctl
Definition: dp.h:149
u32 aux_ch_sta
Definition: dp.h:147
u32 m_vid0
Definition: dp.h:122
u32 buffer_data_ctl
Definition: dp.h:151
u32 analog_ctl1
Definition: dp.h:70
u32 common_int_sta3
Definition: dp.h:83
u32 int_sta_mask
Definition: dp.h:176
u32 common_int_mask1
Definition: dp.h:168
u32 link_bw_set
Definition: dp.h:101
u32 aux_addr_7_0
Definition: dp.h:154
u32 pll_filter_ctl1
Definition: dp.h:74
u32 sys_ctl4
Definition: dp.h:94
u32 soc_general_ctl
Definition: dp.h:162
u32 sys_ctl1
Definition: dp.h:91
u32 int_ctl
Definition: dp.h:89
u32 video_ctl3
Definition: dp.h:19
u32 common_int_mask4
Definition: dp.h:171
u32 pll_ctl
Definition: dp.h:129
u32 aux_rx_comm
Definition: dp.h:150
u32 int_sta
Definition: dp.h:87
u32 amp_tuning_ctl
Definition: dp.h:75
u32 n_vid2
Definition: dp.h:127
u32 video_ctl4
Definition: dp.h:20
enum color_coefficient ycbcr_coeff
Definition: dp-core.h:77
enum color_depth color_depth
Definition: dp-core.h:78
enum dynamic_range dynamic_range
Definition: dp-core.h:76
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
void udelay(uint32_t us)
Definition: udelay.c:15
#define count