From patchwork Tue Jun 23 21:52:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Souza, Jose" X-Patchwork-Id: 11621863 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 59F81161F for ; Tue, 23 Jun 2020 21:51:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 392FB2078E for ; Tue, 23 Jun 2020 21:51:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 392FB2078E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A2DA6EA60; Tue, 23 Jun 2020 21:51:13 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id F15E16EA5F for ; Tue, 23 Jun 2020 21:51:11 +0000 (UTC) IronPort-SDR: gHbtU3Gh8aiJm4bNDCpF6T8KdOpShHaWes9WWH87a8XgOpJ9GASl2AEe2O56WI1NDzQSmVwHju 6Ok+AZ+HKfeg== X-IronPort-AV: E=McAfee;i="6000,8403,9661"; a="123912758" X-IronPort-AV: E=Sophos;i="5.75,272,1589266800"; d="scan'208";a="123912758" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2020 14:51:11 -0700 IronPort-SDR: 7gC+0JN0rpuOh+ouTs9C23Dvw0x2xpIj0wCivw6OZlomJoNazRBNWlaJvVWx2lBtU4N4WhhoHR RvKGvIojUMgg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,272,1589266800"; d="scan'208";a="478901145" Received: from susheelh-mobl2.amr.corp.intel.com (HELO josouza-MOBL2.amr.corp.intel.com) ([10.254.9.172]) by fmsmga006.fm.intel.com with ESMTP; 23 Jun 2020 14:51:11 -0700 From: =?utf-8?q?Jos=C3=A9_Roberto_de_Souza?= To: intel-gfx@lists.freedesktop.org Date: Tue, 23 Jun 2020 14:52:34 -0700 Message-Id: <20200623215235.125665-1-jose.souza@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/2] drm/i915/display/rkl: Implement WA 14011471926 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This WA fixes failures on DP and HDMI links in PHY B. For the PHY verification step, it is always returning false as this is a temporary workaround so not bothering with minimal drawbacks in programing phy B registers everytime for non-production HW. BSpec: 49291 BSpec: 53273 Cc: Matt Roper Signed-off-by: José Roberto de Souza --- .../gpu/drm/i915/display/intel_combo_phy.c | 33 +++++++++++++++++++ drivers/gpu/drm/i915/i915_reg.h | 17 ++++++++-- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_combo_phy.c b/drivers/gpu/drm/i915/display/intel_combo_phy.c index 77b04bb3ec62..9eba6e59fff3 100644 --- a/drivers/gpu/drm/i915/display/intel_combo_phy.c +++ b/drivers/gpu/drm/i915/display/intel_combo_phy.c @@ -264,6 +264,10 @@ static bool icl_combo_phy_verify_state(struct drm_i915_private *dev_priv, if (!icl_combo_phy_enabled(dev_priv, phy)) return false; + /* WA 14011471926 */ + if (IS_RKL_REVID(dev_priv, RKL_REVID_A0, RKL_REVID_B0) && phy == PHY_B) + return false; + ret = cnl_verify_procmon_ref_values(dev_priv, phy); if (phy_is_master(dev_priv, phy)) { @@ -390,6 +394,35 @@ static void icl_combo_phys_init(struct drm_i915_private *dev_priv) val = intel_de_read(dev_priv, ICL_PORT_CL_DW5(phy)); val |= CL_POWER_DOWN_ENABLE; intel_de_write(dev_priv, ICL_PORT_CL_DW5(phy), val); + + /* WA 14011471926 */ + if (IS_RKL_REVID(dev_priv, RKL_REVID_A0, RKL_REVID_B0) && + phy == PHY_B) { + u32 grccode; + + intel_de_wait_for_register(dev_priv, + ICL_PORT_COMP_DW3(PHY_A), + FIRST_COMP_DONE, + FIRST_COMP_DONE, 1); + + val = intel_de_read(dev_priv, ICL_PORT_COMP_DW6(PHY_A)); + grccode = REG_FIELD_GET(ICL_PORT_COMP_DW6_GRCCODE_MASK, val); + + val = intel_de_read(dev_priv, ICL_PORT_COMP_DW2(phy)); + val &= ~ICL_PORT_COMP_DW2_IREF_RCAL_ORD_MASK; + val |= REG_FIELD_PREP(ICL_PORT_COMP_DW2_IREF_RCAL_ORD_MASK, grccode); + val |= ICL_PORT_COMP_DW2_IREF_RCAL_ORD_END; + intel_de_write(dev_priv, ICL_PORT_COMP_DW2(phy), val); + + val = intel_de_read(dev_priv, ICL_PORT_COMP_DW0(PHY_A)); + grccode = REG_FIELD_GET(ICL_PORT_COMP_DW0_GRCCODE_LDO_MASK, val); + + val = intel_de_read(dev_priv, ICL_PORT_COMP_DW6(phy)); + val &= ~ICL_PORT_COMP_DW6_RCOMPCODE_LD_CAP_OV_MASK; + val |= REG_FIELD_PREP(ICL_PORT_COMP_DW6_RCOMPCODE_LD_CAP_OV_MASK, grccode); + val |= ICL_PORT_COMP_DW6_RCOMPCODEOVEN_LDO_SYNC; + intel_de_write(dev_priv, ICL_PORT_COMP_DW6(phy), val); + } } } diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index f09120cac89a..dbbe20a38345 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -1907,13 +1907,18 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg) #define _ICL_PORT_COMP_DW(dw, phy) (_ICL_COMBOPHY(phy) + \ _ICL_PORT_COMP + 4 * (dw)) -#define CNL_PORT_COMP_DW0 _MMIO(0x162100) -#define ICL_PORT_COMP_DW0(phy) _MMIO(_ICL_PORT_COMP_DW(0, phy)) -#define COMP_INIT (1 << 31) +#define CNL_PORT_COMP_DW0 _MMIO(0x162100) +#define ICL_PORT_COMP_DW0(phy) _MMIO(_ICL_PORT_COMP_DW(0, phy)) +#define COMP_INIT REG_BIT(31) +#define ICL_PORT_COMP_DW0_GRCCODE_LDO_MASK REG_GENMASK(7, 0) #define CNL_PORT_COMP_DW1 _MMIO(0x162104) #define ICL_PORT_COMP_DW1(phy) _MMIO(_ICL_PORT_COMP_DW(1, phy)) +#define ICL_PORT_COMP_DW2(phy) _MMIO(_ICL_PORT_COMP_DW(2, phy)) +#define ICL_PORT_COMP_DW2_IREF_RCAL_ORD_END REG_BIT(7) +#define ICL_PORT_COMP_DW2_IREF_RCAL_ORD_MASK REG_GENMASK(6, 0) + #define CNL_PORT_COMP_DW3 _MMIO(0x16210c) #define ICL_PORT_COMP_DW3(phy) _MMIO(_ICL_PORT_COMP_DW(3, phy)) #define PROCESS_INFO_DOT_0 (0 << 26) @@ -1926,6 +1931,12 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg) #define VOLTAGE_INFO_1_05V (2 << 24) #define VOLTAGE_INFO_MASK (3 << 24) #define VOLTAGE_INFO_SHIFT 24 +#define FIRST_COMP_DONE (1 << 22) + +#define ICL_PORT_COMP_DW6(phy) _MMIO(_ICL_PORT_COMP_DW(6, phy)) +#define ICL_PORT_COMP_DW6_GRCCODE_MASK REG_GENMASK(30, 24) +#define ICL_PORT_COMP_DW6_RCOMPCODEOVEN_LDO_SYNC REG_BIT(23) +#define ICL_PORT_COMP_DW6_RCOMPCODE_LD_CAP_OV_MASK REG_GENMASK(22, 16) #define ICL_PORT_COMP_DW8(phy) _MMIO(_ICL_PORT_COMP_DW(8, phy)) #define IREFGEN (1 << 24)