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: 9330329 X-Patchwork-Delegate: bhelgaas@google.com 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 C99CB60231 for ; Wed, 14 Sep 2016 05:15:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5D4626490 for ; Wed, 14 Sep 2016 05:15:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A70AC27D0C; Wed, 14 Sep 2016 05:15:04 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2649F26490 for ; Wed, 14 Sep 2016 05:15:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759876AbcINFPC (ORCPT ); Wed, 14 Sep 2016 01:15:02 -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: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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);