From patchwork Sat May 31 00:36:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 4274681 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E0AE39F336 for ; Sat, 31 May 2014 00:42:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA83A2038F for ; Sat, 31 May 2014 00:42: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 3268B20351 for ; Sat, 31 May 2014 00:42:22 +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 1WqXJp-0008Gw-8v; Sat, 31 May 2014 00:38:41 +0000 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21] helo=cam-smtp0.cambridge.arm.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WqXJm-0008FV-5w for linux-arm-kernel@lists.infradead.org; Sat, 31 May 2014 00:38:39 +0000 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 s4V0awgx003864; Sat, 31 May 2014 01:37:01 +0100 From: Liviu Dudau To: Bjorn Helgaas Subject: [PATCH 2/2] of: treat PCI config space as IORESOURCE_MEM type with special flags. Date: Sat, 31 May 2014 01:36:41 +0100 Message-Id: <1401496601-31983-3-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 1.9.2 In-Reply-To: <1401496601-31983-1-git-send-email-Liviu.Dudau@arm.com> References: <20140530233034.GH1677@bart.dudau.co.uk> <1401496601-31983-1-git-send-email-Liviu.Dudau@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140530_173838_749780_3710BE5F X-CRM114-Status: UNSURE ( 8.13 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.4 (-) Cc: Mark Rutland , "devicetree@vger.kernel.org" , Pawel Moll , Ian Campbell , "linux-pci@vger.kernel.org" , linux-arm-msm , "linux-kernel@vger.kernel.org" , Kishon Vijay Abraham I , Rob Herring , Kumar Gala , Grant Likely , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, 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 If we have a PCI config space specified in something like a ranges property we should treat it as memory type resource. Use the IORESOURCE_ECFG bit to distinguish the config space from standard IORESOURCE_MEM resources. Signed-off-by: Kumar Gama [Updated commit log and added IORESOURCE_ECFG bit] Signed-off-by: Liviu Dudau --- drivers/of/address.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/of/address.c b/drivers/of/address.c index 2fcfbae..877e9e5 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -123,6 +123,9 @@ static unsigned int of_bus_pci_get_flags(const __be32 *addr) u32 w = be32_to_cpup(addr); switch((w >> 24) & 0x03) { + case 0x00: /* cfg space */ + flags |= IORESOURCE_MEM | IORESOURCE_PCI_ECFG; + break; case 0x01: flags |= IORESOURCE_IO; break;