From patchwork Fri Jun 26 01:05:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Duc Dang X-Patchwork-Id: 6677991 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6CA36C05AC for ; Fri, 26 Jun 2015 01:10:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6ADB120630 for ; Fri, 26 Jun 2015 01:10:22 +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 73DCF204E4 for ; Fri, 26 Jun 2015 01:10:21 +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 1Z8I6o-0003md-It; Fri, 26 Jun 2015 01:07:10 +0000 Received: from mail-pd0-x236.google.com ([2607:f8b0:400e:c02::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z8I6l-0003kr-C7 for linux-arm-kernel@lists.infradead.org; Fri, 26 Jun 2015 01:07:08 +0000 Received: by pdcu2 with SMTP id u2so63959127pdc.3 for ; Thu, 25 Jun 2015 18:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=from:to:cc:subject:date:message-id; bh=CN3X9IB06tSx3ULG09wbt5xAZjGONtEWfYzBh3Xh59E=; b=dgrxnCfa9ahf3USJ1FUT2wj/xhUwF1jZNtizG0TNqaOwP4eWf1OM7fYcXHRNx5A+SN ZgbJPcrbSBp71A13+9PL1v1HFlN6wYwmOhEWIFl5C57RTE9dtoMxVUHX+g9CFiWSpxTG JdWdsP6ACBz3a/m2s+V+NeNJFiHcz/3s5UTjc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CN3X9IB06tSx3ULG09wbt5xAZjGONtEWfYzBh3Xh59E=; b=PnCUoQ7XCMVDdf7Vf+nimnZCA25lCqFbCdzjNeu9J2cdjEsW8+57h104H29U+Sa9ur JE/b0f+uKLSwnqbRK0HTyQhAHpvoU42z9uXrJC0hc+QIJJDuMHcOTnu9Ji6xGZXPn4gp fmhJueZPT6NqGv8ToFrhCcYFazECS6jfjQc3+sE/6CYNiG7ROH60Buw8a2l0QLvl2rAm LnksPE6ZPZzKDdf11bXAWS11gypuAGDJYWmDscJ95B0kEsOYisZkdsbTHMX7FiimvmVC 57DAlGD6+5F7Vt7NBPNWLuXllJ9HEmODBDAMLwEUjzpqyGaE3r01Hyo46lwkBfztSpT/ X5mA== X-Gm-Message-State: ALoCoQm5OV+HuDQaJwL4pcS1WTrkXuBDfe+KGaNCqHf3/GoC3gFGPbs+w1CpSOtD6+jBWpO2Chvf X-Received: by 10.68.103.164 with SMTP id fx4mr4972806pbb.125.1435280805234; Thu, 25 Jun 2015 18:06:45 -0700 (PDT) Received: from dhdang-Precision-WorkStation-T3400.amcc.com (67-207-112-226.static.wiline.com. [67.207.112.226]) by mx.google.com with ESMTPSA id uz9sm3108538pac.34.2015.06.25.18.06.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Jun 2015 18:06:44 -0700 (PDT) From: Duc Dang To: Bjorn Helgaas , Catalin Marinas , Ian Campbell , Pawel Moll , Rob Herring , Mark Rutland , Kumar Gala , Will Deacon , "David S. Miller" Subject: [PATCH 1/1] pci: xgene: Enable huge outbound bar support Date: Thu, 25 Jun 2015 18:05:56 -0700 Message-Id: <1435280756-24455-1-git-send-email-dhdang@apm.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150625_180707_449802_1C4B1321 X-CRM114-Status: GOOD ( 13.81 ) X-Spam-Score: -2.7 (--) Cc: devicetree@vger.kernel.org, linux-pci@vger.kernel.org, Duc Dang , patches@apm.com, linux-kernel@vger.kernel.org, Tanmay Inamdar , linux-arm-kernel@lists.infradead.org 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=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 X-Gene PCIe controllers support huge outbound BARs (with size upto 64GB). This patch configures additional 1 outbound BAR for X-Gene PCIe controllers with size larger than 4GB. This is required to support devices that request huge outbound memory (nVidia K40 as an example) Signed-off-by: Duc Dang Signed-off-by: Tanmay Inamdar --- arch/arm64/boot/dts/apm/apm-storm.dtsi | 33 +++++++++++++++++++-------------- drivers/pci/host/pci-xgene.c | 6 +++++- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/arch/arm64/boot/dts/apm/apm-storm.dtsi b/arch/arm64/boot/dts/apm/apm-storm.dtsi index d8f3a1c..039206b 100644 --- a/arch/arm64/boot/dts/apm/apm-storm.dtsi +++ b/arch/arm64/boot/dts/apm/apm-storm.dtsi @@ -404,10 +404,11 @@ #size-cells = <2>; #address-cells = <3>; reg = < 0x00 0x1f2b0000 0x0 0x00010000 /* Controller registers */ - 0xe0 0xd0000000 0x0 0x00040000>; /* PCI config space */ + 0xe0 0x00000000 0x0 0x00040000>; /* PCI config space */ reg-names = "csr", "cfg"; ranges = <0x01000000 0x00 0x00000000 0xe0 0x10000000 0x00 0x00010000 /* io */ - 0x02000000 0x00 0x80000000 0xe1 0x80000000 0x00 0x80000000>; /* mem */ + 0x02000000 0x00 0x80000000 0xe1 0x80000000 0x00 0x80000000 /* mem */ + 0x02000000 0x10 0x00000000 0xf0 0x00000000 0x10 0x00000000>; /* mem */ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; @@ -428,10 +429,11 @@ #size-cells = <2>; #address-cells = <3>; reg = < 0x00 0x1f2c0000 0x0 0x00010000 /* Controller registers */ - 0xd0 0xd0000000 0x0 0x00040000>; /* PCI config space */ + 0xd0 0x00000000 0x0 0x00040000>; /* PCI config space */ reg-names = "csr", "cfg"; - ranges = <0x01000000 0x0 0x00000000 0xd0 0x10000000 0x00 0x00010000 /* io */ - 0x02000000 0x0 0x80000000 0xd1 0x80000000 0x00 0x80000000>; /* mem */ + ranges = <0x01000000 0x00 0x00000000 0xd0 0x10000000 0x00 0x00010000 /* io */ + 0x02000000 0x00 0x80000000 0xd1 0x80000000 0x00 0x80000000 /* mem */ + 0x02000000 0x08 0x00000000 0xd8 0x00000000 0x08 0x00000000>; /* mem */ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; @@ -452,10 +454,11 @@ #size-cells = <2>; #address-cells = <3>; reg = < 0x00 0x1f2d0000 0x0 0x00010000 /* Controller registers */ - 0x90 0xd0000000 0x0 0x00040000>; /* PCI config space */ + 0x90 0x00000000 0x0 0x00040000>; /* PCI config space */ reg-names = "csr", "cfg"; - ranges = <0x01000000 0x0 0x00000000 0x90 0x10000000 0x0 0x00010000 /* io */ - 0x02000000 0x0 0x80000000 0x91 0x80000000 0x0 0x80000000>; /* mem */ + ranges = <0x01000000 0x00 0x00000000 0x90 0x10000000 0x00 0x00010000 /* io */ + 0x02000000 0x00 0x80000000 0x91 0x80000000 0x00 0x80000000 /* mem */ + 0x02000000 0x04 0x00000000 0x94 0x00000000 0x04 0x00000000>; /* mem */ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; @@ -476,10 +479,11 @@ #size-cells = <2>; #address-cells = <3>; reg = < 0x00 0x1f500000 0x0 0x00010000 /* Controller registers */ - 0xa0 0xd0000000 0x0 0x00040000>; /* PCI config space */ + 0xa0 0x00000000 0x0 0x00040000>; /* PCI config space */ reg-names = "csr", "cfg"; - ranges = <0x01000000 0x0 0x00000000 0xa0 0x10000000 0x0 0x00010000 /* io */ - 0x02000000 0x0 0x80000000 0xa1 0x80000000 0x0 0x80000000>; /* mem */ + ranges = <0x01000000 0x00 0x00000000 0xa0 0x10000000 0x00 0x00010000 /* io */ + 0x02000000 0x00 0x80000000 0xa1 0x80000000 0x00 0x80000000 /* mem */ + 0x02000000 0x10 0x00000000 0xb0 0x00000000 0x10 0x00000000>; /* mem */ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; @@ -500,10 +504,11 @@ #size-cells = <2>; #address-cells = <3>; reg = < 0x00 0x1f510000 0x0 0x00010000 /* Controller registers */ - 0xc0 0xd0000000 0x0 0x00200000>; /* PCI config space */ + 0xc0 0x00000000 0x0 0x00040000>; /* PCI config space */ reg-names = "csr", "cfg"; - ranges = <0x01000000 0x0 0x00000000 0xc0 0x10000000 0x0 0x00010000 /* io */ - 0x02000000 0x0 0x80000000 0xc1 0x80000000 0x0 0x80000000>; /* mem */ + ranges = <0x01000000 0x00 0x00000000 0xc0 0x10000000 0x00 0x00010000 /* io */ + 0x02000000 0x00 0x80000000 0xc1 0x80000000 0x00 0x80000000 /* mem */ + 0x02000000 0x08 0x00000000 0xc8 0x00000000 0x08 0x00000000>; /* mem */ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c index a9dfb70..62d7843 100644 --- a/drivers/pci/host/pci-xgene.c +++ b/drivers/pci/host/pci-xgene.c @@ -305,6 +305,7 @@ static int xgene_pcie_map_ranges(struct xgene_pcie_port *port, struct resource_entry *window; struct device *dev = port->dev; int ret; + u32 omr_idx = 0; resource_list_for_each_entry(window, res) { struct resource *res = window->res; @@ -321,8 +322,11 @@ static int xgene_pcie_map_ranges(struct xgene_pcie_port *port, return ret; break; case IORESOURCE_MEM: - xgene_pcie_setup_ob_reg(port, res, OMR1BARL, res->start, + xgene_pcie_setup_ob_reg(port, res, + OMR1BARL + (omr_idx * 0x18), + res->start, res->start - window->offset); + omr_idx++; break; case IORESOURCE_BUS: break;