From patchwork Mon Mar 3 17:33:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 25619 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BEF35206F3 for ; Mon, 3 Mar 2014 17:33:58 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id g12sf22047640oah.3 for ; Mon, 03 Mar 2014 09:33:58 -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=BvS+7ltlXtpZNizDhxzrK8ZpRLWgCn4bhGpFyo5QZbHCSvj3hzn4RWK7dYNhzAsWHt JxTGh8YrfXpAaeHtH/YKOUnBwXI42rsN2UaOiMXduHe6M1pPIpqM0TyY6Mo1X2sQKwBr yNNYOCcZ5VzeEhevDBYaVaWMI+6LFYku5tHFzChWs2ZTPr0esM7dO5vS2VQ9u6KHMpML 8uzQiUPX9RsIob2cL/RUvIhqfdclgROXcuVTWCrmo8uqT7W4N8/1/EBT9D5KD8XP2qZs ZpTPjNEfzvneMT6O8Uh99meL3XcmdL5jT/wKNuIrogzo8oxp7AFGXYnnk6RH7kQjgS6V LThA== X-Gm-Message-State: ALoCoQlSvCASMRAxtrxPcN7VhPq8XXNSzNjT87tATQgGyDnpiJtxK+3dKJrKx2FSmcedmEtuSE2A X-Received: by 10.50.26.65 with SMTP id j1mr9305629igg.7.1393868038296; Mon, 03 Mar 2014 09:33:58 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.8 with SMTP id c8ls2207490qgc.56.gmail; Mon, 03 Mar 2014 09:33:58 -0800 (PST) X-Received: by 10.221.55.199 with SMTP id vz7mr845524vcb.40.1393868038166; Mon, 03 Mar 2014 09:33:58 -0800 (PST) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id p9si3686058vdv.57.2014.03.03.09.33.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Mar 2014 09:33:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so1848109veb.26 for ; Mon, 03 Mar 2014 09:33:57 -0800 (PST) X-Received: by 10.220.83.4 with SMTP id d4mr967238vcl.39.1393868037917; Mon, 03 Mar 2014 09:33:57 -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 u1csp69759vcs; Mon, 3 Mar 2014 09:33:57 -0800 (PST) X-Received: by 10.66.241.73 with SMTP id wg9mr685395pac.69.1393868036867; Mon, 03 Mar 2014 09:33:56 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sh5si11376875pbc.110.2014.03.03.09.33.56; Mon, 03 Mar 2014 09:33:56 -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 S1753420AbaCCRdz (ORCPT + 9 others); Mon, 3 Mar 2014 12:33:55 -0500 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:53595 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753149AbaCCRdy (ORCPT ); Mon, 3 Mar 2014 12:33:54 -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 s23HXGx8016067; Mon, 3 Mar 2014 17:33:18 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 Subject: [PATCH v4 1/6] pci: Introduce pci_register_io_range() helper function. Date: Mon, 3 Mar 2014 17:33:11 +0000 Message-Id: <1393867996-32299-2-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1393867996-32299-1-git-send-email-Liviu.Dudau@arm.com> References: <1393867996-32299-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.128.181 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,