From patchwork Tue Mar 10 11:35:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 5976481 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F2FDABF440 for ; Tue, 10 Mar 2015 11:35:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2AFB620279 for ; Tue, 10 Mar 2015 11:35:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3478820295 for ; Tue, 10 Mar 2015 11:35:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753001AbbCJLfH (ORCPT ); Tue, 10 Mar 2015 07:35:07 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:33701 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752895AbbCJLfA (ORCPT ); Tue, 10 Mar 2015 07:35:00 -0400 Received: by lbdu14 with SMTP id u14so1038324lbd.0 for ; Tue, 10 Mar 2015 04:34:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WGngRL/1L3QZEDaWVSy41z2+YK40fjtaxbTTxNXuZi4=; b=h4PvxG9aizU2FQCVSTNKfwBEpk54E60N9OBztwM43zXevE+0sZl7tnMHsaz4hBocpF D4UTqbz5eNynCstxnLCY1L/TzXwLYP6q5o7PZZCEFkdEfkGkVNJ8gaLxBtrHpVRCUp7d WMayaBRupcV1CwRxC9XfgWKnF51ZnB3J1cTHWQaA/zT3yrxs3ZM4+8AN06Kn8kyUmz5x 0xxHfKTVJHqBB8HSmjEMI+TfsZkOL19O/Q9PAVlmxADSvRd5/YkNh4Su32ajC7jRdknp hKcsL9G6Tk5gexEYvNmLaVu/T9bApY32pP9e1rNoW8+pitJLsDtpbMDkz4IQWphXAuza IoOQ== X-Gm-Message-State: ALoCoQmyeSQsk/cNELDrYpp3fJzTaYnwr5NAIa6X0sQcGcgS1twVBa3JnC+YqbqS/sY9vbE2s8fi X-Received: by 10.112.64.193 with SMTP id q1mr30161380lbs.88.1425987299354; Tue, 10 Mar 2015 04:34:59 -0700 (PDT) Received: from tn-HP-4.semihalf.com (cardhu.semihalf.com. [213.17.239.108]) by mx.google.com with ESMTPSA id n12sm57206lbg.31.2015.03.10.04.34.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Mar 2015 04:34:58 -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 v3 8/9] pci, acpi, mcfg: Share ACPI PCI config space accessors. Date: Tue, 10 Mar 2015 12:35:19 +0100 Message-Id: <1425987320-15020-9-git-send-email-tomasz.nowicki@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1425987320-15020-1-git-send-email-tomasz.nowicki@linaro.org> References: <1425987320-15020-1-git-send-email-tomasz.nowicki@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 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) {