From patchwork Mon Mar 25 08:34:37 2019 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: 161026 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3695948jan; Mon, 25 Mar 2019 01:36:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyf176Rmi2gdFoHW3NLvcmrSRsib1lTDBj6niSZNkAMOWHiP3PrMPA/9VnmM1pwZHwIh7Qt X-Received: by 2002:a63:1061:: with SMTP id 33mr22018959pgq.226.1553502986385; Mon, 25 Mar 2019 01:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553502986; cv=none; d=google.com; s=arc-20160816; b=xIcezEmE3KykpukhN8GHbvRd9NdThKPgYziFPjcrq2OXHV/N96ld0oiuVSNmHAfoE9 tApjmySi/8OQpKFQHGe+V/QaDLQEhDFAEBdLcXxy2t/CmusQRD+8X79YJ4USwi1d8mpe 2RmHpdk0MoEW82Vof7kqYMAeIo9WIOdwrecSygFnDkbHqyoQPugUvEqv0ZPkB/1anLgQ TRO02QN3C6BrIxJWrt2p2uu3qPaWWEBA5nPoqMtiGJngo15+9zkQMsZyXD8xLrI/L08N XWZIy/RbC0SETtAoaOHNhGhoM8H7V+MNL9UygeuuqD9Bb8D9I7WzkYZLDP7mJcMfeBNj U1pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=HfjjoKmsDgZT6jDC5T6H72l2yvWvnghjKzXKSseYIoU=; b=03bpR80xoIeSFatLRQqhvgW32Mbfvxif6RHXKLTMVorm3/pCGoK4qJwfhiaiRL/n7S RSI1LLLHXdJk8inPS64H0HmgggV21nQwNWntFiTXRB8B08yAo9mB3Z+rJsJOuRcyYY0P ZFcfyd2/shhK/RilB+qksnAZKaGCksXTENRy74R4TGDv1okosPogvDMc2eM0lu1mXIhc RzqRDEHHoVaj0Jqt+iVMBwS3/g2NN9sQwUn4pIXkM7nIAazS7KMIp/krrjnvPRC3WsSI ZNPyRNNnwmbaBFKtbgO1is5DmQUHEQ0XD9VKSfun+uQaL7Y+vJdsCUIWf53gT4ETmXuh /81Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=XjsQ7oV8; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l27si12913076pfb.258.2019.03.25.01.36.25; Mon, 25 Mar 2019 01:36:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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=@ti.com header.s=ti-com-17Q1 header.b=XjsQ7oV8; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730027AbfCYIgZ (ORCPT + 5 others); Mon, 25 Mar 2019 04:36:25 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:36502 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729965AbfCYIgY (ORCPT ); Mon, 25 Mar 2019 04:36:24 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2P8a7Ar039305; Mon, 25 Mar 2019 03:36:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1553502967; bh=HfjjoKmsDgZT6jDC5T6H72l2yvWvnghjKzXKSseYIoU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=XjsQ7oV84nlxj5E+3UG6RV3LPcIQ4gjiLmTjpNQxCvibYt8SmDEPTpPpOdI3tzVmL WMGrP24Rru6PbJGOUYtavPeHj1GdMYw/sQWopCHPs2OBso/fAaiSodBDb5Em3kHtLb NlqGAOBZ47cw+dY2TZIAHxf2Gf0W3TzhfSXUqtg8= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2P8a75f015939 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 25 Mar 2019 03:36:07 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 25 Mar 2019 03:36:07 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1713.5 via Frontend Transport; Mon, 25 Mar 2019 03:36:07 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x2P8ZsFi006534; Mon, 25 Mar 2019 03:36:03 -0500 From: Kishon Vijay Abraham I To: Gustavo Pimentel , Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , Arnd Bergmann , Murali Karicheri CC: Kishon Vijay Abraham I , Jingoo Han , Greg Kroah-Hartman , , , , , , Subject: [PATCH v2 02/26] PCI: keystone: Cleanup error_irq configuration Date: Mon, 25 Mar 2019 14:04:37 +0530 Message-ID: <20190325083501.8088-3-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190325083501.8088-1-kishon@ti.com> References: <20190325083501.8088-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org pci-keystone driver uses irq_of_parse_and_map to get irq number of error_irq. Use platform_get_irq instead and move platform_get_irq() and request_irq() of error_irq from ks_pcie_add_pcie_port to ks_pcie_probe since error_irq is common to both RC mode and EP mode. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/dwc/pci-keystone.c | 43 +++++++++-------------- 1 file changed, 17 insertions(+), 26 deletions(-) -- 2.17.1 diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c index 07f55b355d75..e50f8773e768 100644 --- a/drivers/pci/controller/dwc/pci-keystone.c +++ b/drivers/pci/controller/dwc/pci-keystone.c @@ -98,8 +98,6 @@ struct keystone_pcie { struct irq_domain *legacy_irq_domain; struct device_node *np; - int error_irq; - /* Application register space */ void __iomem *va_app_base; /* DT 1st resource */ struct resource app; @@ -743,12 +741,6 @@ static int ks_pcie_config_legacy_irq(struct keystone_pcie *ks_pcie) return ret; } -static void ks_pcie_setup_interrupts(struct keystone_pcie *ks_pcie) -{ - if (ks_pcie->error_irq > 0) - ks_pcie_enable_error_irq(ks_pcie); -} - /* * When a PCI device does not exist during config cycles, keystone host gets a * bus error instead of returning 0xffffffff. This handler always returns 0 @@ -810,7 +802,6 @@ static int __init ks_pcie_host_init(struct pcie_port *pp) ks_pcie_stop_link(pci); ks_pcie_setup_rc_app_regs(ks_pcie); - ks_pcie_setup_interrupts(ks_pcie); writew(PCI_IO_RANGE_TYPE_32 | (PCI_IO_RANGE_TYPE_32 << 8), pci->dbi_base + PCI_IO_BASE); @@ -854,23 +845,6 @@ static int __init ks_pcie_add_pcie_port(struct keystone_pcie *ks_pcie, struct device *dev = &pdev->dev; int ret; - /* - * Index 0 is the platform interrupt for error interrupt - * from RC. This is optional. - */ - ks_pcie->error_irq = irq_of_parse_and_map(ks_pcie->np, 0); - if (ks_pcie->error_irq <= 0) - dev_info(dev, "no error IRQ defined\n"); - else { - ret = request_irq(ks_pcie->error_irq, ks_pcie_err_irq_handler, - IRQF_SHARED, "pcie-error-irq", ks_pcie); - if (ret < 0) { - dev_err(dev, "failed to request error IRQ %d\n", - ks_pcie->error_irq); - return ret; - } - } - pp->ops = &ks_pcie_host_ops; ret = ks_pcie_dw_host_init(ks_pcie); if (ret) { @@ -946,6 +920,7 @@ static int __init ks_pcie_probe(struct platform_device *pdev) u32 num_lanes; char name[10]; int ret; + int irq; int i; ks_pcie = devm_kzalloc(dev, sizeof(*ks_pcie), GFP_KERNEL); @@ -965,6 +940,20 @@ static int __init ks_pcie_probe(struct platform_device *pdev) return ret; } + irq = platform_get_irq(pdev, 0); + if (irq < 0) { + dev_err(dev, "missing IRQ resource: %d\n", irq); + return irq; + } + + ret = request_irq(irq, ks_pcie_err_irq_handler, IRQF_SHARED, + "ks-pcie-error-irq", ks_pcie); + if (ret < 0) { + dev_err(dev, "failed to request error IRQ %d\n", + irq); + return ret; + } + ret = of_property_read_u32(np, "num-lanes", &num_lanes); if (ret) num_lanes = 1; @@ -1020,6 +1009,8 @@ static int __init ks_pcie_probe(struct platform_device *pdev) if (ret < 0) goto err_get_sync; + ks_pcie_enable_error_irq(ks_pcie); + return 0; err_get_sync: From patchwork Mon Mar 25 08:34:44 2019 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: 161034 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3696420jan; Mon, 25 Mar 2019 01:37:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6CvtmGJdX9xLaXyEvmnGEd1yx6XNVo8EC+hqIN4ij7frylmqzP6pC5f9N21zlo5ziDiUj X-Received: by 2002:a17:902:1125:: with SMTP id d34mr24474327pla.75.1553503022874; Mon, 25 Mar 2019 01:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553503022; cv=none; d=google.com; s=arc-20160816; b=b2R5RfyiWElVTxNebjiKcJ/D9MFcG9N/DuJMwyHb4qb19Azudr7JHLUMyHbH6WsZNw 1/ulhXo9rARCh3IqVXGX+Fwigv1+JNvEN4UR5IwLRtFZDPPOLiFDHv+xKF80qHtNlMBt vC97muP86ipbJzf6ORUYaz3g0MsxJ3oWng6WeToCOCax9Q9mBIk2WFunnLfI4q0xPe7z vB1BpMb3iOLnfi9T3qr2X26URbFvM2wj7XRxic8XuqJjwYWbSRHB/KAQV7geMQwpHwca ZaG+TKD/bEI/920WutcJJs/shjpTJ9R6DEDqN6Kbt6DXZRo3QyCzuwD2ktAWIQfZ21E+ 7vyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7srJLFU2H5APGDHmyq9l+0rZG+OkuO025oUKh/xV4Ug=; b=U8CPL995Lqm9mKwr6quk/zc2IX5B0EniVs7sNl2CK83GVb9v1nmi9WbLLxgVX80u9M oinz82MURRiE9VXAphjOjbKiJ1VvItFVCrrhOIvAREGQPOgcLOUjo+CzZCvBxXmO05oY fk6APZMUvG/u2iT5S3ll71QPH3iQAg7OfhIhINidx7TbvRAVW/zmhB5VPv16bMeHPnsC j6zqDX/6t9Q7bLeod7kk42GR4TN8edEY81s1uTCS80uGDkCR32pmX0pcBc+9VJjCUoU4 oFSFxQ+PYzhs+OuIFVxeTFxNowGLuU7sSBEnnHXI6lxw8edD17ZhxeRaIRl5hoiBACn3 GfAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=P5FDO7ix; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12si13405643pgk.202.2019.03.25.01.37.02; Mon, 25 Mar 2019 01:37:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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=@ti.com header.s=ti-com-17Q1 header.b=P5FDO7ix; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730228AbfCYIhB (ORCPT + 5 others); Mon, 25 Mar 2019 04:37:01 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:52258 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726237AbfCYIhB (ORCPT ); Mon, 25 Mar 2019 04:37:01 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2P8ab0K106388; Mon, 25 Mar 2019 03:36:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1553502997; bh=7srJLFU2H5APGDHmyq9l+0rZG+OkuO025oUKh/xV4Ug=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=P5FDO7ixK/ZidFm/LkD0EnItekQH+ko+Ag552y514XucNDawR9+E1aUwGSeCk6k0m E6RhvvvPUxp9sd2q+2kSLz5+iQYVRFmmhaiTkh2R70qjSn9fCkYuXPNQwkNEO1giH3 uJhu8KjOItFtqFu7AE880/zuUrnAS19dm/CCUb38= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2P8abtU091951 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 25 Mar 2019 03:36:37 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 25 Mar 2019 03:36:36 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1713.5 via Frontend Transport; Mon, 25 Mar 2019 03:36:36 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x2P8ZsFp006534; Mon, 25 Mar 2019 03:36:33 -0500 From: Kishon Vijay Abraham I To: Gustavo Pimentel , Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , Arnd Bergmann , Murali Karicheri CC: Kishon Vijay Abraham I , Jingoo Han , Greg Kroah-Hartman , , , , , , Subject: [PATCH v2 09/26] dt-bindings: PCI: Document "atu" reg-names Date: Mon, 25 Mar 2019 14:04:44 +0530 Message-ID: <20190325083501.8088-10-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190325083501.8088-1-kishon@ti.com> References: <20190325083501.8088-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Document "atu" reg-names required to get the register space for ATU in Synopsys designware core version >= 4.80. Signed-off-by: Kishon Vijay Abraham I --- Documentation/devicetree/bindings/pci/designware-pcie.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/Documentation/devicetree/bindings/pci/designware-pcie.txt b/Documentation/devicetree/bindings/pci/designware-pcie.txt index c124f9bc11f3..5561a1c060d0 100644 --- a/Documentation/devicetree/bindings/pci/designware-pcie.txt +++ b/Documentation/devicetree/bindings/pci/designware-pcie.txt @@ -4,8 +4,11 @@ Required properties: - compatible: "snps,dw-pcie" for RC mode; "snps,dw-pcie-ep" for EP mode; -- reg: Should contain the configuration address space. -- reg-names: Must be "config" for the PCIe configuration space. +- reg: For designware cores version < 4.80 contains the configuration + address space. For designware core version >= 4.80, contains + the configuration and ATU address space +- reg-names: Must be "config" for the PCIe configuration space and "atu" for + the ATU address space. (The old way of getting the configuration address space from "ranges" is deprecated and should be avoided.) - num-lanes: number of lanes to use