From patchwork Fri Aug 18 14:58:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 110408 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp936427obb; Fri, 18 Aug 2017 07:59:59 -0700 (PDT) X-Received: by 10.84.137.1 with SMTP id 1mr9991130plm.75.1503068399883; Fri, 18 Aug 2017 07:59:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503068399; cv=none; d=google.com; s=arc-20160816; b=YkDkPz+eY2/VD+rjCpc4bToG1eTztK0+hTKtug+WkpzFEfV1G7/q4fqSBl6eXFEl1J HAaJp4F8sZynufXBipvGIl4qTcrvzTrEoCqF1dUqQeeelBitgDwWx/pJVWSVCyyECueV ZZBGnwUSOVtbhxQBDEZJ6UGjSYosgU7bmCttKW/oqDQpNj+0E00wfCvJbko5oMBWpKUf WX4p4941hz93wfPKqGNCgYvmjQlmaF1eWVlR5zGJmWl2S7rAK/DOpIP+m22UncZg50NY 1884Bnq/KbLSDw1GkrjNBlaWMTxlgQ6vcXrB4ay9z04UoaPvWuGSCiXJNoleAklgxcz4 5q7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=6U1lBUN5OYPIKEN6R2bKzpnQTib0V2TQcg14Vf5WVBA=; b=CVL3ATA5qyUY1g7jgore1rrFfWg4VJOTi5JmYoe3KttAiKN3yzUFgL+WdO7OOLUCv3 tSOQLjYyE7mXVMytwpJ9aB59ZgcbLWBhV7nMqQ3Do8k5TentpzCeckFWREHCmCfL0bRq 0wdSt1g5fCR6xKZpkJ9RlyqM/AvDnmDRqiegXTXuoXYlobRKdBWJ5cvz0S/UQNwtKRHA dwMCry/EePljYQSt22r6bl2h83eQbErxXK1GoTWEnn2nskYz82+MLP1n/A1sYAl4xW+/ vbQnfTaIE1gSlnyu9fZ5Or4B9VAoccxujlzaaYOG68QKLoZqQCOxCMXlILn0NFe0o768 aFgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=C7nuD7q/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 e27si3742620pfm.688.2017.08.18.07.59.59; Fri, 18 Aug 2017 07:59:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=C7nuD7q/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1752716AbdHRO74 (ORCPT + 26 others); Fri, 18 Aug 2017 10:59:56 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:64895 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752664AbdHRO7y (ORCPT ); Fri, 18 Aug 2017 10:59:54 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v7IEwwp5018543; Fri, 18 Aug 2017 09:58:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1503068338; bh=k+Qf6hTs10uRkl4RTe2sZSPtEIFmTnY07XMQiyDMfEg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=C7nuD7q/c+cMOmO3FRSXcDi7zJanQfNPDLtqNlXgDIQ7tE3wb4GDZHsHz2OvpNAQC HIjSsGA17QflAFBqwv+gUZwRF0E7TeytpFS09aoyXIlNhnR4lQG1WE7FRu0/6fam5l i4hkQBFbVu7zSVLreF1KE4um5PC26pqj/rcBdLgc= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v7IEwrQE003017; Fri, 18 Aug 2017 09:58:53 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Fri, 18 Aug 2017 09:58:52 -0500 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Fri, 18 Aug 2017 09:58:52 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Fri, 18 Aug 2017 09:58:52 -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 v7IEwKk8023721; Fri, 18 Aug 2017 09:58:50 -0500 From: Kishon Vijay Abraham I To: Bjorn Helgaas CC: Joao Pinto , Arnd Bergmann , , , , , , Subject: [PATCH 10/18] PCI: dwc: designware: Provide page_size to pci_epc_mem Date: Fri, 18 Aug 2017 20:28:02 +0530 Message-ID: <20170818145810.17649-11-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170818145810.17649-1-kishon@ti.com> References: <20170818145810.17649-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the newly introduced __pci_epc_mem_init instead of pci_epc_mem_init to provide page_size to pci_epc_mem. This is in preparation for adding EP support to K2G which has a restriction that the address region should be either divided into 1MB/2MB/4MB or 8MB sizes (Ref: 11.14.4.9.1 Outbound Address Translation in K2G TRM SPRUHY8F January 2016 – Revised May 2017). Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/dwc/pcie-designware-ep.c | 3 ++- drivers/pci/dwc/pcie-designware.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) -- 2.11.0 diff --git a/drivers/pci/dwc/pcie-designware-ep.c b/drivers/pci/dwc/pcie-designware-ep.c index 398406393f37..e70ebe3b9b6f 100644 --- a/drivers/pci/dwc/pcie-designware-ep.c +++ b/drivers/pci/dwc/pcie-designware-ep.c @@ -328,7 +328,8 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) if (ret < 0) epc->max_functions = 1; - ret = pci_epc_mem_init(epc, ep->phys_base, ep->addr_size); + ret = __pci_epc_mem_init(epc, ep->phys_base, ep->addr_size, + ep->page_size); if (ret < 0) { dev_err(dev, "Failed to initialize address space\n"); return ret; diff --git a/drivers/pci/dwc/pcie-designware.h b/drivers/pci/dwc/pcie-designware.h index b4d2a89f8e58..714f6f21ea93 100644 --- a/drivers/pci/dwc/pcie-designware.h +++ b/drivers/pci/dwc/pcie-designware.h @@ -186,6 +186,7 @@ struct dw_pcie_ep { struct dw_pcie_ep_ops *ops; phys_addr_t phys_base; size_t addr_size; + size_t page_size; u8 bar_to_atu[6]; phys_addr_t *outbound_addr; unsigned long ib_window_map;