From patchwork Tue Mar 4 15:49:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 25682 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3666C2066C for ; Tue, 4 Mar 2014 15:50:56 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rp16sf14510116pbb.9 for ; Tue, 04 Mar 2014 07:50:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=fbbcTOcrMtT937Xx2FCVa67+0vf5Bfm3MdAPeJKrc6g=; b=S5lI1rqrVoHXss1U/wz6zwKBGQBm1L6m4KCnUQPvQtWw9y1PFt6Re/O0e7d8S54iEo VWYhPhzx+4+BeJQBAHnnCYgmtw9/9ON/V58oWq751NwYWIF7Gwk2OxctWFur8h1C64Kq IZ+6iraGEYiyxxESnfoGLTIy+4pOqlSwpbKVInOo1KPtMInCAJGZviBhHUJrj9a0ueLF mHG+ngQEk+ruH6UqQPsWSlIu+fvqm2WX2DJRv+SihVWfai+cRhRgOpMFHsYyLoKTzgEF kmAdsyyBzbft5u2ddSR4del2MZqpphkNCXzk6dQ0Y5a8jRa1PFLWjN/8ubPAfeWHrGKB EwKA== X-Gm-Message-State: ALoCoQkZlXHx8AQyN/mTSOpQWLUjYMvtSFfpeWw0pyESQDr31oe/iNwyCsKr6PQloBSgZRVC4xCP X-Received: by 10.66.141.135 with SMTP id ro7mr135419pab.28.1393948255417; Tue, 04 Mar 2014 07:50:55 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.39 with SMTP id g36ls319628qgd.25.gmail; Tue, 04 Mar 2014 07:50:55 -0800 (PST) X-Received: by 10.220.146.147 with SMTP id h19mr33862vcv.75.1393948255156; Tue, 04 Mar 2014 07:50:55 -0800 (PST) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id bj3si5906401vcb.64.2014.03.04.07.50.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 07:50:55 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id le5so4582718vcb.30 for ; Tue, 04 Mar 2014 07:50:55 -0800 (PST) X-Received: by 10.58.161.205 with SMTP id xu13mr189514veb.4.1393948255075; Tue, 04 Mar 2014 07:50:55 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.130.193 with SMTP id u1csp135980vcs; Tue, 4 Mar 2014 07:50:54 -0800 (PST) X-Received: by 10.66.27.67 with SMTP id r3mr368813pag.62.1393948253839; Tue, 04 Mar 2014 07:50:53 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tt8si14627662pbc.340.2014.03.04.07.50.52; Tue, 04 Mar 2014 07:50:53 -0800 (PST) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754323AbaCDPun (ORCPT + 26 others); Tue, 4 Mar 2014 10:50:43 -0500 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:51382 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753922AbaCDPul (ORCPT ); Tue, 4 Mar 2014 10:50:41 -0500 Received: from e106497-lin.cambridge.arm.com (e106497-lin.cambridge.arm.com [10.1.195.170]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id s24Fo4cT013537; Tue, 4 Mar 2014 15:50:05 GMT From: Liviu Dudau To: linux-pci , Bjorn Helgaas , Catalin Marinas , Will Deacon , linaro-kernel Cc: Benjamin Herrenschmidt , LKML , "devicetree@vger.kernel.org" , LAKML , Tanmay Inamdar , Arnd Bergmann Subject: [PATCH v5 1/7] pci: Introduce pci_register_io_range() helper function. Date: Tue, 4 Mar 2014 15:49:58 +0000 Message-Id: <1393948204-11555-2-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1393948204-11555-1-git-send-email-Liviu.Dudau@arm.com> References: <1393948204-11555-1-git-send-email-Liviu.Dudau@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: liviu.dudau@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Some architectures do not share x86 simple view of the I/O space and instead use a range of addresses that map to external devices. For PCI, these ranges can be expressed by OF bindings in a device tree file. Introduce a pci_register_io_range() helper function that can be used by the architecture code to keep track of the io ranges described by the PCI bindings. Signed-off-by: Liviu Dudau diff --git a/drivers/of/address.c b/drivers/of/address.c index 1a54f1f..d1bb30f 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -619,6 +619,11 @@ const __be32 *of_get_address(struct device_node *dev, int index, u64 *size, } EXPORT_SYMBOL(of_get_address); +int __weak pci_register_io_range(phys_addr_t addr, resource_size_t size) +{ + return 0; +} + unsigned long __weak pci_address_to_pio(phys_addr_t address) { if (address > IO_SPACE_LIMIT) diff --git a/include/linux/of_address.h b/include/linux/of_address.h index 5f6ed6b..40c418d 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h @@ -56,6 +56,7 @@ extern void __iomem *of_iomap(struct device_node *device, int index); extern const __be32 *of_get_address(struct device_node *dev, int index, u64 *size, unsigned int *flags); +extern int pci_register_io_range(phys_addr_t addr, resource_size_t size); extern unsigned long pci_address_to_pio(phys_addr_t addr); extern int of_pci_range_parser_init(struct of_pci_range_parser *parser,