From patchwork Wed Sep 14 05:12:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 76135 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1693392qgf; Tue, 13 Sep 2016 22:15:05 -0700 (PDT) X-Received: by 10.98.37.130 with SMTP id l124mr1199654pfl.60.1473830105223; Tue, 13 Sep 2016 22:15:05 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si9458253pfg.54.2016.09.13.22.15.05; Tue, 13 Sep 2016 22:15:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932517AbcINFPD (ORCPT + 7 others); Wed, 14 Sep 2016 01:15:03 -0400 Received: from arroyo.ext.ti.com ([198.47.19.12]:39442 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754272AbcINFOT (ORCPT ); Wed, 14 Sep 2016 01:14:19 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id u8E5DNRn001683; Wed, 14 Sep 2016 00:13:23 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u8E5DN24018418; Wed, 14 Sep 2016 00:13:23 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Wed, 14 Sep 2016 00:13:22 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u8E5CHvR003576; Wed, 14 Sep 2016 00:13:17 -0500 From: Kishon Vijay Abraham I To: Bjorn Helgaas , Arnd Bergmann , Jingoo Han , , , , , Pratyush Anand CC: , , , , , , Joao Pinto , Rob Herring , , Subject: [RFC PATCH 11/11] HACK: pci: controller: dra7xx: disable smart idle Date: Wed, 14 Sep 2016 10:42:07 +0530 Message-ID: <1473829927-20466-12-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1473829927-20466-1-git-send-email-kishon@ti.com> References: <1473829927-20466-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Smart idle prevents RC to access the memory space of this controller. Set the idle mode to smart idle wakeup. This should ideally be done in hwmod. Till it's figured out how to configure it in hwmod, mark this as HACK. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/pci-dra7xx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/controller/pci-dra7xx.c b/drivers/pci/controller/pci-dra7xx.c index 5b49367..31211e6 100644 --- a/drivers/pci/controller/pci-dra7xx.c +++ b/drivers/pci/controller/pci-dra7xx.c @@ -30,6 +30,14 @@ /* PCIe controller wrapper DRA7XX configuration registers */ +#define PCIECTRL_DRA7XX_CONF_SYSCONFIG 0x0010 +#define SIDLE_MASK 3 +#define SIDLE_SHIFT 2 +#define SIDLE_FORCE 0x0 +#define SIDLE_NO 0x1 +#define SIDLE_SMART 0x2 +#define SIDLE_SMART_WKUP 0x3 + #define PCIECTRL_DRA7XX_CONF_IRQSTATUS_MAIN 0x0024 #define PCIECTRL_DRA7XX_CONF_IRQENABLE_SET_MAIN 0x0028 #define ERR_SYS BIT(0) @@ -606,6 +614,10 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev) goto err_gpio; break; case DW_PCIE_EP_TYPE: + reg = dra7xx_pcie_readl(dra7xx, PCIECTRL_DRA7XX_CONF_SYSCONFIG); + reg &= ~(SIDLE_MASK << SIDLE_SHIFT); + reg |= SIDLE_SMART_WKUP << SIDLE_SHIFT; + dra7xx_pcie_writel(dra7xx, PCIECTRL_DRA7XX_CONF_SYSCONFIG, reg); dra7xx_pcie_writel(dra7xx, PCIECTRL_TI_CONF_DEVICE_TYPE, DEVICE_TYPE_EP); ret = dra7xx_add_pcie_ep(dra7xx, pdev);