Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kahola <mika.kahola@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH v5 13/22] drm/i915/mtl: Add voltage swing sequence for C20
Date: Thu, 16 Mar 2023 13:13:26 +0200	[thread overview]
Message-ID: <20230316111335.66915-14-mika.kahola@intel.com> (raw)
In-Reply-To: <20230316111335.66915-1-mika.kahola@intel.com>

DP1.4 and DP20 voltage swing sequence for C20 phy.

Bspec: 65449, 67636, 67610

v2: DP2.0 Tx Eq tables has been updated in BSpec.
    Update also the driver code as per BSpec 65449

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Signed-off-by: Clint Taylor <clinton.a.taylor@intel.com>
---
 .../gpu/drm/i915/display/intel_cx0_phy_regs.h |  4 ++
 .../drm/i915/display/intel_ddi_buf_trans.c    | 51 ++++++++++++++++++-
 2 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h b/drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h
index 929a8aa243c3..f8917f20a151 100644
--- a/drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h
+++ b/drivers/gpu/drm/i915/display/intel_cx0_phy_regs.h
@@ -216,6 +216,10 @@
 #define C20_MPLLA_TX_CLK_DIV_MASK       REG_GENMASK(10, 8)
 #define C20_FB_CLK_DIV4_EN              REG_BIT(13)
 
+/* C20 Phy VSwing Masks */
+#define C20_PHY_VSWING_PREEMPH_MASK	REG_GENMASK8(5, 0)
+#define C20_PHY_VSWING_PREEMPH(val)	REG_FIELD_PREP8(C20_PHY_VSWING_PREEMPH_MASK, val)
+
 #define RAWLANEAONX_DIG_TX_MPLLB_CAL_DONE_BANK(idx)	(0x303D + (idx))
 
 #endif /* __INTEL_CX0_PHY_REGS_H__ */
diff --git a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
index d5a9aa2de2fa..883084422f1f 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c
@@ -9,6 +9,7 @@
 #include "intel_de.h"
 #include "intel_display_types.h"
 #include "intel_dp.h"
+#include "intel_cx0_phy.h"
 
 /* HDMI/DVI modes ignore everything but the last 2 items. So we share
  * them for both DP and FDI transports, allowing those ports to
@@ -1059,6 +1060,46 @@ static const struct intel_ddi_buf_trans mtl_cx0_trans = {
 	.hdmi_default_entry = ARRAY_SIZE(_mtl_c10_trans_dp14) - 1,
 };
 
+/* HDMI2.0 */
+static const union intel_ddi_buf_trans_entry _mtl_c20_trans_hdmi[] = {
+	{ .snps = { 48, 0, 0 } },       /* preset 0 */
+	{ .snps = { 38, 4, 6 } },       /* preset 1 */
+	{ .snps = { 36, 4, 8 } },       /* preset 2 */
+	{ .snps = { 34, 4, 10 } },      /* preset 3 */
+	{ .snps = { 32, 4, 12 } },      /* preset 4 */
+};
+
+static const struct intel_ddi_buf_trans mtl_c20_trans_hdmi = {
+	.entries = _mtl_c20_trans_hdmi,
+	.num_entries = ARRAY_SIZE(_mtl_c20_trans_hdmi),
+	.hdmi_default_entry = 0,
+};
+
+/* DP2.0 */
+static const union intel_ddi_buf_trans_entry _mtl_c20_trans_uhbr[] = {
+	{ .snps = { 48, 0, 0 } },       /* preset 0 */
+	{ .snps = { 43, 0, 5 } },       /* preset 1 */
+	{ .snps = { 40, 0, 8 } },       /* preset 2 */
+	{ .snps = { 37, 0, 11 } },      /* preset 3 */
+	{ .snps = { 33, 0, 15 } },      /* preset 4 */
+	{ .snps = { 46, 2, 0 } },       /* preset 5 */
+	{ .snps = { 42, 2, 4 } },       /* preset 6 */
+	{ .snps = { 38, 2, 8 } },       /* preset 7 */
+	{ .snps = { 35, 2, 11 } },      /* preset 8 */
+	{ .snps = { 33, 2, 13 } },      /* preset 9 */
+	{ .snps = { 44, 4, 0 } },       /* preset 10 */
+	{ .snps = { 40, 4, 4 } },       /* preset 11 */
+	{ .snps = { 37, 4, 7 } },       /* preset 12 */
+	{ .snps = { 33, 4, 11 } },      /* preset 13 */
+	{ .snps = { 40, 8, 0 } },	/* preset 14 */
+	{ .snps = { 28, 2, 2 } },	/* preset 15 */
+};
+
+static const struct intel_ddi_buf_trans mtl_c20_trans_uhbr = {
+	.entries = _mtl_c20_trans_uhbr,
+	.num_entries = ARRAY_SIZE(_mtl_c20_trans_uhbr),
+};
+
 bool is_hobl_buf_trans(const struct intel_ddi_buf_trans *table)
 {
 	return table == &tgl_combo_phy_trans_edp_hbr2_hobl;
@@ -1635,7 +1676,15 @@ mtl_get_cx0_buf_trans(struct intel_encoder *encoder,
 		      const struct intel_crtc_state *crtc_state,
 		      int *n_entries)
 {
-	return intel_get_buf_trans(&mtl_cx0_trans, n_entries);
+	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
+	enum phy phy = intel_port_to_phy(i915, encoder->port);
+
+	if (intel_crtc_has_dp_encoder(crtc_state) && crtc_state->port_clock > 1000000)
+		return intel_get_buf_trans(&mtl_c20_trans_uhbr, n_entries);
+	else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) && !(intel_is_c10phy(i915, phy)))
+		return intel_get_buf_trans(&mtl_c20_trans_hdmi, n_entries);
+	else
+		return intel_get_buf_trans(&mtl_cx0_trans, n_entries);
 }
 
 void intel_ddi_buf_trans_init(struct intel_encoder *encoder)
