From patchwork Fri Feb 28 13:08:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 25541 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 821D320567 for ; Fri, 28 Feb 2014 13:09:00 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id pa12sf1522941veb.8 for ; Fri, 28 Feb 2014 05:09:00 -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=SJGWCW6GRwFxTcUX8ujOdXu0tpi5cgcjjIsZLe5F/lE=; b=HkeZ6bIsQBqRcr18c0CQSiuDW9btq1zQ+JKGKf4DiizzTMMnM0xFxkiF4HP9btDZsw XtCGmIPH8qYU/AU+CBzU4DAnaQrwMX5tpiLK+9Q1z+43iVs1IutAiv6CoUbpP28Y5/U0 im6osuUqlg4dOwakl++D56LCNjle07vdCE5w/JPncX56fJz8r2/9XrItj3uxhtY0/kKj w+YCB7kX7KmyBIaJKCBRyNPhV6xbcfV06JmZ+KpVbfeq2rQdiNl4OxbdPe41JxRjcvDa G6Xwgb84AfWHc3lAZcd6JKOtWVkETxRA/8LbVL5jm/M+yDGNkophWznMMc90SiDwy9Hs NGhA== X-Gm-Message-State: ALoCoQkjmEsH123RrpSgV4+AbmK6zZQAnYeeuhfCR9O9yoWtO4+sGHvUQ5kKEqnVkohrwQN2IQT0 X-Received: by 10.236.94.48 with SMTP id m36mr996911yhf.47.1393592940158; Fri, 28 Feb 2014 05:09:00 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.8 with SMTP id c8ls1085774qgc.56.gmail; Fri, 28 Feb 2014 05:09:00 -0800 (PST) X-Received: by 10.220.109.1 with SMTP id h1mr2540572vcp.20.1393592940008; Fri, 28 Feb 2014 05:09:00 -0800 (PST) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id sr19si1785924vcb.71.2014.02.28.05.08.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Feb 2014 05:09:00 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.177 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.177; Received: by mail-vc0-f177.google.com with SMTP id if11so671479vcb.36 for ; Fri, 28 Feb 2014 05:08:59 -0800 (PST) X-Received: by 10.52.161.130 with SMTP id xs2mr528871vdb.49.1393592939901; Fri, 28 Feb 2014 05:08:59 -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 u1csp52410vcs; Fri, 28 Feb 2014 05:08:59 -0800 (PST) X-Received: by 10.68.131.202 with SMTP id oo10mr3333385pbb.35.1393592938910; Fri, 28 Feb 2014 05:08:58 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xn1si1995750pbc.218.2014.02.28.05.08.58; Fri, 28 Feb 2014 05:08:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 S1751671AbaB1NI5 (ORCPT + 9 others); Fri, 28 Feb 2014 08:08:57 -0500 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:53554 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751378AbaB1NI4 (ORCPT ); Fri, 28 Feb 2014 08:08:56 -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 s1SD8MJD022677; Fri, 28 Feb 2014 13:08:22 GMT From: Liviu Dudau To: linux-pci , Bjorn Helgaas , Catalin Marinas , Will Deacon , linaro-kernel Cc: Benjamin Herrenschmidt , LKML , "devicetree@vger.kernel.org" , LAKML Subject: [PATCH v3 1/5] pci: Introduce pci_register_io_range() helper function. Date: Fri, 28 Feb 2014 13:08:18 +0000 Message-Id: <1393592902-24750-2-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1393592902-24750-1-git-send-email-Liviu.Dudau@arm.com> References: <1393592902-24750-1-git-send-email-Liviu.Dudau@arm.com> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@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.177 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,