From patchwork Thu Sep 29 16:31:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 77139 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp447158qgf; Thu, 29 Sep 2016 09:33:13 -0700 (PDT) X-Received: by 10.98.64.10 with SMTP id n10mr3843010pfa.96.1475166793486; Thu, 29 Sep 2016 09:33:13 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7si14929681pan.265.2016.09.29.09.33.13; Thu, 29 Sep 2016 09:33:13 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755951AbcI2QdC (ORCPT + 27 others); Thu, 29 Sep 2016 12:33:02 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:38191 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755694AbcI2Qc0 (ORCPT ); Thu, 29 Sep 2016 12:32:26 -0400 Received: by mail-wm0-f43.google.com with SMTP id w72so37615354wmf.1 for ; Thu, 29 Sep 2016 09:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=K6F+UaPhw8/oFXsqJ1u4V6fRdfXg++jN7q4wJdL6C1g=; b=tra3zXXbG2ktNSH5WvUSPRNSwMnls4HXZ2EdOTuksXy8MIjJZbvTa2/2UwVVsHPHwe bmsyyNsYQ1cFftb4B6WD8WnnAFtcAeyia9UrxqekJDeP+SAC91EV04Igso0S5ObvEXWs oTjiw0PMcGyaOGgHInLSGednJxX1k1aZ3sJrpoPp9b9NTcuVDpzeLRpnGaSqTUt3BbE3 Ehx3B/X2jQNU0kLHY+Ss8UAbLBdvnrHnQSlCBKOrRE/aYLoxkWJW4bTiriijncFNPCCd RloCKP6uKfpBdqCNvvIOPB/+YzUNmxey28wDN4VY7i11dlG5D27Tzh6/ZOXRI8kBRjY3 vIBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=K6F+UaPhw8/oFXsqJ1u4V6fRdfXg++jN7q4wJdL6C1g=; b=YN6nWo64hZ7lDW0z+2YiDNd38HVCGjRZEm1EhUcJbCVhmcXeOnUqxvixW/9qFZxgvf 4ymUvkZnenV45QgV747kXxZq+drHvVdSGHYLR6DaMVWpHNHumLwgiwEwscoFY7wzmyny HzFouMbIRtvlGZmld7b+Ax/cfhOtmp7EAoLpcduKmE+osyWer552ePkAF24NzY4mQxXN 5FU4XDr35GLBl3hAVQdLtZMrNw+Z9PCudvPfTouRvXSpL/C7PHHeA39QYv/u1H258T0Z Ps1Uobz17jlCG5YdcGJgPGgWcsaWJTtyca5OizyEgIxKdK/VjuLC/Zmcoj2kjUFTUnWV tACg== X-Gm-Message-State: AA6/9RljDQ1QAKIjkZV+UeXmw2nWWp9OpzIJmJSE/HR1CcTzzEZozDSTQbL3a4GCrwdvESry X-Received: by 10.28.236.92 with SMTP id k89mr14725978wmh.122.1475166744625; Thu, 29 Sep 2016 09:32:24 -0700 (PDT) Received: from bgdev-debian.lan (jua06-1-82-242-157-225.fbx.proxad.net. [82.242.157.225]) by smtp.gmail.com with ESMTPSA id q142sm29165898wmd.4.2016.09.29.09.32.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Sep 2016 09:32:24 -0700 (PDT) From: Bartosz Golaszewski To: Kevin Hilman , Michael Turquette , Sekhar Nori , Rob Herring , Mark Rutland , Russell King Cc: LKML , arm-soc , Bartosz Golaszewski Subject: [PATCH 6/6] ARM: da850: adjust memory settings for tilcdc Date: Thu, 29 Sep 2016 18:31:55 +0200 Message-Id: <1475166715-7857-7-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1475166715-7857-1-git-send-email-bgolaszewski@baylibre.com> References: <1475166715-7857-1-git-send-email-bgolaszewski@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Default memory settings of da850 do not meet the throughput/latency requirements of tilcdc. This results in the image displayed being incorrect and the following warning being displayed by the LCDC drm driver: tilcdc da8xx_lcdc.0: tilcdc_crtc_irq(0x00000020): FIFO underfow Reconfigure the LCDC priority to the highest. This is a workaround for the da850-lcdk board which has the LCD controller enabled in the device tree, but a long-term, system-wide fix is needed for all davinci boards. This patch has been modified for mainline linux. It comes from a downstream TI release for da850[1]. Original author: Vishwanathrao Badarkhe, Manish [1] http://arago-project.org/git/projects/linux-davinci.git?p=projects/linux-davinci.git;a=commitdiff;h=b9bd39a34cc02c3ba2fc15539a2f0bc2b68d25da;hp=6f6c795faa6366a4ebc1037a0235edba6018a991 Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/da8xx-dt.c | 43 ++++++++++++++++++++++++++++++ arch/arm/mach-davinci/include/mach/da8xx.h | 4 +++ 2 files changed, 47 insertions(+) -- 2.7.4 diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index f8ecc02..9d29670 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c @@ -44,9 +44,52 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { #ifdef CONFIG_ARCH_DAVINCI_DA850 +/* + * Adjust the default memory settings to cope with the LCDC + * + * REVISIT: This issue occurs on other davinci boards as well. Find + * a proper system-wide fix. + */ +static void da850_lcdc_adjust_memory_bandwidth(void) +{ + void __iomem *cfg_mstpri1_base; + void __iomem *cfg_mstpri2_base; + void __iomem *emifb; + u32 val; + + /* + * Default master priorities in reg 0 are all lower by default than LCD + * which is set below to 0. Hence don't need to change here. + */ + + /* set EDMA30TC0 and TC1 to lower than LCDC (4 < 0) */ + cfg_mstpri1_base = DA8XX_SYSCFG0_VIRT(DA8XX_MSTPRI1_REG); + val = __raw_readl(cfg_mstpri1_base); + val &= 0xFFFF00FF; + val |= 4 << 8; /* 0-high, 7-low priority*/ + val |= 4 << 12; /* 0-high, 7-low priority*/ + __raw_writel(val, cfg_mstpri1_base); + + /* + * Reconfigure the LCDC priority to the highest to ensure that + * the throughput/latency requirements for the LCDC are met. + */ + cfg_mstpri2_base = DA8XX_SYSCFG0_VIRT(DA8XX_MSTPRI2_REG); + + val = __raw_readl(cfg_mstpri2_base); + val &= 0x0fffffff; + __raw_writel(val, cfg_mstpri2_base); + + /* set BPRIO */ + emifb = ioremap(DA8XX_DDR_CTL_BASE, SZ_4K); + __raw_writel(0x20, emifb + DA8XX_PBBPR_REG); + iounmap(emifb); +} + static void __init da850_init_machine(void) { of_platform_default_populate(NULL, da850_auxdata_lookup, NULL); + da850_lcdc_adjust_memory_bandwidth(); } static const char *const da850_boards_compat[] __initconst = { diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index f9f9713..5549eff 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h @@ -56,6 +56,8 @@ extern unsigned int da850_max_speed; #define DA8XX_SYSCFG0_VIRT(x) (da8xx_syscfg0_base + (x)) #define DA8XX_JTAG_ID_REG 0x18 #define DA8XX_HOST1CFG_REG 0x44 +#define DA8XX_MSTPRI1_REG 0x114 +#define DA8XX_MSTPRI2_REG 0x118 #define DA8XX_CHIPSIG_REG 0x174 #define DA8XX_CFGCHIP0_REG 0x17c #define DA8XX_CFGCHIP1_REG 0x180 @@ -79,6 +81,8 @@ extern unsigned int da850_max_speed; #define DA8XX_AEMIF_CTL_BASE 0x68000000 #define DA8XX_SHARED_RAM_BASE 0x80000000 #define DA8XX_ARM_RAM_BASE 0xffff0000 +#define DA8XX_DDR_CTL_BASE 0xB0000000 +#define DA8XX_PBBPR_REG 0x00000020 void da830_init(void); void da850_init(void);