Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e2346e1 authored by Tatenda Chipeperekwa's avatar Tatenda Chipeperekwa
Browse files

drm/msm/dp: add support for PHY CTS 1.4 tests



Add support for PHY CTS 1.4 tests by adding the definitions for
the new test patterns, and programming the DisplayPort controller
to generate the patterns.

CRs-Fixed: 2139669
Change-Id: Ia9ec33dfc83a3db9c87af81d347ee86cdd28350a
Signed-off-by: default avatarTatenda Chipeperekwa <tatendac@codeaurora.org>
parent d94e9af7
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1017,7 +1017,7 @@ static void dp_catalog_ctrl_send_phy_pattern(struct dp_catalog_ctrl *ctrl,
		/* 1111100000111110 */
		dp_write(base + DP_TEST_80BIT_CUSTOM_PATTERN_REG2, 0x0000F83E);
		break;
	case DP_TEST_PHY_PATTERN_HBR2_CTS_EYE_PATTERN:
	case DP_TEST_PHY_PATTERN_CP2520_PATTERN_1:
		value = BIT(16);
		dp_write(base + DP_HBR2_COMPLIANCE_SCRAMBLER_RESET, value);
		value |= 0xFC;
@@ -1025,6 +1025,10 @@ static void dp_catalog_ctrl_send_phy_pattern(struct dp_catalog_ctrl *ctrl,
		dp_write(base + DP_MAINLINK_LEVELS, 0x2);
		dp_write(base + DP_STATE_CTRL, 0x10);
		break;
	case DP_TEST_PHY_PATTERN_CP2520_PATTERN_3:
		dp_write(base + DP_MAINLINK_CTRL, 0x11);
		dp_write(base + DP_STATE_CTRL, 0x8);
		break;
	default:
		pr_debug("No valid test pattern requested: 0x%x\n", pattern);
		return;
+11 −5
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#define MR_LINK_SYMBOL_ERM 0x80
#define MR_LINK_PRBS7 0x100
#define MR_LINK_CUSTOM80 0x200
#define MR_LINK_TRAINING4  0x40

struct dp_vc_tu_mapping_table {
	u32 vic;
@@ -1214,9 +1215,6 @@ static void dp_ctrl_send_phy_test_pattern(struct dp_ctrl_private *ctrl)
	u32 pattern_sent = 0x0;
	u32 pattern_requested = ctrl->link->phy_params.phy_test_pattern_sel;

	pr_debug("request: %s\n",
			dp_link_get_phy_test_pattern(pattern_requested));

	ctrl->catalog->update_vx_px(ctrl->catalog,
			ctrl->link->phy_params.v_level,
			ctrl->link->phy_params.p_level);
@@ -1224,6 +1222,9 @@ static void dp_ctrl_send_phy_test_pattern(struct dp_ctrl_private *ctrl)
	ctrl->link->send_test_response(ctrl->link);

	pattern_sent = ctrl->catalog->read_phy_pattern(ctrl->catalog);
	pr_debug("pattern_request: %s. pattern_sent: 0x%x\n",
			dp_link_get_phy_test_pattern(pattern_requested),
			pattern_sent);

	switch (pattern_sent) {
	case MR_LINK_TRAINING1:
@@ -1235,7 +1236,7 @@ static void dp_ctrl_send_phy_test_pattern(struct dp_ctrl_private *ctrl)
		if ((pattern_requested ==
				DP_TEST_PHY_PATTERN_SYMBOL_ERR_MEASUREMENT_CNT)
			|| (pattern_requested ==
				DP_TEST_PHY_PATTERN_HBR2_CTS_EYE_PATTERN))
				DP_TEST_PHY_PATTERN_CP2520_PATTERN_1))
			success = true;
		break;
	case MR_LINK_PRBS7:
@@ -1247,9 +1248,14 @@ static void dp_ctrl_send_phy_test_pattern(struct dp_ctrl_private *ctrl)
				DP_TEST_PHY_PATTERN_80_BIT_CUSTOM_PATTERN)
			success = true;
		break;
	case MR_LINK_TRAINING4:
		if (pattern_requested ==
				DP_TEST_PHY_PATTERN_CP2520_PATTERN_3)
			success = true;
		break;
	default:
		success = false;
		return;
		break;
	}

	pr_debug("%s: %s\n", success ? "success" : "failed",
+2 −1
Original line number Diff line number Diff line
@@ -680,7 +680,8 @@ static bool dp_link_is_phy_test_pattern_supported(u32 phy_test_pattern_sel)
	case DP_TEST_PHY_PATTERN_SYMBOL_ERR_MEASUREMENT_CNT:
	case DP_TEST_PHY_PATTERN_PRBS7:
	case DP_TEST_PHY_PATTERN_80_BIT_CUSTOM_PATTERN:
	case DP_TEST_PHY_PATTERN_HBR2_CTS_EYE_PATTERN:
	case DP_TEST_PHY_PATTERN_CP2520_PATTERN_1:
	case DP_TEST_PHY_PATTERN_CP2520_PATTERN_3:
		return true;
	default:
		return false;
+6 −3
Original line number Diff line number Diff line
@@ -121,9 +121,12 @@ static inline char *dp_link_get_phy_test_pattern(u32 phy_test_pattern_sel)
	case DP_TEST_PHY_PATTERN_80_BIT_CUSTOM_PATTERN:
		return DP_LINK_ENUM_STR(
			DP_TEST_PHY_PATTERN_80_BIT_CUSTOM_PATTERN);
	case DP_TEST_PHY_PATTERN_HBR2_CTS_EYE_PATTERN:
		return DP_LINK_ENUM_STR(
			DP_TEST_PHY_PATTERN_HBR2_CTS_EYE_PATTERN);
	case DP_TEST_PHY_PATTERN_CP2520_PATTERN_1:
		return DP_LINK_ENUM_STR(DP_TEST_PHY_PATTERN_CP2520_PATTERN_1);
	case DP_TEST_PHY_PATTERN_CP2520_PATTERN_2:
		return DP_LINK_ENUM_STR(DP_TEST_PHY_PATTERN_CP2520_PATTERN_2);
	case DP_TEST_PHY_PATTERN_CP2520_PATTERN_3:
		return DP_LINK_ENUM_STR(DP_TEST_PHY_PATTERN_CP2520_PATTERN_3);
	default:
		return "unknown";
	}
+3 −1
Original line number Diff line number Diff line
@@ -491,7 +491,9 @@
# define DP_TEST_PHY_PATTERN_SYMBOL_ERR_MEASUREMENT_CNT 0x2
# define DP_TEST_PHY_PATTERN_PRBS7			0x3
# define DP_TEST_PHY_PATTERN_80_BIT_CUSTOM_PATTERN	0x4
# define DP_TEST_PHY_PATTERN_HBR2_CTS_EYE_PATTERN	0x5
# define DP_TEST_PHY_PATTERN_CP2520_PATTERN_1		0x5
# define DP_TEST_PHY_PATTERN_CP2520_PATTERN_2		0x6
# define DP_TEST_PHY_PATTERN_CP2520_PATTERN_3		0x7

#define DP_TEST_RESPONSE		    0x260
# define DP_TEST_ACK			    (1 << 0)