From patchwork Fri Apr 17 07:14:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 47249 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E5F4120553 for ; Fri, 17 Apr 2015 07:16:15 +0000 (UTC) Received: by widjs5 with SMTP id js5sf2077830wid.3 for ; Fri, 17 Apr 2015 00:16:15 -0700 (PDT) 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=QnwZ2IZM+2MT76erVMRgUa1c8FUyOvlrsYy0bGUIIJM=; b=akjg3AHCaI+V8G2JCFKm0/+HKOJ+OmZ4WY3h9frU27Aq9GOh1a81eJzei7nwemQJ8f sreVdfkQKEr2LBFIWMujwYFpidZ5e3OBaN40xu269oZFGS551zjq2v7m+SSdkzpX3bfU YtpUc+p2+/pcV5E76k1y1mnEQm8EdhH5Fa/9kCqJBPZnELH+IGSxkusYVVBTQE6r5/Fb ghB+dnXN9qq91dbR6RI/sCr3Nm11S0j76GKTIK8bJu/j6MgLleRYgUkM0iifflCyg0MZ Y8LeeHOLWp0bhLnvL64XORQY0Ztl3pXeNPVcxOwXVqaRxVYk6+iaYchv73ToThLi/dfn goqg== X-Gm-Message-State: ALoCoQl6YCfoF34fpgpv84nEOyV1U//SY7cGJF1CjbEMK8LcBveJ/ahHfxMa0r1KJUNeeGWdqd3K X-Received: by 10.112.98.38 with SMTP id ef6mr723331lbb.3.1429254975206; Fri, 17 Apr 2015 00:16:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.229 with SMTP id jf5ls401646lac.56.gmail; Fri, 17 Apr 2015 00:16:14 -0700 (PDT) X-Received: by 10.152.116.102 with SMTP id jv6mr1351354lab.50.1429254974840; Fri, 17 Apr 2015 00:16:14 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id bd7si8130185lab.77.2015.04.17.00.16.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 00:16:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbuc2 with SMTP id uc2so76008783lbb.2 for ; Fri, 17 Apr 2015 00:16:14 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr1412660lbc.32.1429254974746; Fri, 17 Apr 2015 00:16:14 -0700 (PDT) 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.112.67.65 with SMTP id l1csp3561315lbt; Fri, 17 Apr 2015 00:16:13 -0700 (PDT) X-Received: by 10.70.136.202 with SMTP id qc10mr2925496pdb.117.1429254971920; Fri, 17 Apr 2015 00:16:11 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wf6si15553830pac.18.2015.04.17.00.16.10; Fri, 17 Apr 2015 00:16:11 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753415AbbDQHP6 (ORCPT + 27 others); Fri, 17 Apr 2015 03:15:58 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:32801 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753252AbbDQHPz (ORCPT ); Fri, 17 Apr 2015 03:15:55 -0400 Received: by layy10 with SMTP id y10so73573430lay.0 for ; Fri, 17 Apr 2015 00:15:53 -0700 (PDT) X-Received: by 10.112.90.201 with SMTP id by9mr1335844lbb.30.1429254953629; Fri, 17 Apr 2015 00:15:53 -0700 (PDT) Received: from tn-HP-4.semihalf.local ([80.82.22.190]) by mx.google.com with ESMTPSA id yq18sm2215742lbb.47.2015.04.17.00.15.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Apr 2015 00:15:52 -0700 (PDT) From: Tomasz Nowicki To: bhelgaas@google.com, wangyijing@huawei.com, arnd@arndb.de, hanjun.guo@linaro.org, Liviu.Dudau@arm.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, rjw@rjwysocki.net, al.stone@linaro.org, lorenzo.pieralisi@arm.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linaro-acpi@lists.linaro.org, Tomasz Nowicki Subject: [PATCH v5 8/9] pci, acpi, mcfg: Share ACPI PCI config space accessors. Date: Fri, 17 Apr 2015 09:14:57 +0200 Message-Id: <1429254898-32743-9-git-send-email-tomasz.nowicki@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429254898-32743-1-git-send-email-tomasz.nowicki@linaro.org> References: <1429254898-32743-1-git-send-email-tomasz.nowicki@linaro.org> 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: tomasz.nowicki@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) 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: , MCFG can be used perfectly for all architectures which support ACPI. ACPI mandates MCFG to describe PCI config space ranges which means we should use MMCONFIG accessors by default. Signed-off-by: Tomasz Nowicki --- drivers/acpi/mcfg.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/acpi/mcfg.c b/drivers/acpi/mcfg.c index 787defe..5ff2602 100644 --- a/drivers/acpi/mcfg.c +++ b/drivers/acpi/mcfg.c @@ -12,6 +12,26 @@ #define PREFIX "MCFG: " +/* + * raw_pci_read/write - ACPI PCI config space accessors. + * + * ACPI spec defines MCFG table as the way we can describe access to PCI config + * space, so let MCFG be default (__weak). + * + * If platform needs more fancy stuff, should provides its own implementation. + */ +int __weak raw_pci_read(unsigned int domain, unsigned int bus, + unsigned int devfn, int reg, int len, u32 *val) +{ + return pci_mmcfg_read(domain, bus, devfn, reg, len, val); +} + +int __weak raw_pci_write(unsigned int domain, unsigned int bus, + unsigned int devfn, int reg, int len, u32 val) +{ + return pci_mmcfg_write(domain, bus, devfn, reg, len, val); +} + int __init acpi_parse_mcfg(struct acpi_table_header *header) { struct acpi_table_mcfg *mcfg;