From patchwork Mon Jan 9 09:16:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Srinivas, Vidya" X-Patchwork-Id: 9504237 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CBB1F60710 for ; Mon, 9 Jan 2017 09:08:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C06672840E for ; Mon, 9 Jan 2017 09:08:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B58FE28461; Mon, 9 Jan 2017 09:08:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 75B2D2840E for ; Mon, 9 Jan 2017 09:08:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 90C1F6E1AD; Mon, 9 Jan 2017 09:08:52 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id ABAEE6E1A9 for ; Mon, 9 Jan 2017 09:08:39 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 09 Jan 2017 01:08:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,339,1477983600"; d="scan'208";a="27920666" Received: from vsrini4-ubuntu-intel.iind.intel.com ([10.223.26.91]) by orsmga002.jf.intel.com with ESMTP; 09 Jan 2017 01:08:37 -0800 From: Vidya Srinivas To: intel-gfx@lists.freedesktop.org Date: Mon, 9 Jan 2017 14:46:12 +0530 Message-Id: <1483953372-26510-1-git-send-email-vidya.srinivas@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [Intel-gfx] [PATCH 10/14] drm/i915: Add MIPI_IO WA X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Uma Shankar Enable MIPI IO WA for BXT DSI as per bspec. Signed-off-by: Uma Shankar Tested-by: Mika Kahola --- drivers/gpu/drm/i915/i915_reg.h | 3 +++ drivers/gpu/drm/i915/intel_dsi.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 71b978a..b9d7e98 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -8301,6 +8301,9 @@ enum { #define _BXT_MIPIC_PORT_CTRL 0x6B8C0 #define BXT_MIPI_PORT_CTRL(tc) _MMIO_MIPI(tc, _BXT_MIPIA_PORT_CTRL, _BXT_MIPIC_PORT_CTRL) +#define BXT_P_CR_GT_DISP_PWRON_0_2_0_GTTMMADR _MMIO(0x138090) +#define MIPIO_RST_CTRL (1 << 2) + #define DPI_ENABLE (1 << 31) /* A + C */ #define MIPIA_MIPI4DPHY_DELAY_COUNT_SHIFT 27 #define MIPIA_MIPI4DPHY_DELAY_COUNT_MASK (0xf << 27) diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c index a4bda92..9252490 100644 --- a/drivers/gpu/drm/i915/intel_dsi.c +++ b/drivers/gpu/drm/i915/intel_dsi.c @@ -366,6 +366,11 @@ static void bxt_dsi_device_ready(struct intel_encoder *encoder) DRM_DEBUG_KMS("\n"); + /* Add MIPI IO reset programming for modeset */ + val = I915_READ(BXT_P_CR_GT_DISP_PWRON_0_2_0_GTTMMADR); + I915_WRITE(BXT_P_CR_GT_DISP_PWRON_0_2_0_GTTMMADR, + val | MIPIO_RST_CTRL); + /* Enable MIPI PHY transparent latch */ for_each_dsi_port(port, intel_dsi->ports) { val = I915_READ(BXT_MIPI_PORT_CTRL(port)); @@ -757,6 +762,10 @@ static void intel_dsi_post_disable(struct intel_encoder *encoder, drm_panel_power_off(intel_dsi->panel); msleep(intel_dsi->panel_off_delay); + val = I915_READ(BXT_P_CR_GT_DISP_PWRON_0_2_0_GTTMMADR); + I915_WRITE(BXT_P_CR_GT_DISP_PWRON_0_2_0_GTTMMADR, + val & ~MIPIO_RST_CTRL); + intel_disable_dsi_pll(encoder); /* Panel Disable over CRC PMIC */