From patchwork Mon Sep 22 09:51:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Edworthy X-Patchwork-Id: 4946841 Return-Path: X-Original-To: patchwork-linux-arm@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 1A482BEEA6 for ; Mon, 22 Sep 2014 09:53:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2CDD2021A for ; Mon, 22 Sep 2014 09:53:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9F5F20149 for ; Mon, 22 Sep 2014 09:53:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XW0Hu-0003x6-CO; Mon, 22 Sep 2014 09:52:06 +0000 Received: from relmlor3.renesas.com ([210.160.252.173] helo=relmlie2.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XW0Hr-0003oI-NL for linux-arm-kernel@lists.infradead.org; Mon, 22 Sep 2014 09:52:04 +0000 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 22 Sep 2014 18:51:19 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id B8C943E382; Mon, 22 Sep 2014 18:51:19 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 9AF3F480A8; Mon, 22 Sep 2014 18:51:19 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 9A4F8480A7; Mon, 22 Sep 2014 18:51:19 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id UAE32171; Mon, 22 Sep 2014 18:51:19 +0900 X-IronPort-AV: E=Sophos;i="5.04,571,1406559600"; d="scan'208";a="170703500" Received: from unknown (HELO relay51.aps.necel.com) ([10.29.19.60]) by relmlii2.idc.renesas.com with ESMTP; 22 Sep 2014 18:51:19 +0900 Received: from DU0NOTES13.ad.ree.renesas.com ([172.29.24.131]) by relay51.aps.necel.com (8.14.4+Sun/8.14.4) with ESMTP id s8M9pERl008705; Mon, 22 Sep 2014 18:51:15 +0900 (JST) Received: from duacsls.ad.ree.renesas.com ([172.29.43.47]) by DU0NOTES13.ad.ree.renesas.com (Lotus Domino Release 8.5.3 HF466) with ESMTP id 2014092211511345-120744 ; Mon, 22 Sep 2014 11:51:13 +0200 From: Phil Edworthy To: linux-pci@vger.kernel.org X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411379470-20639-1-git-send-email-phil.edworthy@renesas.com> References: <1411379470-20639-1-git-send-email-phil.edworthy@renesas.com> X-TNEFEvaluated: 1 Message-ID: <1411379470-20639-2-git-send-email-phil.edworthy@renesas.com> Date: Mon, 22 Sep 2014 10:51:08 +0100 Subject: [PATCH 1/3] PCI: rcar-pcie: Add call to get domain nr X-MIMETrack: Itemize by SMTP Server on DU0NOTES13/SERVER/REE(Release 8.5.3 HF466|March 09, 2012) at 22.09.2014 11:51:13, Serialize by Router on DU0NOTES13/SERVER/REE(Release 8.5.3 HF466|March 09, 2012) at 22.09.2014 11:51:15, Serialize complete at 22.09.2014 11:51:15 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140922_025203_857533_F595FEB3 X-CRM114-Status: GOOD ( 11.54 ) X-Spam-Score: -0.8 (/) Cc: Phil Edworthy , Arnd Bergmann , Sergei Shtylyov , linux-sh@vger.kernel.org, Liviu Dudau , Jason Gunthorpe , Valentine Barshak , Simon Horman , Bjorn Helgaas , Ben Dooks , LAKML X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 R-Car devices (r8a7790 and r8a7791) need to place the internal PCI and external PCIe controllers on separate domains so that they can work at the same time. Signed-off-by: Phil Edworthy --- drivers/pci/host/pcie-rcar.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c index 4884ee5..db74371 100644 --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c @@ -128,6 +128,7 @@ struct rcar_pcie { struct device *dev; void __iomem *base; struct resource res[RCAR_PCI_MAX_RESOURCES]; + int domain; struct resource busn; int root_bus_nr; struct clk *clk; @@ -393,13 +394,13 @@ static void rcar_pcie_enable(struct rcar_pcie *pcie) { struct platform_device *pdev = to_platform_device(pcie->dev); +#ifdef CONFIG_PCI_DOMAINS + rcar_pci.domain = pcie->domain; +#endif rcar_pci.nr_controllers = 1; rcar_pci.private_data = (void **)&pcie; pci_common_init_dev(&pdev->dev, &rcar_pci); -#ifdef CONFIG_PCI_DOMAINS - rcar_pci.domain++; -#endif } static int phy_wait_for_ack(struct rcar_pcie *pcie) @@ -917,6 +918,8 @@ static int rcar_pcie_probe(struct platform_device *pdev) pcie->dev = &pdev->dev; platform_set_drvdata(pdev, pcie); + pcie->domain = of_pci_get_domain_nr(pdev->dev.of_node, true); + /* Get the bus range */ if (of_pci_parse_bus_range(pdev->dev.of_node, &pcie->busn)) { dev_err(&pdev->dev, "failed to parse bus-range property\n");