From patchwork Thu May 29 06:38:19 2014 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: 4261671 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 69E9EBF90B for ; Thu, 29 May 2014 06:42:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2AB8E202E5 for ; Thu, 29 May 2014 06:42:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5629720340 for ; Thu, 29 May 2014 06:42:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756137AbaE2Gka (ORCPT ); Thu, 29 May 2014 02:40:30 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:59846 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756066AbaE2Gk2 (ORCPT ); Thu, 29 May 2014 02:40:28 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s4T6e0UW030585; Thu, 29 May 2014 01:40:00 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4T6e0ZL021131; Thu, 29 May 2014 01:40:00 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Thu, 29 May 2014 01:40:00 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4T6cgHe022845; Thu, 29 May 2014 01:39:57 -0500 From: Kishon Vijay Abraham I To: , , , , , CC: , , , , Dan Murphy Subject: [TEMP PATCH v2 17/18] PCI: host: pcie-dra7xx: use reset framework APIs to reset PCIe Date: Thu, 29 May 2014 12:08:19 +0530 Message-ID: <1401345500-20188-18-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1401345500-20188-1-git-send-email-kishon@ti.com> References: <1401345500-20188-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-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Get reset nodes from dt and use reset framework APIs to reset PCIe. This is needed since reset is handled by the SoC. Cc: Dan Murphy Signed-off-by: Kishon Vijay Abraham I --- Documentation/devicetree/bindings/pci/ti-pci.txt | 4 ++++ drivers/pci/host/pci-dra7xx.c | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/ti-pci.txt b/Documentation/devicetree/bindings/pci/ti-pci.txt index d07d2eb..3649c2e 100644 --- a/Documentation/devicetree/bindings/pci/ti-pci.txt +++ b/Documentation/devicetree/bindings/pci/ti-pci.txt @@ -22,6 +22,8 @@ PCIe Designware Controller num-lanes, interrupt-map-mask, interrupt-map : as specified in ../designware-pcie.txt + - resets: phandle used if reset is handled be soc + - reset-names: name given to the phandle Example: axi { @@ -45,6 +47,8 @@ axi { ti,hwmods = "pcie1"; phys = <&pcie1_phy>; phy-names = "pcie-phy0"; + resets = <&prm_resets &device_reset>; + reset-names = "reset"; interrupt-map-mask = <0 0 0 7>; interrupt-map = <0 0 0 1 &pcie_intc 1>, <0 0 0 2 &pcie_intc 2>, diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c index 8fb3a2e..17f5e6a 100644 --- a/drivers/pci/host/pci-dra7xx.c +++ b/drivers/pci/host/pci-dra7xx.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "pcie-designware.h" @@ -332,6 +333,7 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; char name[10]; + struct reset_control *rstc; dra7xx = devm_kzalloc(dev, sizeof(*dra7xx), GFP_KERNEL); if (!dra7xx) @@ -355,6 +357,14 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev) if (!base) return -ENOMEM; + rstc = devm_reset_control_get(dev, "reset"); + if (IS_ERR(rstc)) + return PTR_ERR(rstc); + + ret = reset_control_deassert(rstc); + if (ret) + return ret; + phy_count = of_property_count_strings(np, "phy-names"); if (phy_count < 0) { dev_err(dev, "unable to find the strings\n");