From patchwork Wed Mar 11 14:12:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 45660 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C3DA4214BF for ; Wed, 11 Mar 2015 14:13:15 +0000 (UTC) Received: by wghl18 with SMTP id l18sf6830674wgh.1 for ; Wed, 11 Mar 2015 07:13: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=YRMvNkoBvsY5Pv/7qa2ezWim+OBNLyOe0pAZK6j7Ehw=; b=etqtFbInQEpF5TUzD3rgPxbzffRReksYYfREunsvsogAhaION/MVF+2QIBxGgjF1K4 kI7Sw+T7rdKTRBnCotWCHHb1kwML2oeILA5GK69fLPqXucr3pwhSokslQyFfnc6reXPh gmZGryvAODKkYhu8+5Ii/jCOSS76CZCGdNU6a24j7DvG1/kpxILZwmeRzwKwwbwGmg3r /RF8Ep4hFMy2Rf61AJHSoPG5HQBB3KMMuG6ABIuzncoadWrkN4VS/GPGtSDzYPsC6KqE Y1wm7gJS/sgU+PnmR/6JWSDq4A2WMzaNj1jvmVBPfMtsJBzo517Ov+2QaMLUYT1tcYbi FS1Q== X-Gm-Message-State: ALoCoQm31TcrrwfPpQyt7vXTc4SXGSaKFHMy1ll0RCKNyRHKe7q10Vw0JOPMBAmT/0vkJAJlL76+ X-Received: by 10.152.27.134 with SMTP id t6mr5525680lag.5.1426083194991; Wed, 11 Mar 2015 07:13:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.98 with SMTP id l2ls142632lam.28.gmail; Wed, 11 Mar 2015 07:13:14 -0700 (PDT) X-Received: by 10.152.116.65 with SMTP id ju1mr14595958lab.32.1426083194813; Wed, 11 Mar 2015 07:13:14 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id di8si2441873lac.62.2015.03.11.07.13.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 07:13:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbvp9 with SMTP id p9so9109822lbv.8 for ; Wed, 11 Mar 2015 07:13:14 -0700 (PDT) X-Received: by 10.112.162.232 with SMTP id yd8mr34329075lbb.41.1426083194686; Wed, 11 Mar 2015 07:13: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.35.133 with SMTP id h5csp2805756lbj; Wed, 11 Mar 2015 07:13:13 -0700 (PDT) X-Received: by 10.50.43.198 with SMTP id y6mr92143768igl.16.1426083193061; Wed, 11 Mar 2015 07:13:13 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cu9si3944917pad.177.2015.03.11.07.13.11; Wed, 11 Mar 2015 07:13:13 -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 S1753049AbbCKONB (ORCPT + 28 others); Wed, 11 Mar 2015 10:13:01 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:43755 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750851AbbCKOMy (ORCPT ); Wed, 11 Mar 2015 10:12:54 -0400 Received: by lbvp9 with SMTP id p9so9096789lbv.10 for ; Wed, 11 Mar 2015 07:12:53 -0700 (PDT) X-Received: by 10.112.162.232 with SMTP id yd8mr34327591lbb.41.1426083173251; Wed, 11 Mar 2015 07:12:53 -0700 (PDT) Received: from tn-HP-4.semihalf.com (cardhu.semihalf.com. [213.17.239.108]) by mx.google.com with ESMTPSA id x4sm746600lba.22.2015.03.11.07.12.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Mar 2015 07:12: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 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 v4 8/9] pci, acpi, mcfg: Share ACPI PCI config space accessors. Date: Wed, 11 Mar 2015 15:12:48 +0100 Message-Id: <1426083169-8698-9-git-send-email-tomasz.nowicki@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426083169-8698-1-git-send-email-tomasz.nowicki@linaro.org> References: <1426083169-8698-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.175 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 1e646fc..e285f62 100644 --- a/drivers/acpi/mcfg.c +++ b/drivers/acpi/mcfg.c @@ -13,6 +13,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); +} + static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg, struct acpi_mcfg_allocation *cfg) {