@@ -494,103 +494,58 @@ static const struct cnl_ddi_buf_trans cnl_ddi_translations_edp_1_05V[] = {
494
494
{ 0x2 , 0x7F , 0x3F , 0x00 , 0x00 }, /* 400 400 0.0 */
495
495
};
496
496
497
- struct icl_combo_phy_ddi_buf_trans {
498
- u32 dw2_swing_select ;
499
- u32 dw2_swing_scalar ;
500
- u32 dw4_scaling ;
501
- };
502
-
503
- /* Voltage Swing Programming for VccIO 0.85V for DP */
504
- static const struct icl_combo_phy_ddi_buf_trans icl_combo_phy_ddi_translations_dp_hdmi_0_85V [] = {
505
- /* Voltage mV db */
506
- { 0x2 , 0x98 , 0x0018 }, /* 400 0.0 */
507
- { 0x2 , 0x98 , 0x3015 }, /* 400 3.5 */
508
- { 0x2 , 0x98 , 0x6012 }, /* 400 6.0 */
509
- { 0x2 , 0x98 , 0x900F }, /* 400 9.5 */
510
- { 0xB , 0x70 , 0x0018 }, /* 600 0.0 */
511
- { 0xB , 0x70 , 0x3015 }, /* 600 3.5 */
512
- { 0xB , 0x70 , 0x6012 }, /* 600 6.0 */
513
- { 0x5 , 0x00 , 0x0018 }, /* 800 0.0 */
514
- { 0x5 , 0x00 , 0x3015 }, /* 800 3.5 */
515
- { 0x6 , 0x98 , 0x0018 }, /* 1200 0.0 */
516
- };
517
-
518
- /* FIXME - After table is updated in Bspec */
519
- /* Voltage Swing Programming for VccIO 0.85V for eDP */
520
- static const struct icl_combo_phy_ddi_buf_trans icl_combo_phy_ddi_translations_edp_0_85V [] = {
521
- /* Voltage mV db */
522
- { 0x0 , 0x00 , 0x00 }, /* 200 0.0 */
523
- { 0x0 , 0x00 , 0x00 }, /* 200 1.5 */
524
- { 0x0 , 0x00 , 0x00 }, /* 200 4.0 */
525
- { 0x0 , 0x00 , 0x00 }, /* 200 6.0 */
526
- { 0x0 , 0x00 , 0x00 }, /* 250 0.0 */
527
- { 0x0 , 0x00 , 0x00 }, /* 250 1.5 */
528
- { 0x0 , 0x00 , 0x00 }, /* 250 4.0 */
529
- { 0x0 , 0x00 , 0x00 }, /* 300 0.0 */
530
- { 0x0 , 0x00 , 0x00 }, /* 300 1.5 */
531
- { 0x0 , 0x00 , 0x00 }, /* 350 0.0 */
532
- };
533
-
534
- /* Voltage Swing Programming for VccIO 0.95V for DP */
535
- static const struct icl_combo_phy_ddi_buf_trans icl_combo_phy_ddi_translations_dp_hdmi_0_95V [] = {
536
- /* Voltage mV db */
537
- { 0x2 , 0x98 , 0x0018 }, /* 400 0.0 */
538
- { 0x2 , 0x98 , 0x3015 }, /* 400 3.5 */
539
- { 0x2 , 0x98 , 0x6012 }, /* 400 6.0 */
540
- { 0x2 , 0x98 , 0x900F }, /* 400 9.5 */
541
- { 0x4 , 0x98 , 0x0018 }, /* 600 0.0 */
542
- { 0x4 , 0x98 , 0x3015 }, /* 600 3.5 */
543
- { 0x4 , 0x98 , 0x6012 }, /* 600 6.0 */
544
- { 0x5 , 0x76 , 0x0018 }, /* 800 0.0 */
545
- { 0x5 , 0x76 , 0x3015 }, /* 800 3.5 */
546
- { 0x6 , 0x98 , 0x0018 }, /* 1200 0.0 */
497
+ /* icl_combo_phy_ddi_translations */
498
+ static const struct cnl_ddi_buf_trans icl_combo_phy_ddi_translations_dp_hbr2 [] = {
499
+ /* NT mV Trans mV db */
500
+ { 0xA , 0x35 , 0x3F , 0x00 , 0x00 }, /* 350 350 0.0 */
501
+ { 0xA , 0x4F , 0x37 , 0x00 , 0x08 }, /* 350 500 3.1 */
502
+ { 0xC , 0x71 , 0x2F , 0x00 , 0x10 }, /* 350 700 6.0 */
503
+ { 0x6 , 0x7F , 0x2B , 0x00 , 0x14 }, /* 350 900 8.2 */
504
+ { 0xA , 0x4C , 0x3F , 0x00 , 0x00 }, /* 500 500 0.0 */
505
+ { 0xC , 0x73 , 0x34 , 0x00 , 0x0B }, /* 500 700 2.9 */
506
+ { 0x6 , 0x7F , 0x2F , 0x00 , 0x10 }, /* 500 900 5.1 */
507
+ { 0xC , 0x6C , 0x3C , 0x00 , 0x03 }, /* 650 700 0.6 */
508
+ { 0x6 , 0x7F , 0x35 , 0x00 , 0x0A }, /* 600 900 3.5 */
509
+ { 0x6 , 0x7F , 0x3F , 0x00 , 0x00 }, /* 900 900 0.0 */
547
510
};
548
511
549
- /* FIXME - After table is updated in Bspec */
550
- /* Voltage Swing Programming for VccIO 0.95V for eDP */
551
- static const struct icl_combo_phy_ddi_buf_trans icl_combo_phy_ddi_translations_edp_0_95V [] = {
552
- /* Voltage mV db */
553
- { 0x0 , 0x00 , 0x00 }, /* 200 0.0 */
554
- { 0x0 , 0x00 , 0x00 }, /* 200 1.5 */
555
- { 0x0 , 0x00 , 0x00 }, /* 200 4.0 */
556
- { 0x0 , 0x00 , 0x00 }, /* 200 6.0 */
557
- { 0x0 , 0x00 , 0x00 }, /* 250 0.0 */
558
- { 0x0 , 0x00 , 0x00 }, /* 250 1.5 */
559
- { 0x0 , 0x00 , 0x00 }, /* 250 4.0 */
560
- { 0x0 , 0x00 , 0x00 }, /* 300 0.0 */
561
- { 0x0 , 0x00 , 0x00 }, /* 300 1.5 */
562
- { 0x0 , 0x00 , 0x00 }, /* 350 0.0 */
512
+ static const struct cnl_ddi_buf_trans icl_combo_phy_ddi_translations_edp_hbr2 [] = {
513
+ /* NT mV Trans mV db */
514
+ { 0x0 , 0x7F , 0x3F , 0x00 , 0x00 }, /* 200 200 0.0 */
515
+ { 0x8 , 0x7F , 0x38 , 0x00 , 0x07 }, /* 200 250 1.9 */
516
+ { 0x1 , 0x7F , 0x33 , 0x00 , 0x0C }, /* 200 300 3.5 */
517
+ { 0x9 , 0x7F , 0x31 , 0x00 , 0x0E }, /* 200 350 4.9 */
518
+ { 0x8 , 0x7F , 0x3F , 0x00 , 0x00 }, /* 250 250 0.0 */
519
+ { 0x1 , 0x7F , 0x38 , 0x00 , 0x07 }, /* 250 300 1.6 */
520
+ { 0x9 , 0x7F , 0x35 , 0x00 , 0x0A }, /* 250 350 2.9 */
521
+ { 0x1 , 0x7F , 0x3F , 0x00 , 0x00 }, /* 300 300 0.0 */
522
+ { 0x9 , 0x7F , 0x38 , 0x00 , 0x07 }, /* 300 350 1.3 */
523
+ { 0x9 , 0x7F , 0x3F , 0x00 , 0x00 }, /* 350 350 0.0 */
563
524
};
564
525
565
- /* Voltage Swing Programming for VccIO 1.05V for DP */
566
- static const struct icl_combo_phy_ddi_buf_trans icl_combo_phy_ddi_translations_dp_hdmi_1_05V [] = {
567
- /* Voltage mV db */
568
- { 0x2 , 0x98 , 0x0018 }, /* 400 0.0 */
569
- { 0x2 , 0x98 , 0x3015 }, /* 400 3.5 */
570
- { 0x2 , 0x98 , 0x6012 }, /* 400 6.0 */
571
- { 0x2 , 0x98 , 0x900F }, /* 400 9.5 */
572
- { 0x4 , 0x98 , 0x0018 }, /* 600 0.0 */
573
- { 0x4 , 0x98 , 0x3015 }, /* 600 3.5 */
574
- { 0x4 , 0x98 , 0x6012 }, /* 600 6.0 */
575
- { 0x5 , 0x71 , 0x0018 }, /* 800 0.0 */
576
- { 0x5 , 0x71 , 0x3015 }, /* 800 3.5 */
577
- { 0x6 , 0x98 , 0x0018 }, /* 1200 0.0 */
526
+ static const struct cnl_ddi_buf_trans icl_combo_phy_ddi_translations_edp_hbr3 [] = {
527
+ /* NT mV Trans mV db */
528
+ { 0xA , 0x35 , 0x3F , 0x00 , 0x00 }, /* 350 350 0.0 */
529
+ { 0xA , 0x4F , 0x37 , 0x00 , 0x08 }, /* 350 500 3.1 */
530
+ { 0xC , 0x71 , 0x2F , 0x00 , 0x10 }, /* 350 700 6.0 */
531
+ { 0x6 , 0x7F , 0x2B , 0x00 , 0x14 }, /* 350 900 8.2 */
532
+ { 0xA , 0x4C , 0x3F , 0x00 , 0x00 }, /* 500 500 0.0 */
533
+ { 0xC , 0x73 , 0x34 , 0x00 , 0x0B }, /* 500 700 2.9 */
534
+ { 0x6 , 0x7F , 0x2F , 0x00 , 0x10 }, /* 500 900 5.1 */
535
+ { 0xC , 0x6C , 0x3C , 0x00 , 0x03 }, /* 650 700 0.6 */
536
+ { 0x6 , 0x7F , 0x35 , 0x00 , 0x0A }, /* 600 900 3.5 */
537
+ { 0x6 , 0x7F , 0x3F , 0x00 , 0x00 }, /* 900 900 0.0 */
578
538
};
579
539
580
- /* FIXME - After table is updated in Bspec */
581
- /* Voltage Swing Programming for VccIO 1.05V for eDP */
582
- static const struct icl_combo_phy_ddi_buf_trans icl_combo_phy_ddi_translations_edp_1_05V [] = {
583
- /* Voltage mV db */
584
- { 0x0 , 0x00 , 0x00 }, /* 200 0.0 */
585
- { 0x0 , 0x00 , 0x00 }, /* 200 1.5 */
586
- { 0x0 , 0x00 , 0x00 }, /* 200 4.0 */
587
- { 0x0 , 0x00 , 0x00 }, /* 200 6.0 */
588
- { 0x0 , 0x00 , 0x00 }, /* 250 0.0 */
589
- { 0x0 , 0x00 , 0x00 }, /* 250 1.5 */
590
- { 0x0 , 0x00 , 0x00 }, /* 250 4.0 */
591
- { 0x0 , 0x00 , 0x00 }, /* 300 0.0 */
592
- { 0x0 , 0x00 , 0x00 }, /* 300 1.5 */
593
- { 0x0 , 0x00 , 0x00 }, /* 350 0.0 */
540
+ static const struct cnl_ddi_buf_trans icl_combo_phy_ddi_translations_hdmi [] = {
541
+ /* NT mV Trans mV db */
542
+ { 0xA , 0x60 , 0x3F , 0x00 , 0x00 }, /* 450 450 0.0 */
543
+ { 0xB , 0x73 , 0x36 , 0x00 , 0x09 }, /* 450 650 3.2 */
544
+ { 0x6 , 0x7F , 0x31 , 0x00 , 0x0E }, /* 450 850 5.5 */
545
+ { 0xB , 0x73 , 0x3F , 0x00 , 0x00 }, /* 650 650 0.0 ALS */
546
+ { 0x6 , 0x7F , 0x37 , 0x00 , 0x08 }, /* 650 850 2.3 */
547
+ { 0x6 , 0x7F , 0x3F , 0x00 , 0x00 }, /* 850 850 0.0 */
548
+ { 0x6 , 0x7F , 0x35 , 0x00 , 0x0A }, /* 600 850 3.0 */
594
549
};
595
550
596
551
struct icl_mg_phy_ddi_buf_trans {
@@ -871,43 +826,23 @@ cnl_get_buf_trans_edp(struct drm_i915_private *dev_priv, int *n_entries)
871
826
}
872
827
}
873
828
874
- static const struct icl_combo_phy_ddi_buf_trans *
829
+ static const struct cnl_ddi_buf_trans *
875
830
icl_get_combo_buf_trans (struct drm_i915_private * dev_priv , enum port port ,
876
- int type , int * n_entries )
831
+ int type , int rate , int * n_entries )
877
832
{
878
- u32 voltage = I915_READ (ICL_PORT_COMP_DW3 (port )) & VOLTAGE_INFO_MASK ;
879
-
880
- if (type == INTEL_OUTPUT_EDP && dev_priv -> vbt .edp .low_vswing ) {
881
- switch (voltage ) {
882
- case VOLTAGE_INFO_0_85V :
883
- * n_entries = ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_0_85V );
884
- return icl_combo_phy_ddi_translations_edp_0_85V ;
885
- case VOLTAGE_INFO_0_95V :
886
- * n_entries = ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_0_95V );
887
- return icl_combo_phy_ddi_translations_edp_0_95V ;
888
- case VOLTAGE_INFO_1_05V :
889
- * n_entries = ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_1_05V );
890
- return icl_combo_phy_ddi_translations_edp_1_05V ;
891
- default :
892
- MISSING_CASE (voltage );
893
- return NULL ;
894
- }
895
- } else {
896
- switch (voltage ) {
897
- case VOLTAGE_INFO_0_85V :
898
- * n_entries = ARRAY_SIZE (icl_combo_phy_ddi_translations_dp_hdmi_0_85V );
899
- return icl_combo_phy_ddi_translations_dp_hdmi_0_85V ;
900
- case VOLTAGE_INFO_0_95V :
901
- * n_entries = ARRAY_SIZE (icl_combo_phy_ddi_translations_dp_hdmi_0_95V );
902
- return icl_combo_phy_ddi_translations_dp_hdmi_0_95V ;
903
- case VOLTAGE_INFO_1_05V :
904
- * n_entries = ARRAY_SIZE (icl_combo_phy_ddi_translations_dp_hdmi_1_05V );
905
- return icl_combo_phy_ddi_translations_dp_hdmi_1_05V ;
906
- default :
907
- MISSING_CASE (voltage );
908
- return NULL ;
909
- }
833
+ if (type == INTEL_OUTPUT_HDMI ) {
834
+ * n_entries = ARRAY_SIZE (icl_combo_phy_ddi_translations_hdmi );
835
+ return icl_combo_phy_ddi_translations_hdmi ;
836
+ } else if (rate > 540000 && type == INTEL_OUTPUT_EDP ) {
837
+ * n_entries = ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_hbr3 );
838
+ return icl_combo_phy_ddi_translations_edp_hbr3 ;
839
+ } else if (type == INTEL_OUTPUT_EDP && dev_priv -> vbt .edp .low_vswing ) {
840
+ * n_entries = ARRAY_SIZE (icl_combo_phy_ddi_translations_edp_hbr2 );
841
+ return icl_combo_phy_ddi_translations_edp_hbr2 ;
910
842
}
843
+
844
+ * n_entries = ARRAY_SIZE (icl_combo_phy_ddi_translations_dp_hbr2 );
845
+ return icl_combo_phy_ddi_translations_dp_hbr2 ;
911
846
}
912
847
913
848
static int intel_ddi_hdmi_level (struct drm_i915_private * dev_priv , enum port port )
@@ -918,8 +853,8 @@ static int intel_ddi_hdmi_level(struct drm_i915_private *dev_priv, enum port por
918
853
919
854
if (IS_ICELAKE (dev_priv )) {
920
855
if (intel_port_is_combophy (dev_priv , port ))
921
- icl_get_combo_buf_trans (dev_priv , port ,
922
- INTEL_OUTPUT_HDMI , & n_entries );
856
+ icl_get_combo_buf_trans (dev_priv , port , INTEL_OUTPUT_HDMI ,
857
+ 0 , & n_entries );
923
858
else
924
859
n_entries = ARRAY_SIZE (icl_mg_phy_ddi_translations );
925
860
default_entry = n_entries - 1 ;
@@ -2275,13 +2210,14 @@ static void bxt_ddi_vswing_sequence(struct intel_encoder *encoder,
2275
2210
u8 intel_ddi_dp_voltage_max (struct intel_encoder * encoder )
2276
2211
{
2277
2212
struct drm_i915_private * dev_priv = to_i915 (encoder -> base .dev );
2213
+ struct intel_dp * intel_dp = enc_to_intel_dp (& encoder -> base );
2278
2214
enum port port = encoder -> port ;
2279
2215
int n_entries ;
2280
2216
2281
2217
if (IS_ICELAKE (dev_priv )) {
2282
2218
if (intel_port_is_combophy (dev_priv , port ))
2283
2219
icl_get_combo_buf_trans (dev_priv , port , encoder -> type ,
2284
- & n_entries );
2220
+ intel_dp -> link_rate , & n_entries );
2285
2221
else
2286
2222
n_entries = ARRAY_SIZE (icl_mg_phy_ddi_translations );
2287
2223
} else if (IS_CANNONLAKE (dev_priv )) {
@@ -2462,14 +2398,15 @@ static void cnl_ddi_vswing_sequence(struct intel_encoder *encoder,
2462
2398
}
2463
2399
2464
2400
static void icl_ddi_combo_vswing_program (struct drm_i915_private * dev_priv ,
2465
- u32 level , enum port port , int type )
2401
+ u32 level , enum port port , int type ,
2402
+ int rate )
2466
2403
{
2467
- const struct icl_combo_phy_ddi_buf_trans * ddi_translations = NULL ;
2404
+ const struct cnl_ddi_buf_trans * ddi_translations = NULL ;
2468
2405
u32 n_entries , val ;
2469
2406
int ln ;
2470
2407
2471
2408
ddi_translations = icl_get_combo_buf_trans (dev_priv , port , type ,
2472
- & n_entries );
2409
+ rate , & n_entries );
2473
2410
if (!ddi_translations )
2474
2411
return ;
2475
2412
@@ -2478,34 +2415,23 @@ static void icl_ddi_combo_vswing_program(struct drm_i915_private *dev_priv,
2478
2415
level = n_entries - 1 ;
2479
2416
}
2480
2417
2481
- /* Set PORT_TX_DW5 Rterm Sel to 110b. */
2418
+ /* Set PORT_TX_DW5 */
2482
2419
val = I915_READ (ICL_PORT_TX_DW5_LN0 (port ));
2483
- val &= ~RTERM_SELECT_MASK ;
2420
+ val &= ~(SCALING_MODE_SEL_MASK | RTERM_SELECT_MASK |
2421
+ TAP2_DISABLE | TAP3_DISABLE );
2422
+ val |= SCALING_MODE_SEL (0x2 );
2484
2423
val |= RTERM_SELECT (0x6 );
2485
- I915_WRITE (ICL_PORT_TX_DW5_GRP (port ), val );
2486
-
2487
- /* Program PORT_TX_DW5 */
2488
- val = I915_READ (ICL_PORT_TX_DW5_LN0 (port ));
2489
- /* Set DisableTap2 and DisableTap3 if MIPI DSI
2490
- * Clear DisableTap2 and DisableTap3 for all other Ports
2491
- */
2492
- if (type == INTEL_OUTPUT_DSI ) {
2493
- val |= TAP2_DISABLE ;
2494
- val |= TAP3_DISABLE ;
2495
- } else {
2496
- val &= ~TAP2_DISABLE ;
2497
- val &= ~TAP3_DISABLE ;
2498
- }
2424
+ val |= TAP3_DISABLE ;
2499
2425
I915_WRITE (ICL_PORT_TX_DW5_GRP (port ), val );
2500
2426
2501
2427
/* Program PORT_TX_DW2 */
2502
2428
val = I915_READ (ICL_PORT_TX_DW2_LN0 (port ));
2503
2429
val &= ~(SWING_SEL_LOWER_MASK | SWING_SEL_UPPER_MASK |
2504
2430
RCOMP_SCALAR_MASK );
2505
- val |= SWING_SEL_UPPER (ddi_translations [level ].dw2_swing_select );
2506
- val |= SWING_SEL_LOWER (ddi_translations [level ].dw2_swing_select );
2431
+ val |= SWING_SEL_UPPER (ddi_translations [level ].dw2_swing_sel );
2432
+ val |= SWING_SEL_LOWER (ddi_translations [level ].dw2_swing_sel );
2507
2433
/* Program Rcomp scalar for every table entry */
2508
- val |= RCOMP_SCALAR (ddi_translations [ level ]. dw2_swing_scalar );
2434
+ val |= RCOMP_SCALAR (0x98 );
2509
2435
I915_WRITE (ICL_PORT_TX_DW2_GRP (port ), val );
2510
2436
2511
2437
/* Program PORT_TX_DW4 */
@@ -2514,9 +2440,17 @@ static void icl_ddi_combo_vswing_program(struct drm_i915_private *dev_priv,
2514
2440
val = I915_READ (ICL_PORT_TX_DW4_LN (port , ln ));
2515
2441
val &= ~(POST_CURSOR_1_MASK | POST_CURSOR_2_MASK |
2516
2442
CURSOR_COEFF_MASK );
2517
- val |= ddi_translations [level ].dw4_scaling ;
2443
+ val |= POST_CURSOR_1 (ddi_translations [level ].dw4_post_cursor_1 );
2444
+ val |= POST_CURSOR_2 (ddi_translations [level ].dw4_post_cursor_2 );
2445
+ val |= CURSOR_COEFF (ddi_translations [level ].dw4_cursor_coeff );
2518
2446
I915_WRITE (ICL_PORT_TX_DW4_LN (port , ln ), val );
2519
2447
}
2448
+
2449
+ /* Program PORT_TX_DW7 */
2450
+ val = I915_READ (ICL_PORT_TX_DW7_LN0 (port ));
2451
+ val &= ~N_SCALAR_MASK ;
2452
+ val |= N_SCALAR (ddi_translations [level ].dw7_n_scalar );
2453
+ I915_WRITE (ICL_PORT_TX_DW7_GRP (port ), val );
2520
2454
}
2521
2455
2522
2456
static void icl_combo_phy_ddi_vswing_sequence (struct intel_encoder * encoder ,
@@ -2581,7 +2515,7 @@ static void icl_combo_phy_ddi_vswing_sequence(struct intel_encoder *encoder,
2581
2515
I915_WRITE (ICL_PORT_TX_DW5_GRP (port ), val );
2582
2516
2583
2517
/* 5. Program swing and de-emphasis */
2584
- icl_ddi_combo_vswing_program (dev_priv , level , port , type );
2518
+ icl_ddi_combo_vswing_program (dev_priv , level , port , type , rate );
2585
2519
2586
2520
/* 6. Set training enable to trigger update */
2587
2521
val = I915_READ (ICL_PORT_TX_DW5_LN0 (port ));
0 commit comments