coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
sor.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 /*
4  * drivers/video/tegra/dc/sor.c
5  */
6 
7 #include <boot/tables.h>
8 #include <console/console.h>
9 #include <delay.h>
10 #include <device/device.h>
11 #include <soc/addressmap.h>
12 #include <soc/clk_rst.h>
13 #include <soc/clock.h>
14 #include <soc/display.h>
15 #include <soc/nvidia/tegra/dc.h>
17 #include <soc/sor.h>
18 #include <stdint.h>
19 
20 #include "chip.h"
21 
22 #define DEBUG_SOR 0
23 
24 #define APBDEV_PMC_DPD_SAMPLE (0x20)
25 #define APBDEV_PMC_DPD_SAMPLE_ON_DISABLE (0)
26 #define APBDEV_PMC_DPD_SAMPLE_ON_ENABLE (1)
27 #define APBDEV_PMC_SEL_DPD_TIM (0x1c8)
28 #define APBDEV_PMC_SEL_DPD_TIM_SEL_DPD_TIM_DEFAULT (0x7f)
29 #define APBDEV_PMC_IO_DPD2_REQ (0x1c0)
30 #define APBDEV_PMC_IO_DPD2_REQ_LVDS_SHIFT (25)
31 #define APBDEV_PMC_IO_DPD2_REQ_LVDS_OFF (0 << 25)
32 #define APBDEV_PMC_IO_DPD2_REQ_LVDS_ON (1 << 25)
33 #define APBDEV_PMC_IO_DPD2_REQ_CODE_SHIFT (30)
34 #define APBDEV_PMC_IO_DPD2_REQ_CODE_DEFAULT_MASK (0x3 << 30)
35 #define APBDEV_PMC_IO_DPD2_REQ_CODE_IDLE (0 << 30)
36 #define APBDEV_PMC_IO_DPD2_REQ_CODE_DPD_OFF (1 << 30)
37 #define APBDEV_PMC_IO_DPD2_REQ_CODE_DPD_ON (2 << 30)
38 #define APBDEV_PMC_IO_DPD2_STATUS (0x1c4)
39 #define APBDEV_PMC_IO_DPD2_STATUS_LVDS_SHIFT (25)
40 #define APBDEV_PMC_IO_DPD2_STATUS_LVDS_OFF (0 << 25)
41 #define APBDEV_PMC_IO_DPD2_STATUS_LVDS_ON (1 << 25)
42 
43 static inline u32 tegra_sor_readl(struct tegra_dc_sor_data *sor, u32 reg)
44 {
45  void *addr = sor->base + (u32) (reg << 2);
46  u32 reg_val = READL(addr);
47  return reg_val;
48 }
49 
50 static inline void tegra_sor_writel(struct tegra_dc_sor_data *sor,
51  u32 reg, u32 val)
52 {
53  void *addr = sor->base + (u32) (reg << 2);
54  WRITEL(val, addr);
55 }
56 
57 static inline void tegra_sor_write_field(struct tegra_dc_sor_data *sor,
58  u32 reg, u32 mask, u32 val)
59 {
60  u32 reg_val = tegra_sor_readl(sor, reg);
61  reg_val &= ~mask;
62  reg_val |= val;
63  tegra_sor_writel(sor, reg, reg_val);
64 }
65 
67 {
72 }
73 
75  u32 pe_reg, u32 vs_reg, u32 pc_reg, u8 pc_supported)
76 {
78  mask, pe_reg);
80  mask, vs_reg);
81  if (pc_supported) {
83  sor, NV_SOR_POSTCURSOR(sor->portnum),
84  mask, pc_reg);
85  }
86 }
87 
89  u32 reg, u32 mask, u32 exp_val, u32 poll_interval_us, u32 timeout_us)
90 {
91  u32 temp = timeout_us;
92  u32 reg_val = 0;
93 
94  do {
95  udelay(poll_interval_us);
96  reg_val = tegra_sor_readl(sor, reg);
97  if (timeout_us > poll_interval_us)
98  timeout_us -= poll_interval_us;
99  else
100  break;
101  } while ((reg_val & mask) != exp_val);
102 
103  if ((reg_val & mask) == exp_val)
104  return 0; /* success */
106  "sor_poll_register 0x%x: timeout, "
107  "(reg_val)0x%08x & (mask)0x%08x != (exp_val)0x%08x\n",
108  reg, reg_val, mask, exp_val);
109 
110  return temp;
111 }
112 
114 {
115  u32 reg_val;
116  u32 orig_val;
117 
118  orig_val = tegra_sor_readl(sor, NV_SOR_PWR);
119 
120  reg_val = pu_pd ? NV_SOR_PWR_NORMAL_STATE_PU :
121  NV_SOR_PWR_NORMAL_STATE_PD; /* normal state only */
122 
123  if (reg_val == orig_val)
124  return 0; /* No update needed */
125 
127  tegra_sor_writel(sor, NV_SOR_PWR, reg_val);
128 
129  /* Poll to confirm it is done */
133  100, TEGRA_SOR_TIMEOUT_MS * 1000)) {
135  "dc timeout waiting for SOR_PWR = NEW_DONE\n");
136  return -EFAULT;
137  }
138  return 0;
139 }
140 
142  u8 training_pattern, const struct tegra_dc_dp_link_config *link_cfg)
143 {
144  u32 reg_val;
145 
146  reg_val = tegra_sor_readl(sor, NV_SOR_DP_LINKCTL(sor->portnum));
147 
148  if (ena)
149  reg_val |= NV_SOR_DP_LINKCTL_ENABLE_YES;
150  else
151  reg_val &= NV_SOR_DP_LINKCTL_ENABLE_NO;
152 
153  reg_val &= ~NV_SOR_DP_LINKCTL_TUSIZE_MASK;
154  reg_val |= (link_cfg->tu_size << NV_SOR_DP_LINKCTL_TUSIZE_SHIFT);
155 
156  if (link_cfg->enhanced_framing)
158 
159  tegra_sor_writel(sor, NV_SOR_DP_LINKCTL(sor->portnum), reg_val);
160 
161  switch (training_pattern) {
162  case training_pattern_1:
163  tegra_sor_writel(sor, NV_SOR_DP_TPG, 0x41414141);
164  break;
165  case training_pattern_2:
166  case training_pattern_3:
167  reg_val = (link_cfg->link_bw == SOR_LINK_SPEED_G5_4) ?
168  0x43434343 : 0x42424242;
169  tegra_sor_writel(sor, NV_SOR_DP_TPG, reg_val);
170  break;
171  default:
172  tegra_sor_writel(sor, NV_SOR_DP_TPG, 0x50505050);
173  break;
174  }
175 }
176 
178  int pu, int is_lvds)
179 {
180  u32 reg_val;
181 
182  /* SOR lane sequencer */
183  if (pu)
187  else
191 
192  if (is_lvds)
193  reg_val |= 15 << NV_SOR_LANE_SEQ_CTL_DELAY_SHIFT;
194  else
195  reg_val |= 1 << NV_SOR_LANE_SEQ_CTL_DELAY_SHIFT;
196 
197  tegra_sor_writel(sor, NV_SOR_LANE_SEQ_CTL, reg_val);
198 
202  100, TEGRA_SOR_TIMEOUT_MS*1000)) {
204  "dp: timeout while waiting for SOR lane sequencer "
205  "to power down langes\n");
206  return -1;
207  }
208  return 0;
209 }
210 
212  u32 lane_count, int pu)
213 {
214  u32 reg_val;
215 
216  reg_val = tegra_sor_readl(sor, NV_SOR_DP_PADCTL(sor->portnum));
217 
218  if (pu) {
219  switch (lane_count) {
220  case 4:
221  reg_val |= (NV_SOR_DP_PADCTL_PD_TXD_3_NO |
224  case 2:
225  reg_val |= NV_SOR_DP_PADCTL_PD_TXD_1_NO;
227  case 1:
228  reg_val |= NV_SOR_DP_PADCTL_PD_TXD_0_NO;
229  break;
230  default:
232  "dp: invalid lane number %d\n", lane_count);
233  return -1;
234  }
235 
236  tegra_sor_writel(sor, NV_SOR_DP_PADCTL(sor->portnum), reg_val);
237  tegra_dc_sor_set_lane_count(sor, lane_count);
238  }
239  return tegra_dc_sor_enable_lane_sequencer(sor, pu, 0);
240 }
241 
243  int power_up)
244 {
245  u32 reg_val;
246 
247  /* !!TODO: need to enable panel power through GPIO operations */
248  /* Check bug 790854 for HW progress */
249 
250  reg_val = tegra_sor_readl(sor, NV_SOR_DP_PADCTL(sor->portnum));
251 
252  if (power_up)
254  else
256 
257  tegra_sor_writel(sor, NV_SOR_DP_PADCTL(sor->portnum), reg_val);
258 }
259 
260 static void tegra_dc_sor_config_pwm(struct tegra_dc_sor_data *sor, u32 pwm_div,
261  u32 pwm_dutycycle)
262 {
263  tegra_sor_writel(sor, NV_SOR_PWM_DIV, pwm_div);
265  (pwm_dutycycle & NV_SOR_PWM_CTL_DUTY_CYCLE_MASK) |
267 
271  100, TEGRA_SOR_TIMEOUT_MS * 1000)) {
273  "dp: timeout while waiting for SOR PWM setting\n");
274  }
275 }
276 
278  const struct tegra_dc_dp_link_config *link_cfg)
279 {
280  u32 reg_val;
281 
283 
285  reg_val = tegra_sor_readl(sor, NV_SOR_DP_CONFIG(sor->portnum));
287  reg_val |= link_cfg->watermark;
289  reg_val |= (link_cfg->active_count <<
292  reg_val |= (link_cfg->active_frac <<
294  if (link_cfg->activepolarity)
296  else
300 
301  tegra_sor_writel(sor, NV_SOR_DP_CONFIG(sor->portnum), reg_val);
302 
303  /* program h/vblank sym */
306 
309 }
310 
311 static inline void tegra_dc_sor_super_update(struct tegra_dc_sor_data *sor)
312 {
316 }
317 
318 static inline void tegra_dc_sor_update(struct tegra_dc_sor_data *sor)
319 {
323 }
324 
325 static void tegra_dc_sor_io_set_dpd(struct tegra_dc_sor_data *sor, int up)
326 {
327  u32 reg_val;
328  void *pmc_base = sor->pmc_base;
329 
330  if (up) {
332  pmc_base + APBDEV_PMC_DPD_SAMPLE);
333  WRITEL(10, pmc_base + APBDEV_PMC_SEL_DPD_TIM);
334  }
335 
336  reg_val = READL(pmc_base + APBDEV_PMC_IO_DPD2_REQ);
337  reg_val &= ~(APBDEV_PMC_IO_DPD2_REQ_LVDS_ON |
339 
340  reg_val |= up ? APBDEV_PMC_IO_DPD2_REQ_LVDS_ON |
344 
345  WRITEL(reg_val, pmc_base + APBDEV_PMC_IO_DPD2_REQ);
346 
347  /* Polling */
348  u32 temp = 10*1000;
349  do {
350  udelay(20);
351  reg_val = READL(pmc_base + APBDEV_PMC_IO_DPD2_STATUS);
352  if (temp > 20)
353  temp -= 20;
354  else
355  break;
356  } while ((reg_val & APBDEV_PMC_IO_DPD2_STATUS_LVDS_ON) != 0);
357 
358  if ((reg_val & APBDEV_PMC_IO_DPD2_STATUS_LVDS_ON) != 0)
360  "PMC_IO_DPD2 polling failed (0x%x)\n", reg_val);
361 
362  if (up)
364  pmc_base + APBDEV_PMC_DPD_SAMPLE);
365 }
366 
368 {
369  u32 reg_val;
370 
371  reg_val = tegra_sor_readl(sor, NV_SOR_DP_SPARE(sor->portnum));
372  if (is_int)
374  else
375  reg_val &= ~NV_SOR_DP_SPARE_PANEL_INTERNAL;
376 
379  tegra_sor_writel(sor, NV_SOR_DP_SPARE(sor->portnum), reg_val);
380 }
381 
383  u8 *lane_count)
384 {
385  u32 reg_val;
386 
387  reg_val = tegra_sor_readl(sor, NV_SOR_CLK_CNTRL);
388  *link_bw = (reg_val & NV_SOR_CLK_CNTRL_DP_LINK_SPEED_MASK)
390  reg_val = tegra_sor_readl(sor,
391  NV_SOR_DP_LINKCTL(sor->portnum));
392 
393  switch (reg_val & NV_SOR_DP_LINKCTL_LANECOUNT_MASK) {
395  *lane_count = 0;
396  break;
398  *lane_count = 1;
399  break;
401  *lane_count = 2;
402  break;
404  *lane_count = 4;
405  break;
406  default:
407  printk(BIOS_ERR, "Unknown lane count\n");
408  }
409 }
410 
412 {
416 }
417 
418 void tegra_dc_sor_set_lane_count(struct tegra_dc_sor_data *sor, u8 lane_count)
419 {
420  u32 reg_val;
421 
422  reg_val = tegra_sor_readl(sor, NV_SOR_DP_LINKCTL(sor->portnum));
424  switch (lane_count) {
425  case 0:
426  break;
427  case 1:
429  break;
430  case 2:
432  break;
433  case 4:
435  break;
436  default:
437  /* 0 should be handled earlier. */
438  printk(BIOS_ERR, "dp: Invalid lane count %d\n",
439  lane_count);
440  return;
441  }
442  tegra_sor_writel(sor, NV_SOR_DP_LINKCTL(sor->portnum), reg_val);
443 }
444 
446 {
447  sor_clock_start();
448 }
449 
450 /* The SOR power sequencer does not work for t124 so SW has to
451  go through the power sequence manually */
452 /* Power up steps from spec: */
453 /* STEP PDPORT PDPLL PDBG PLLVCOD PLLCAPD E_DPD PDCAL */
454 /* 1 1 1 1 1 1 1 1 */
455 /* 2 1 1 1 1 1 0 1 */
456 /* 3 1 1 0 1 1 0 1 */
457 /* 4 1 0 0 0 0 0 1 */
458 /* 5 0 0 0 0 0 0 1 */
459 static void tegra_dc_sor_power_up(struct tegra_dc_sor_data *sor,
460  int is_lvds)
461 {
462  if (sor->power_is_up)
463  return;
464 
465  /* Set link bw */
469 
470  /* step 1 */
479  NV_SOR_PLL0_PWR_MASK | /* PDPLL */
480  NV_SOR_PLL0_VCOPD_MASK, /* PLLVCOPD */
486 
487  /* step 2 */
488  tegra_dc_sor_io_set_dpd(sor, 1);
489  udelay(15);
490 
491  /* step 3 */
495  udelay(25);
496 
497  /* step 4 */
499  NV_SOR_PLL0_PWR_MASK | /* PDPLL */
500  NV_SOR_PLL0_VCOPD_MASK, /* PLLVCOPD */
505  udelay(225);
506 
507  /* step 5 */
511 
512  sor->power_is_up = 1;
513 }
514 
515 #if DEBUG_SOR
516 static void dump_sor_reg(struct tegra_dc_sor_data *sor)
517 {
518 #define DUMP_REG(a) printk(BIOS_INFO, "%-32s %03x %08x\n", \
519  #a, a, tegra_sor_readl(sor, a));
520 
521  DUMP_REG(NV_SOR_SUPER_STATE0);
522  DUMP_REG(NV_SOR_SUPER_STATE1);
523  DUMP_REG(NV_SOR_STATE0);
524  DUMP_REG(NV_SOR_STATE1);
525  DUMP_REG(NV_HEAD_STATE0(0));
526  DUMP_REG(NV_HEAD_STATE0(1));
527  DUMP_REG(NV_HEAD_STATE1(0));
528  DUMP_REG(NV_HEAD_STATE1(1));
529  DUMP_REG(NV_HEAD_STATE2(0));
530  DUMP_REG(NV_HEAD_STATE2(1));
531  DUMP_REG(NV_HEAD_STATE3(0));
532  DUMP_REG(NV_HEAD_STATE3(1));
533  DUMP_REG(NV_HEAD_STATE4(0));
534  DUMP_REG(NV_HEAD_STATE4(1));
535  DUMP_REG(NV_HEAD_STATE5(0));
536  DUMP_REG(NV_HEAD_STATE5(1));
537  DUMP_REG(NV_SOR_CRC_CNTRL);
538  DUMP_REG(NV_SOR_CLK_CNTRL);
539  DUMP_REG(NV_SOR_CAP);
540  DUMP_REG(NV_SOR_PWR);
541  DUMP_REG(NV_SOR_TEST);
542  DUMP_REG(NV_SOR_PLL0);
543  DUMP_REG(NV_SOR_PLL1);
544  DUMP_REG(NV_SOR_PLL2);
545  DUMP_REG(NV_SOR_PLL3);
546  DUMP_REG(NV_SOR_CSTM);
547  DUMP_REG(NV_SOR_LVDS);
548  DUMP_REG(NV_SOR_CRCA);
549  DUMP_REG(NV_SOR_CRCB);
550  DUMP_REG(NV_SOR_SEQ_CTL);
551  DUMP_REG(NV_SOR_LANE_SEQ_CTL);
552  DUMP_REG(NV_SOR_SEQ_INST(0));
553  DUMP_REG(NV_SOR_SEQ_INST(1));
554  DUMP_REG(NV_SOR_SEQ_INST(2));
555  DUMP_REG(NV_SOR_SEQ_INST(3));
556  DUMP_REG(NV_SOR_SEQ_INST(4));
557  DUMP_REG(NV_SOR_SEQ_INST(5));
558  DUMP_REG(NV_SOR_SEQ_INST(6));
559  DUMP_REG(NV_SOR_SEQ_INST(7));
560  DUMP_REG(NV_SOR_SEQ_INST(8));
561  DUMP_REG(NV_SOR_PWM_DIV);
562  DUMP_REG(NV_SOR_PWM_CTL);
563  DUMP_REG(NV_SOR_MSCHECK);
564  DUMP_REG(NV_SOR_XBAR_CTRL);
565  DUMP_REG(NV_SOR_DP_LINKCTL(0));
566  DUMP_REG(NV_SOR_DP_LINKCTL(1));
567  DUMP_REG(NV_SOR_DC(0));
568  DUMP_REG(NV_SOR_DC(1));
569  DUMP_REG(NV_SOR_LANE_DRIVE_CURRENT(0));
570  DUMP_REG(NV_SOR_PR(0));
571  DUMP_REG(NV_SOR_LANE4_PREEMPHASIS(0));
572  DUMP_REG(NV_SOR_POSTCURSOR(0));
573  DUMP_REG(NV_SOR_DP_CONFIG(0));
574  DUMP_REG(NV_SOR_DP_CONFIG(1));
575  DUMP_REG(NV_SOR_DP_MN(0));
576  DUMP_REG(NV_SOR_DP_MN(1));
577  DUMP_REG(NV_SOR_DP_PADCTL(0));
578  DUMP_REG(NV_SOR_DP_PADCTL(1));
579  DUMP_REG(NV_SOR_DP_DEBUG(0));
580  DUMP_REG(NV_SOR_DP_DEBUG(1));
581  DUMP_REG(NV_SOR_DP_SPARE(0));
582  DUMP_REG(NV_SOR_DP_SPARE(1));
583  DUMP_REG(NV_SOR_DP_TPG);
584 }
585 #endif
586 
588  int is_lvds)
589 {
590  const struct tegra_dc *dc = sor->dc;
591  const struct tegra_dc_dp_data *dp = dc->out;
592  const struct tegra_dc_dp_link_config *link_cfg = &dp->link_cfg;
593  const struct soc_nvidia_tegra124_config *config = dc->config;
594 
595  const int head_num = 0; // based on kernel dc driver
596  u32 reg_val = NV_SOR_STATE1_ASY_OWNER_HEAD0 << head_num;
597  u32 vtotal, htotal;
598  u32 vsync_end, hsync_end;
599  u32 vblank_end, hblank_end;
600  u32 vblank_start, hblank_start;
601 
602  reg_val |= is_lvds ? NV_SOR_STATE1_ASY_PROTOCOL_LVDS_CUSTOM :
606 
609  reg_val |= (link_cfg->bits_per_pixel > 18) ?
612 
613  tegra_sor_writel(sor, NV_SOR_STATE1, reg_val);
614 
615  /* Skipping programming NV_HEAD_STATE0, assuming:
616  interlacing: PROGRESSIVE, dynamic range: VESA, colorspace: RGB */
617 
618  vtotal = config->vsync_width + config->vback_porch +
619  config->yres + config->vfront_porch;
620  htotal = config->hsync_width + config->hback_porch +
621  config->xres + config->hfront_porch;
622 
623  tegra_sor_writel(sor, NV_HEAD_STATE1(head_num),
626 
627  vsync_end = config->vsync_width - 1;
628  hsync_end = config->hsync_width - 1;
629  tegra_sor_writel(sor, NV_HEAD_STATE2(head_num),
630  vsync_end << NV_HEAD_STATE2_VSYNC_END_SHIFT |
632 
633  vblank_end = vsync_end + config->vback_porch;
634  hblank_end = hsync_end + config->hback_porch;
635  tegra_sor_writel(sor, NV_HEAD_STATE3(head_num),
636  vblank_end << NV_HEAD_STATE3_VBLANK_END_SHIFT |
637  hblank_end << NV_HEAD_STATE3_HBLANK_END_SHIFT);
638 
639  vblank_start = vblank_end + config->yres;
640  hblank_start = hblank_end + config->xres;
641  tegra_sor_writel(sor, NV_HEAD_STATE4(head_num),
642  vblank_start << NV_HEAD_STATE4_VBLANK_START_SHIFT |
643  hblank_start << NV_HEAD_STATE4_HBLANK_START_SHIFT);
644 
645  /* TODO: adding interlace mode support */
646  tegra_sor_writel(sor, NV_HEAD_STATE5(head_num), 0x1);
647 
652  (is_lvds ? NV_SOR_CSTM_LVDS_EN_ENABLE :
654  tegra_dc_sor_config_pwm(sor, 1024, 1024);
655 }
656 
658 {
659  struct tegra_dc *dc = sor->dc;
660  struct display_controller *disp_ctrl = (void *)dc->base;
661 
662  u32 reg_val = READL(&disp_ctrl->cmd.state_access);
663 
664  WRITEL(reg_val | WRITE_MUX_ACTIVE, &disp_ctrl->cmd.state_access);
665  WRITEL(VSYNC_H_POSITION(1), &disp_ctrl->disp.disp_timing_opt);
666 
667  /* Enable DC now - otherwise pure text console may not show. */
669  WRITEL(reg_val, &disp_ctrl->cmd.state_access);
670 }
671 
673 {
674  const struct tegra_dc_dp_link_config *link_cfg = sor->link_cfg;
675 
679 
683  udelay(25);
684 
689  0xf << NV_SOR_PLL0_ICHPMP_SHFIT |
690  0x3 << NV_SOR_PLL0_VCOCAP_SHIFT |
702 
706  100, TEGRA_SOR_TIMEOUT_MS * 1000)) {
707  printk(BIOS_ERR, "DP failed to lock PLL\n");
708  return;
709  }
710 
715 
716  tegra_dc_sor_power_up(sor, 0);
717 
718  /* re-enable SOR clock */
719  tegra_sor_enable_edp_clock(sor); // select pll_dp as clock source
720 
721  /* Power up lanes */
722  tegra_dc_sor_power_dplanes(sor, link_cfg->lane_count, 1);
723 
724  tegra_dc_sor_set_dp_mode(sor, link_cfg);
725 
726 }
727 
729 {
730  u32 reg_val;
731  struct display_controller *disp_ctrl = (void *)sor->dc->base;
732 
735 
736  WRITEL(0x9f00, &disp_ctrl->cmd.state_ctrl);
737  WRITEL(0x9f, &disp_ctrl->cmd.state_ctrl);
738 
741  &disp_ctrl->cmd.disp_pow_ctrl);
742 
743  reg_val = tegra_sor_readl(sor, NV_SOR_TEST);
744  if (reg_val & NV_SOR_TEST_ATTACHED_TRUE)
745  return;
746 
749 
750  /*
751  * Enable display2sor clock at least 2 cycles before DC start,
752  * to clear sor internal valid signal.
753  */
754  WRITEL(SOR_ENABLE, &disp_ctrl->disp.disp_win_opt);
755  WRITEL(GENERAL_ACT_REQ, &disp_ctrl->cmd.state_ctrl);
756  WRITEL(0, &disp_ctrl->disp.disp_win_opt);
757  WRITEL(GENERAL_ACT_REQ, &disp_ctrl->cmd.state_ctrl);
758 
759  /* Attach head */
760  tegra_dc_sor_update(sor);
768 
769  /* Enable dc */
770  reg_val = READL(&disp_ctrl->cmd.state_access);
771  WRITEL(reg_val | WRITE_MUX_ACTIVE, &disp_ctrl->cmd.state_access);
773  WRITEL(SOR_ENABLE, &disp_ctrl->disp.disp_win_opt);
774  WRITEL(reg_val, &disp_ctrl->cmd.state_access);
775 
779  100, TEGRA_SOR_ATTACH_TIMEOUT_MS * 1000))
780  printk(BIOS_ERR, "dc timeout waiting for OPMOD = AWAKE\n");
781  else
782  printk(BIOS_INFO, "%s: sor is attached\n", __func__);
783 
784 #if DEBUG_SOR
785  dump_sor_reg(sor);
786 #endif
787 }
788 
790  const struct tegra_dc_dp_link_config *link_cfg)
791 {
793  link_cfg->drive_current);
795  link_cfg->preemphasis);
797  link_cfg->postcursor);
798  tegra_sor_writel(sor, NV_SOR_LVDS, 0);
799 
801  tegra_dc_sor_set_lane_count(sor, link_cfg->lane_count);
802 
808 
809  /* Precharge */
811  0xf0, 0xf0);
812  udelay(20);
813 
815  0xf0, 0x0);
816 }
817 
819 {
820  u32 drive_current = 0;
821  u32 pre_emphasis = 0;
822 
823  /* Set to a known-good pre-calibrated setting */
824  switch (sor->link_cfg->link_bw) {
826  case SOR_LINK_SPEED_G2_7:
827  drive_current = 0x13131313;
828  pre_emphasis = 0;
829  break;
830  case SOR_LINK_SPEED_G5_4:
831  printk(BIOS_WARNING, "T124 does not support 5.4G link clock.\n");
832  return;
833  default:
834  printk(BIOS_WARNING, "Invalid sor link bandwidth: %d\n",
835  sor->link_cfg->link_bw);
836  return;
837  }
838 
840  drive_current);
841  tegra_sor_writel(sor, NV_SOR_PR(sor->portnum), pre_emphasis);
842 }
843 
845 {
846  u32 pad_ctrl = 0;
847  int err = 0;
848 
849  switch (sor->link_cfg->lane_count) {
850  case 4:
851  pad_ctrl = (NV_SOR_DP_PADCTL_PD_TXD_0_NO |
855  break;
856  case 2:
857  pad_ctrl = (NV_SOR_DP_PADCTL_PD_TXD_0_NO |
861  break;
862  case 1:
863  pad_ctrl = (NV_SOR_DP_PADCTL_PD_TXD_0_NO |
867  break;
868  default:
869  printk(BIOS_ERR, "Invalid sor lane count: %u\n",
870  sor->link_cfg->lane_count);
871  return;
872  }
873 
875  tegra_sor_writel(sor, NV_SOR_DP_PADCTL(sor->portnum), pad_ctrl);
876 
877  err = tegra_dc_sor_enable_lane_sequencer(sor, 0, 0);
878  if (err) {
880  "Wait for lane power down failed: %d\n", err);
881  return;
882  }
883 }
884 
886 {
887  const struct tegra_dc_dp_link_config *cfg = sor->link_cfg;
888  u32 val = 0;
889 
890  switch (cfg->lane_count) {
891  case 4:
895  case 2:
898  case 1:
900  break;
901  default:
903  "dp: invalid lane number %d\n", cfg->lane_count);
904  return;
905  }
906 
910  udelay(100);
913 }
static u32 addr
Definition: cirrus.c:14
#define printk(level,...)
Definition: stdlib.h:16
#define __fallthrough
Definition: compiler.h:39
#define PW2_ENABLE
Definition: dc.h:362
#define PW4_ENABLE
Definition: dc.h:364
#define PW1_ENABLE
Definition: dc.h:361
#define PW3_ENABLE
Definition: dc.h:363
#define GENERAL_ACT_REQ
Definition: dc.h:377
#define PM0_ENABLE
Definition: dc.h:365
#define DISP_CTRL_MODE_C_DISPLAY
Definition: dc.h:354
#define PM1_ENABLE
Definition: dc.h:366
unsigned long READL(void *p)
Definition: display.c:24
#define PW0_ENABLE
Definition: dc.h:360
#define VSYNC_H_POSITION(x)
Definition: dc.h:408
#define SOR_ENABLE
Definition: dc.h:402
void WRITEL(unsigned long value, void *p)
Definition: display.c:41
#define EFAULT
Definition: errno.h:19
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
Definition: loglevel.h:72
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
Definition: loglevel.h:86
enum board_config config
Definition: memory.c:448
static const int mask[4]
Definition: gpio.c:308
void sor_clock_start(void)
Definition: clock.c:195
#define vtotal(mode)
Definition: display.h:19
#define htotal(mode)
Definition: display.h:15
#define hsync_end(mode)
Definition: display.h:12
uint32_t u32
Definition: stdint.h:51
uint8_t u8
Definition: stdint.h:45
u32 disp_cmd
Definition: dc.h:49
u32 state_ctrl
Definition: dc.h:69
u32 state_access
Definition: dc.h:68
u32 disp_pow_ctrl
Definition: dc.h:55
u32 disp_timing_opt
Definition: dc.h:182
u32 disp_win_opt
Definition: dc.h:180
struct dc_cmd_reg cmd
Definition: dc.h:332
struct dc_disp_reg disp
Definition: dc.h:338
struct tegra_dc * dc
Definition: displayport.h:321
struct tegra_dc_dp_link_config link_cfg
Definition: displayport.h:324
void * base
Definition: sor.h:881
struct tegra_dc * dc
Definition: sor.h:880
struct tegra_dc_dp_link_config * link_cfg
Definition: sor.h:884
int power_is_up
Definition: sor.h:885
void * pmc_base
Definition: sor.h:882
Definition: dc.h:475
void * base
Definition: dc.h:478
void * config
Definition: dc.h:476
void * out
Definition: dc.h:477
u8 val
Definition: sys.c:300
#define NV_SOR_PLL2
Definition: sor.h:256
#define NV_SOR_POSTCURSOR(i)
Definition: sor.h:646
#define NV_SOR_DP_AUDIO_VBLANK_SYMBOLS_MASK
Definition: sor.h:742
#define NV_SOR_DP_AUDIO_VBLANK_SYMBOLS
Definition: sor.h:741
#define NV_SOR_LANE_SEQ_CTL_SETTING_MASK
Definition: sor.h:404
#define NV_SOR_LANE_DRIVE_CURRENT(i)
Definition: sor.h:595
#define NV_SOR_DP_MN(i)
Definition: sor.h:666
#define NV_SOR_PWR_SETTING_NEW_DONE
Definition: sor.h:148
#define NV_SOR_PWM_CTL_SETTING_NEW_TRIGGER
Definition: sor.h:511
#define NV_SOR_CAP
Definition: sor.h:136
#define NV_SOR_PWR_SETTING_NEW_DEFAULT_MASK
Definition: sor.h:147
#define NV_SOR_PLL2_AUX8_SEQ_PLLCAPPD_ENFORCE_MASK
Definition: sor.h:277
#define NV_SOR_PWM_CTL_DUTY_CYCLE_MASK
Definition: sor.h:516
#define NV_SOR_PLL1_TMDS_TERM_ENABLE
Definition: sor.h:251
#define NV_SOR_DP_CONFIG_ACTIVESYM_CNTL_ENABLE
Definition: sor.h:656
#define NV_HEAD_STATE1(i)
Definition: sor.h:97
#define NV_SOR_DP_CONFIG(i)
Definition: sor.h:647
#define NV_SOR_CLK_CNTRL_DP_LINK_SPEED_MASK
Definition: sor.h:132
#define NV_SOR_DP_PADCTL_PD_TXD_1_YES
Definition: sor.h:718
#define NV_SOR_TEST_ACT_HEAD_OPMODE_AWAKE
Definition: sor.h:215
#define NV_SOR_CLK_CNTRL_DP_LINK_SPEED_G1_62
Definition: sor.h:133
#define NV_HEAD_STATE1_HTOTAL_SHIFT
Definition: sor.h:100
#define NV_SOR_STATE1_ASY_CRCMODE_COMPLETE_RASTER
Definition: sor.h:66
#define NV_SOR_PWR_SETTING_NEW_TRIGGER
Definition: sor.h:150
#define NV_SOR_DP_LINKCTL(i)
Definition: sor.h:522
#define NV_SOR_DP_LINKCTL_ENHANCEDFRAME_ENABLE
Definition: sor.h:537
#define NV_SOR_LANE_SEQ_CTL_SEQUENCE_DOWN
Definition: sor.h:413
#define NV_SOR_TEST
Definition: sor.h:175
#define NV_SOR_CLK_CNTRL_DP_CLK_SEL_SINGLE_DPCLK
Definition: sor.h:129
#define NV_SOR_PLL0_VCOPD_ASSERT
Definition: sor.h:244
#define NV_SOR_PLL2_AUX1_SEQ_MASK
Definition: sor.h:261
#define NV_HEAD_STATE4_VBLANK_START_SHIFT
Definition: sor.h:113
#define NV_SOR_PLL2_AUX6_BANDGAP_POWERDOWN_ENABLE
Definition: sor.h:271
#define NV_SOR_DP_CONFIG_ACTIVESYM_POLARITY_POSITIVE
Definition: sor.h:659
#define NV_SOR_STATE1_ASY_SUBOWNER_NONE
Definition: sor.h:70
#define NV_SOR_DP_PADCTL(i)
Definition: sor.h:676
#define NV_SOR_PLL0_VCOPD_MASK
Definition: sor.h:242
#define NV_SOR_PLL2_AUX2_OVERRIDE_POWERDOWN
Definition: sor.h:266
#define NV_SOR_DP_TPG
Definition: sor.h:746
#define NV_SOR_LANE_SEQ_CTL_SETTING_NEW_TRIGGER
Definition: sor.h:407
#define NV_SOR_PWM_CTL
Definition: sor.h:507
#define NV_SOR_DP_LINKCTL_TUSIZE_SHIFT
Definition: sor.h:541
#define NV_SOR_DP_LINKCTL_LANECOUNT_TWO
Definition: sor.h:533
#define NV_SOR_DP_SPARE_SOR_CLK_SEL_MACRO_SORCLK
Definition: sor.h:730
#define NV_SOR_PWM_CTL_SETTING_NEW_DONE
Definition: sor.h:509
#define NV_SOR_STATE1
Definition: sor.h:28
#define NV_SOR_XBAR_CTRL
Definition: sor.h:521
#define NV_SOR_PLL1_TERM_COMPOUT_HIGH
Definition: sor.h:255
#define NV_SOR_PLL1
Definition: sor.h:252
#define NV_SOR_PR(i)
Definition: sor.h:596
#define NV_SOR_PLL2_AUX6_BANDGAP_POWERDOWN_MASK
Definition: sor.h:269
#define NV_SOR_LANE_SEQ_CTL_NEW_POWER_STATE_PD
Definition: sor.h:416
#define NV_SOR_DP_PADCTL_PD_TXD_0_NO
Definition: sor.h:716
#define NV_SOR_DP_CONFIG_RD_RESET_VAL_NEGATIVE
Definition: sor.h:650
#define NV_HEAD_STATE0(i)
Definition: sor.h:79
#define NV_SOR_CSTM
Definition: sor.h:288
#define NV_SOR_DP_PADCTL_TX_PU_MASK
Definition: sor.h:688
#define NV_SOR_SUPER_STATE1_ATTACHED_NO
Definition: sor.h:15
#define NV_SOR_SEQ_INST(i)
Definition: sor.h:449
#define NV_HEAD_STATE3_HBLANK_END_SHIFT
Definition: sor.h:110
#define NV_SOR_STATE1_ASY_OWNER_HEAD0
Definition: sor.h:77
#define NV_SOR_DP_CONFIG_ACTIVESYM_COUNT_MASK
Definition: sor.h:663
#define NV_SOR_DP_PADCTL_PAD_CAL_PD_POWERUP
Definition: sor.h:683
#define NV_SOR_PLL2_AUX9_LVDSEN_OVERRIDE
Definition: sor.h:282
#define NV_SOR_DP_PADCTL_PAD_CAL_PD_POWERDOWN
Definition: sor.h:684
#define NV_SOR_PWR
Definition: sor.h:145
#define NV_SOR_LANE_SEQ_CTL
Definition: sor.h:402
#define NV_SOR_LANE4_PREEMPHASIS(i)
Definition: sor.h:645
#define NV_SOR_DP_PADCTL_PD_TXD_1_NO
Definition: sor.h:719
#define NV_SOR_LANE_SEQ_CTL_NEW_POWER_STATE_PU
Definition: sor.h:415
#define NV_SOR_STATE1_ASY_VSYNCPOL_NEGATIVE_TRUE
Definition: sor.h:52
#define NV_SOR_DP_PADCTL_TX_PU_DISABLE
Definition: sor.h:686
#define NV_HEAD_STATE2(i)
Definition: sor.h:102
#define NV_HEAD_STATE2_HSYNC_END_SHIFT
Definition: sor.h:105
#define NV_HEAD_STATE4(i)
Definition: sor.h:112
#define NV_HEAD_STATE1_VTOTAL_SHIFT
Definition: sor.h:98
#define NV_SOR_PLL2_AUX7_PORT_POWERDOWN_ENABLE
Definition: sor.h:275
#define NV_SOR_PLL0_PWR_OFF
Definition: sor.h:248
#define NV_SOR_STATE1_ASY_PROTOCOL_LVDS_CUSTOM
Definition: sor.h:59
#define NV_HEAD_STATE4_HBLANK_START_SHIFT
Definition: sor.h:115
#define NV_SOR_PWR_NORMAL_STATE_PD
Definition: sor.h:173
#define NV_SOR_SUPER_STATE1_ASY_ORMODE_NORMAL
Definition: sor.h:19
#define NV_SOR_CSTM_ROTCLK_SHIFT
Definition: sor.h:291
#define NV_SOR_PLL0_VCOCAP_SHIFT
Definition: sor.h:225
#define NV_SOR_DP_PADCTL_PD_TXD_2_NO
Definition: sor.h:722
#define NV_SOR_PLL2_AUX7_PORT_POWERDOWN_DISABLE
Definition: sor.h:274
#define NV_SOR_CRCA
Definition: sor.h:377
#define NV_SOR_DP_DEBUG(i)
Definition: sor.h:723
#define NV_SOR_PWM_DIV
Definition: sor.h:505
#define NV_SOR_DP_LINKCTL_TUSIZE_MASK
Definition: sor.h:542
#define NV_SOR_PLL2_AUX8_SEQ_PLLCAPPD_ENFORCE_DISABLE
Definition: sor.h:278
#define NV_SOR_DP_LINKCTL_LANECOUNT_ZERO
Definition: sor.h:531
#define NV_SOR_PLL0
Definition: sor.h:222
#define NV_SOR_STATE0
Definition: sor.h:25
#define NV_SOR_SUPER_STATE1
Definition: sor.h:13
#define NV_SOR_DP_PADCTL_TX_PU_VALUE_DEFAULT_MASK
Definition: sor.h:698
#define NV_SOR_CSTM_LVDS_EN_ENABLE
Definition: sor.h:295
#define NV_SOR_PLL0_VCOPD_RESCIND
Definition: sor.h:243
#define TEGRA_SOR_TIMEOUT_MS
Definition: sor.h:888
#define NV_SOR_DP_SPARE_PANEL_INTERNAL
Definition: sor.h:733
#define TEGRA_SOR_ATTACH_TIMEOUT_MS
Definition: sor.h:889
#define NV_SOR_DP_CONFIG_ACTIVESYM_FRAC_SHIFT
Definition: sor.h:660
#define NV_SOR_PLL2_AUX2_MASK
Definition: sor.h:265
#define NV_SOR_CSTM_LVDS_EN_DISABLE
Definition: sor.h:294
#define NV_SOR_DP_AUDIO_HBLANK_SYMBOLS_MASK
Definition: sor.h:739
#define NV_SOR_SEQ_CTL
Definition: sor.h:383
@ training_pattern_2
Definition: sor.h:825
@ training_pattern_1
Definition: sor.h:824
@ training_pattern_none
Definition: sor.h:827
@ training_pattern_3
Definition: sor.h:826
#define NV_SOR_DP_CONFIG_ACTIVESYM_FRAC_MASK
Definition: sor.h:661
#define NV_SOR_PLL3_PLLVDD_MODE_V3_3
Definition: sor.h:287
#define NV_SOR_CRCB
Definition: sor.h:381
#define NV_SOR_SUPER_STATE0
Definition: sor.h:10
#define NV_SOR_CRC_CNTRL
Definition: sor.h:118
#define SOR_LINK_SPEED_G1_62
Definition: sor.h:835
#define NV_SOR_PWR_NORMAL_STATE_PU
Definition: sor.h:174
#define SOR_LINK_SPEED_G5_4
Definition: sor.h:837
#define NV_SOR_PLL2_AUX1_SEQ_PLLCAPPD_OVERRIDE
Definition: sor.h:263
#define NV_SOR_PLL3_PLLVDD_MODE_MASK
Definition: sor.h:285
#define NV_HEAD_STATE2_VSYNC_END_SHIFT
Definition: sor.h:103
#define NV_SOR_PLL2_AUX6_BANDGAP_POWERDOWN_DISABLE
Definition: sor.h:270
#define NV_SOR_DP_LINKCTL_LANECOUNT_FOUR
Definition: sor.h:534
#define NV_SOR_PLL2_AUX8_SEQ_PLLCAPPD_ENFORCE_ENABLE
Definition: sor.h:279
#define NV_SOR_DP_PADCTL_PD_TXD_3_NO
Definition: sor.h:713
#define NV_SOR_DP_SPARE(i)
Definition: sor.h:724
#define NV_SOR_STATE1_ASY_PIXELDEPTH_BPP_18_444
Definition: sor.h:32
#define NV_SOR_DP_AUDIO_HBLANK_SYMBOLS
Definition: sor.h:738
#define NV_SOR_LVDS
Definition: sor.h:302
#define NV_SOR_DP_LINKCTL_LANECOUNT_MASK
Definition: sor.h:530
#define NV_SOR_SUPER_STATE1_ATTACHED_YES
Definition: sor.h:16
#define NV_SOR_TEST_ACT_HEAD_OPMODE_DEFAULT_MASK
Definition: sor.h:212
#define NV_SOR_DP_CONFIG_ACTIVESYM_COUNT_SHIFT
Definition: sor.h:662
#define NV_SOR_STATE1_ASY_PIXELDEPTH_BPP_24_444
Definition: sor.h:35
#define NV_SOR_DP_CONFIG_WATERMARK_MASK
Definition: sor.h:665
#define NV_SOR_PWM_CTL_SETTING_NEW_SHIFT
Definition: sor.h:508
#define SOR_LINK_SPEED_G2_7
Definition: sor.h:836
#define NV_SOR_DP_LINKCTL_LANECOUNT_ONE
Definition: sor.h:532
#define NV_SOR_PLL0_PLLREG_LEVEL_V45
Definition: sor.h:232
#define NV_HEAD_STATE5(i)
Definition: sor.h:117
#define NV_SOR_DP_LINKCTL_ENABLE_YES
Definition: sor.h:545
#define NV_SOR_PLL0_PWR_MASK
Definition: sor.h:246
#define NV_SOR_CSTM_ROTCLK_DEFAULT_MASK
Definition: sor.h:292
#define NV_SOR_STATE1_ASY_HSYNCPOL_NEGATIVE_TRUE
Definition: sor.h:56
#define NV_SOR_DP_PADCTL_TX_PU_ENABLE
Definition: sor.h:687
#define NV_SOR_CLK_CNTRL_DP_CLK_SEL_MASK
Definition: sor.h:126
#define NV_SOR_DP_PADCTL_PD_TXD_2_YES
Definition: sor.h:721
#define NV_SOR_CLK_CNTRL_DP_LINK_SPEED_SHIFT
Definition: sor.h:131
#define NV_SOR_DP_PADCTL_COMODE_TXD_0_DP_TXD_2_SHIFT
Definition: sor.h:708
#define NV_SOR_LANE_SEQ_CTL_SEQUENCE_UP
Definition: sor.h:412
#define NV_SOR_TEST_ATTACHED_TRUE
Definition: sor.h:210
#define NV_SOR_PLL0_ICHPMP_SHFIT
Definition: sor.h:223
#define NV_HEAD_STATE3_VBLANK_END_SHIFT
Definition: sor.h:108
#define NV_SOR_DC(i)
Definition: sor.h:546
#define NV_SOR_DP_SPARE_SEQ_ENABLE_YES
Definition: sor.h:736
#define NV_SOR_MSCHECK
Definition: sor.h:517
#define NV_SOR_PLL0_RESISTORSEL_EXT
Definition: sor.h:240
#define NV_SOR_CLK_CNTRL_DP_LINK_SPEED_LVDS
Definition: sor.h:135
#define NV_SOR_PLL0_PWR_ON
Definition: sor.h:247
#define NV_SOR_DP_PADCTL_PD_TXD_3_YES
Definition: sor.h:712
#define NV_SOR_STATE1_ASY_PROTOCOL_DP_A
Definition: sor.h:60
#define NV_SOR_LANE_SEQ_CTL_SETTING_NEW_DONE
Definition: sor.h:405
#define NV_SOR_PLL3
Definition: sor.h:283
#define NV_SOR_CLK_CNTRL
Definition: sor.h:124
#define NV_SOR_PLL2_AUX7_PORT_POWERDOWN_MASK
Definition: sor.h:273
#define NV_SOR_DP_LINKCTL_ENABLE_NO
Definition: sor.h:544
#define NV_SOR_DP_PADCTL_TX_PU_VALUE_SHIFT
Definition: sor.h:697
#define NV_SOR_SUPER_STATE1_ASY_HEAD_OP_AWAKE
Definition: sor.h:24
#define NV_SOR_LANE_SEQ_CTL_DELAY_SHIFT
Definition: sor.h:417
#define NV_HEAD_STATE3(i)
Definition: sor.h:107
void tegra_dc_sor_set_lane_count(struct tegra_dc_sor_data *sor, u8 lane_count)
Definition: sor.c:418
#define APBDEV_PMC_IO_DPD2_REQ_CODE_DEFAULT_MASK
Definition: sor.c:34
void tegra_dc_sor_attach(struct tegra_dc_sor_data *sor)
Definition: sor.c:728
#define APBDEV_PMC_IO_DPD2_REQ_LVDS_ON
Definition: sor.c:32
static void tegra_dc_sor_io_set_dpd(struct tegra_dc_sor_data *sor, int up)
Definition: sor.c:325
static void tegra_dc_sor_config_panel(struct tegra_dc_sor_data *sor, int is_lvds)
Definition: sor.c:587
static int tegra_dc_sor_power_dplanes(struct tegra_dc_sor_data *sor, u32 lane_count, int pu)
Definition: sor.c:211
static int tegra_dc_sor_enable_lane_sequencer(struct tegra_dc_sor_data *sor, int pu, int is_lvds)
Definition: sor.c:177
static u32 tegra_dc_sor_poll_register(struct tegra_dc_sor_data *sor, u32 reg, u32 mask, u32 exp_val, u32 poll_interval_us, u32 timeout_us)
Definition: sor.c:88
#define APBDEV_PMC_IO_DPD2_REQ
Definition: sor.c:29
static void tegra_dc_sor_super_update(struct tegra_dc_sor_data *sor)
Definition: sor.c:311
#define APBDEV_PMC_IO_DPD2_REQ_CODE_DPD_ON
Definition: sor.c:37
static void tegra_dc_sor_power_up(struct tegra_dc_sor_data *sor, int is_lvds)
Definition: sor.c:459
#define APBDEV_PMC_IO_DPD2_STATUS_LVDS_ON
Definition: sor.c:41
static void tegra_dc_sor_enable_dc(struct tegra_dc_sor_data *sor)
Definition: sor.c:657
static void tegra_sor_enable_edp_clock(struct tegra_dc_sor_data *sor)
Definition: sor.c:445
void tegra_dc_sor_read_link_config(struct tegra_dc_sor_data *sor, u8 *link_bw, u8 *lane_count)
Definition: sor.c:382
static u32 tegra_sor_readl(struct tegra_dc_sor_data *sor, u32 reg)
Definition: sor.c:43
void tegra_dc_sor_set_dp_linkctl(struct tegra_dc_sor_data *sor, int ena, u8 training_pattern, const struct tegra_dc_dp_link_config *link_cfg)
Definition: sor.c:141
static void tegra_sor_write_field(struct tegra_dc_sor_data *sor, u32 reg, u32 mask, u32 val)
Definition: sor.c:57
void tegra_dc_sor_set_voltage_swing(struct tegra_dc_sor_data *sor)
Definition: sor.c:818
#define APBDEV_PMC_IO_DPD2_REQ_CODE_DPD_OFF
Definition: sor.c:36
static void tegra_sor_writel(struct tegra_dc_sor_data *sor, u32 reg, u32 val)
Definition: sor.c:50
void tegra_dc_sor_set_internal_panel(struct tegra_dc_sor_data *sor, int is_int)
Definition: sor.c:367
#define APBDEV_PMC_SEL_DPD_TIM
Definition: sor.c:27
void tegra_dp_disable_tx_pu(struct tegra_dc_sor_data *sor)
Definition: sor.c:66
void tegra_dc_sor_set_link_bandwidth(struct tegra_dc_sor_data *sor, u8 link_bw)
Definition: sor.c:411
int tegra_dc_sor_set_power_state(struct tegra_dc_sor_data *sor, int pu_pd)
Definition: sor.c:113
void tegra_dc_sor_set_lane_parm(struct tegra_dc_sor_data *sor, const struct tegra_dc_dp_link_config *link_cfg)
Definition: sor.c:789
#define APBDEV_PMC_IO_DPD2_REQ_LVDS_OFF
Definition: sor.c:31
static void tegra_dc_sor_set_dp_mode(struct tegra_dc_sor_data *sor, const struct tegra_dc_dp_link_config *link_cfg)
Definition: sor.c:277
void tegra_sor_precharge_lanes(struct tegra_dc_sor_data *sor)
Definition: sor.c:885
#define APBDEV_PMC_DPD_SAMPLE_ON_ENABLE
Definition: sor.c:26
#define APBDEV_PMC_IO_DPD2_STATUS
Definition: sor.c:38
void tegra_dc_sor_enable_dp(struct tegra_dc_sor_data *sor)
Definition: sor.c:672
void tegra_dc_sor_set_panel_power(struct tegra_dc_sor_data *sor, int power_up)
Definition: sor.c:242
static void tegra_dc_sor_update(struct tegra_dc_sor_data *sor)
Definition: sor.c:318
void tegra_dc_sor_power_down_unused_lanes(struct tegra_dc_sor_data *sor)
Definition: sor.c:844
static void tegra_dc_sor_config_pwm(struct tegra_dc_sor_data *sor, u32 pwm_div, u32 pwm_dutycycle)
Definition: sor.c:260
#define APBDEV_PMC_DPD_SAMPLE
Definition: sor.c:24
void tegra_dp_set_pe_vs_pc(struct tegra_dc_sor_data *sor, u32 mask, u32 pe_reg, u32 vs_reg, u32 pc_reg, u8 pc_supported)
Definition: sor.c:74
#define APBDEV_PMC_DPD_SAMPLE_ON_DISABLE
Definition: sor.c:25
@ WRITE_MUX_ACTIVE
Definition: emc.h:50
void udelay(uint32_t us)
Definition: udelay.c:15