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: 6228561 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BCEA19F2EC for ; Fri, 17 Apr 2015 07:16:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EEE1720381 for ; Fri, 17 Apr 2015 07:16:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0EA6F2037D for ; Fri, 17 Apr 2015 07:16:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751586AbbDQHQj (ORCPT ); Fri, 17 Apr 2015 03:16:39 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:32800 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753236AbbDQHPz (ORCPT ); Fri, 17 Apr 2015 03:15:55 -0400 Received: by layy10 with SMTP id y10so73573408lay.0 for ; Fri, 17 Apr 2015 00:15:53 -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=ycVHIthVDu5ruxEA8p16bCES1Rj9GgSYhScKBHLHqvQ=; b=YBNTSoN2OETRAHRzmEbd8PvL+3LdeRf9MMlCp3h1eBT2TeQ0xIM2U/nXeWIsU7lJbO RlcoOPSkd2EDnt9c2btwSVkRxk+kCQ5AnggyLQutovJa5rW/cIAh9i+ML1uuq9HuQZPU o4C/pqWQntkFcbM0dMfWe9hIUBIYrN5PXMK1AvZ4lSsznEb28MHvVo9LzLUgWcNJZIs5 I1QRjc2YgZ9xa5zwPl9qGXIXW8XRF8aBSD/6ObqiwxxO/2CmtiIXbybV1O5aj8Mkjveh a58JZC8BANkuO1k/NIwvM85ad4nefGmsnxdOLhKyLnMuDh0jEOjVs4QEnTpsZoMcsJi7 aPnw== X-Gm-Message-State: ALoCoQmBpDZekfoOkwVNMXkVcf/SoIxeQQErOeDaczTcZ1jRanJ6qi+9VRMR++u+3QQ3rfpzwxS/ 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-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=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 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;