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: 4274611 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6D7B8BEEA7 for ; Sat, 31 May 2014 00:38:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D1972038F for ; Sat, 31 May 2014 00:38:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE55A20351 for ; Sat, 31 May 2014 00:38:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934962AbaEaAio (ORCPT ); Fri, 30 May 2014 20:38:44 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:54602 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934624AbaEaAio (ORCPT ); Fri, 30 May 2014 20:38:44 -0400 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 Cc: Kumar Gala , Rob Herring , Rob Herring , Grant Likely , Pawel Moll , Mark Rutland , Ian Campbell , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , linux-arm-msm , "linux-arm-kernel@lists.infradead.org" , Kishon Vijay Abraham I 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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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;