From patchwork Fri Oct 2 10:25:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Edworthy X-Patchwork-Id: 7314671 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2C5B3BEEA4 for ; Fri, 2 Oct 2015 10:29:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51C4A20865 for ; Fri, 2 Oct 2015 10:29:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6851020862 for ; Fri, 2 Oct 2015 10:29:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751022AbbJBK3e (ORCPT ); Fri, 2 Oct 2015 06:29:34 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:7086 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750730AbbJBK3d (ORCPT ); Fri, 2 Oct 2015 06:29:33 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 02 Oct 2015 19:29:32 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 890EF53240; Fri, 2 Oct 2015 19:29:32 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 7D8B218070; Fri, 2 Oct 2015 19:29:32 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 678911806F; Fri, 2 Oct 2015 19:29:32 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id VAU11090; Fri, 2 Oct 2015 19:29:32 +0900 X-IronPort-AV: E=Sophos;i="5.17,622,1437404400"; d="scan'208";a="195639175" Received: from unknown (HELO relay41.aps.necel.com) ([10.29.19.9]) by relmlii1.idc.renesas.com with ESMTP; 02 Oct 2015 19:29:32 +0900 Received: from DU0NOTES13.ad.ree.renesas.com ([172.29.24.131]) by relay41.aps.necel.com (8.14.4+Sun/8.14.4) with ESMTP id t92ATVW0009504; Fri, 2 Oct 2015 19:29:31 +0900 (JST) Received: from localhost.localdomain ([172.29.43.47]) by DU0NOTES13.ad.ree.renesas.com (Lotus Domino Release 8.5.3 HF466) with ESMTP id 2015100212293080-187282 ; Fri, 2 Oct 2015 12:29:30 +0200 From: Phil Edworthy To: Bjorn Helgaas Cc: Simon Horman , Nobuhiro Iwamatsu , Geert Uytterhoeven , linux-pci@vger.kernel.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Phil Edworthy X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443781507-5011-1-git-send-email-phil.edworthy@renesas.com> References: <1443781507-5011-1-git-send-email-phil.edworthy@renesas.com> X-TNEFEvaluated: 1 Message-ID: <1443781507-5011-5-git-send-email-phil.edworthy@renesas.com> Date: Fri, 2 Oct 2015 11:25:07 +0100 Subject: [PATCH 4/4] PCI: rcar-pcie: Fix IO offset for multiple instances X-MIMETrack: Itemize by SMTP Server on DU0NOTES13/SERVER/REE(Release 8.5.3 HF466|March 09, 2012) at 02.10.2015 12:29:31, Serialize by Router on DU0NOTES13/SERVER/REE(Release 8.5.3 HF466|March 09, 2012) at 02.10.2015 12:29:32, Serialize complete at 02.10.2015 12:29:32 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 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 8e583c2..f4fa6c5 100644 --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c @@ -108,6 +108,8 @@ #define RCAR_PCI_MAX_RESOURCES 4 #define MAX_NR_INBOUND_MAPS 6 +static unsigned long global_io_offset; + struct rcar_msi { DECLARE_BITMAP(used, INT_PCI_MSI_NR); struct irq_domain *domain; @@ -357,7 +359,7 @@ static void rcar_pcie_setup_window(int win, struct rcar_pcie *pcie) rcar_pci_write_reg(pcie, mask, PCIEPTCTLR(win)); } -static int rcar_pcie_setup(int nr, struct list_head *resource, struct rcar_pcie *pcie) +static int rcar_pcie_setup(struct list_head *resource, struct rcar_pcie *pcie) { struct resource *res; int i; @@ -375,7 +377,8 @@ static int rcar_pcie_setup(int nr, struct list_head *resource, struct rcar_pcie if (res->flags & IORESOURCE_IO) { phys_addr_t io_start = pci_pio_to_address(res->start); - pci_ioremap_io(nr * SZ_64K, io_start); + pci_ioremap_io(global_io_offset, io_start); + global_io_offset += SZ_64K; } pci_add_resource(resource, res); @@ -390,7 +393,7 @@ static int rcar_pcie_enable(struct rcar_pcie *pcie) struct pci_bus *bus, *child; LIST_HEAD(res); - rcar_pcie_setup(1, &res, pcie); + rcar_pcie_setup(&res, pcie); /* Do not reassign resources if probe only */ if (!pci_has_flag(PCI_PROBE_ONLY))