From patchwork Fri Feb 27 15:00:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 45241 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EDE07204BC for ; Fri, 27 Feb 2015 15:01:31 +0000 (UTC) Received: by lamq1 with SMTP id q1sf14813914lam.0 for ; Fri, 27 Feb 2015 07:01:30 -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=aMnJzEwBx51te+ovS9uezKkjTG8RjCurbgQ1YxKhB5U=; b=ScMtL6t3zUHWSe//WpaclaIWZuN5Cs5tm5ZqUX3rD+Ur0QU6lDeEEm64lmwZ6BwhKp q+w5HjpzPRW9InoOqhRUpF36p+Hl3H0QN4/4xfsIQhCGP4ru/ALGSlbAc2mskH2rFUeA ayGsxkWx3s6bBTd6D14Df+Oc6BoNSxLmLt/0Pl0SdvnYhAC9fXjYHLBSZWiqgRTKuvOD ZsYVL2oMIaUR75rKmMVRvPy6PErNzQp2qtU/jDSOP3hBEu2fgE95WcQGWm0/keWPkmLN PQ2K4KU8uQLisr+N2nOb87R+ZVuKpPclkXSGpRAlmcZwGRwdcDF1Ql/JVmxo77qxeDVX HRCg== X-Gm-Message-State: ALoCoQnyeIDUSLINGze2pLMLlgMUn+/1Un5idsBL5M9YdeiM/PXJ5gl5haR/NIvTXHPG/ZzmKyIV X-Received: by 10.180.91.76 with SMTP id cc12mr541773wib.7.1425049290900; Fri, 27 Feb 2015 07:01:30 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.130 with SMTP id v2ls146024lae.98.gmail; Fri, 27 Feb 2015 07:01:30 -0800 (PST) X-Received: by 10.153.8.135 with SMTP id dk7mr12737649lad.93.1425049290747; Fri, 27 Feb 2015 07:01:30 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id y8si3068591lbg.121.2015.02.27.07.01.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Feb 2015 07:01:30 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by labgf13 with SMTP id gf13so18035912lab.9 for ; Fri, 27 Feb 2015 07:01:30 -0800 (PST) X-Received: by 10.152.87.3 with SMTP id t3mr13034409laz.19.1425049290479; Fri, 27 Feb 2015 07:01:30 -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.112.35.133 with SMTP id h5csp3994907lbj; Fri, 27 Feb 2015 07:01:28 -0800 (PST) X-Received: by 10.70.129.43 with SMTP id nt11mr21321048pdb.79.1425049287598; Fri, 27 Feb 2015 07:01:27 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id up2si5752912pac.135.2015.02.27.07.01.26; Fri, 27 Feb 2015 07:01:27 -0800 (PST) Received-SPF: none (google.com: linux-acpi-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 S1755016AbbB0PBC (ORCPT + 7 others); Fri, 27 Feb 2015 10:01:02 -0500 Received: from mail-lb0-f178.google.com ([209.85.217.178]:45784 "EHLO mail-lb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754933AbbB0PAV (ORCPT ); Fri, 27 Feb 2015 10:00:21 -0500 Received: by lbjb6 with SMTP id b6so17770327lbj.12 for ; Fri, 27 Feb 2015 07:00:20 -0800 (PST) X-Received: by 10.112.39.69 with SMTP id n5mr12962785lbk.1.1425049220033; Fri, 27 Feb 2015 07:00:20 -0800 (PST) Received: from tn-HP-4.semihalf.com ([80.82.22.190]) by mx.google.com with ESMTPSA id p7sm886055lap.18.2015.02.27.07.00.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Feb 2015 07:00:19 -0800 (PST) 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 v2 8/9] pci, acpi, mcfg: Share ACPI PCI config space accessors. Date: Fri, 27 Feb 2015 16:00:43 +0100 Message-Id: <1425049244-19331-9-git-send-email-tomasz.nowicki@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1425049244-19331-1-git-send-email-tomasz.nowicki@linaro.org> References: <1425049244-19331-1-git-send-email-tomasz.nowicki@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-acpi@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.215.43 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) {