Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp645150ybl; Wed, 14 Aug 2019 03:52:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqytfdW/5aawTS/KPOfrLw/pX8/Ld2btCvfKiMTku4b9jmqXu2i6/XwsKeaAaYKPxOv9e3Yo X-Received: by 2002:a62:ab0a:: with SMTP id p10mr14735225pff.144.1565779975993; Wed, 14 Aug 2019 03:52:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565779975; cv=none; d=google.com; s=arc-20160816; b=OqPpgfgpSu7T5rnRCTyJi4ncKTo4oiIuc1T+5H4VzsG+XztRz/t9dwXjVJXnN+IFLh nqvwW6n61x5I5Ti0GhD2rA9gCrYtj67OFgSKMlYjWm/XQrX9mc7G3N9onC4MJ3aPxHxn /YRwD5BwtWfkbmYQ08LBKgYVrFSABkObN/t6UE9Ug5PNJcVQRu1pAMLKng/6zxsdmZuc FIEi3FT2oY8ZA7/mTudHtWa7h85NIoaEaN0i58gfZ7ZtM3H7PiX3Q2mNMIaO9CHjVVYk lAddJuWZyb7BQKTVUn5K3/3EEwH1Qs7bCVT/OSCE6bgUhQ5Vu4ZpL7P4h0RCCsxcBcGB ibBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=+g/Z+yXqtvjdyBE6oFQ5h9hC9CGxmKxRvVroFQ77LvY=; b=YU+FO160VxEA7IUIJEiDMGGwge5KgOlR8e4ZMXsbwZ4hCz8a1UNyDrbh2AVTu383XM 3eQG4YkQfqlipb653Cy6yQMpc5CId4tzbCeJMFoaYTl2nlUI4gNmrxT4thWLl2Qed7UI yX3fOwOvuteA3jXlxXn9JT08av9O4JCTtDcjMB5gxIF0OwQ5fuBJln5+vuvFfK9ZIV+4 wjzd7XdO9begvwqQ7LYmb9Eu3qVpLL9h6ErNUokLvqBs2YB4pGT2Eyo33PRC2VkYtTqO zGLf2iKggE5Pxxk/Tb/hi1xnVuoEE3IX9t5qPZEeJgTcAjOX27/MS23tGUIkeyW/VSMB DtyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4si4196593plz.120.2019.08.14.03.52.39; Wed, 14 Aug 2019 03:52:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728140AbfHNKuG (ORCPT + 99 others); Wed, 14 Aug 2019 06:50:06 -0400 Received: from inva020.nxp.com ([92.121.34.13]:55062 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727750AbfHNKtC (ORCPT ); Wed, 14 Aug 2019 06:49:02 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 72C651A038F; Wed, 14 Aug 2019 12:49:00 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 65B801A0389; Wed, 14 Aug 2019 12:49:00 +0200 (CEST) Received: from fsr-ub1664-120.ea.freescale.net (fsr-ub1664-120.ea.freescale.net [10.171.82.81]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 6221A2060E; Wed, 14 Aug 2019 12:48:59 +0200 (CEST) From: Robert Chiras To: =?UTF-8?q?Guido=20G=C3=BCnther?= , Marek Vasut , Stefan Agner , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Pengutronix Kernel Team , NXP Linux Team , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 04/15] drm/mxsfb: Reset vital register for a proper initialization Date: Wed, 14 Aug 2019 13:48:40 +0300 Message-Id: <1565779731-1300-5-git-send-email-robert.chiras@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1565779731-1300-1-git-send-email-robert.chiras@nxp.com> References: <1565779731-1300-1-git-send-email-robert.chiras@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some of the regiters need, like LCDC_CTRL and CTRL2_OUTSTANDING_REQS needs to be properly cleared and initialized for a better start and stop routine. Signed-off-by: Robert Chiras --- drivers/gpu/drm/mxsfb/mxsfb_crtc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c index b69ace8..5e44f57 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c @@ -127,6 +127,10 @@ static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb) clk_prepare_enable(mxsfb->clk_disp_axi); clk_prepare_enable(mxsfb->clk); + if (mxsfb->devdata->ipversion >= 4) + writel(CTRL2_OUTSTANDING_REQS(REQ_16), + mxsfb->base + LCDC_V4_CTRL2 + REG_SET); + /* If it was disabled, re-enable the mode again */ writel(CTRL_DOTCLK_MODE, mxsfb->base + LCDC_CTRL + REG_SET); @@ -136,12 +140,19 @@ static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb) writel(reg, mxsfb->base + LCDC_VDCTRL4); writel(CTRL_RUN, mxsfb->base + LCDC_CTRL + REG_SET); + writel(CTRL1_RECOVERY_ON_UNDERFLOW, mxsfb->base + LCDC_CTRL1 + REG_SET); } static void mxsfb_disable_controller(struct mxsfb_drm_private *mxsfb) { u32 reg; + if (mxsfb->devdata->ipversion >= 4) + writel(CTRL2_OUTSTANDING_REQS(0x7), + mxsfb->base + LCDC_V4_CTRL2 + REG_CLR); + + writel(CTRL_RUN, mxsfb->base + LCDC_CTRL + REG_CLR); + /* * Even if we disable the controller here, it will still continue * until its FIFOs are running out of data @@ -295,6 +306,7 @@ void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb) dma_addr_t paddr; mxsfb_enable_axi_clk(mxsfb); + writel(0, mxsfb->base + LCDC_CTRL); mxsfb_crtc_mode_set_nofb(mxsfb); /* Write cur_buf as well to avoid an initial corrupt frame */ -- 2.7.4