-- 
2.34.1


  parent reply	other threads:[~2023-03-16 11:19 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16 11:13 [Intel-gfx] [PATCH v5 00/22] drm/i915/mtl: Add C10 and C20 phy support Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 01/22] drm/i915/mtl: Initial DDI port setup Mika Kahola
2023-03-20 18:25   ` Lucas De Marchi
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 02/22] drm/i915/mtl: Add DP rates Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 03/22] drm/i915/mtl: Create separate reg file for PICA registers Mika Kahola
2023-03-20 18:06   ` Lucas De Marchi
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 04/22] drm/i915/mtl: Add Support for C10 PHY message bus and pll programming Mika Kahola
2023-03-24 17:47   ` Gustavo Sousa
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 05/22] drm/i915/mtl: Add C10 phy programming for HDMI Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 06/22] drm/i915/mtl: Add vswing programming for C10 phys Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 07/22] drm/i915/mtl: Add support for PM DEMAND Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 08/22] drm/i915/mtl: C20 PLL programming Mika Kahola
2023-03-24 19:56   ` Gustavo Sousa
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 09/22] drm/i915/mtl: C20 HW readout Mika Kahola
2023-03-24 20:21   ` Gustavo Sousa
2023-03-27  9:25   ` Imre Deak
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 10/22] drm/i915/mtl: Dump C20 pll hw state Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 11/22] drm/i915/mtl: C20 port clock calculation Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 12/22] drm/i915/mtl: C20 HDMI state calculations Mika Kahola
2023-03-16 11:13 ` Mika Kahola [this message]
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 14/22] drm/i915/mtl: For DP2.0 10G and 20G rates use MPLLA Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 15/22] drm/i915/mtl: Enabling/disabling sequence Thunderbolt pll Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 16/22] drm/i915/mtl: Readout Thunderbolt HW state Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 17/22] drm/i915/mtl: Enable TC ports Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 18/22] drm/i915/mtl: MTL PICA hotplug detection Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 19/22] drm/i915/mtl: Define mask for DDI AUX interrupts Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 20/22] drm/i915/mtl: Power up TCSS Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 21/22] drm/i915/mtl: TypeC HPD live status query Mika Kahola
2023-03-16 11:13 ` [Intel-gfx] [PATCH v5 22/22] drm/i915/mtl: Pin assignment for TypeC Mika Kahola
2023-04-11 14:32   ` Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230316111335.66915-14-mika.kahola@intel.com \
    --to=mika.kahola@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox