From patchwork Wed Nov 19 16:04:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 41191 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 80080241C9 for ; Wed, 19 Nov 2014 16:06:16 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id q1sf634036lam.5 for ; Wed, 19 Nov 2014 08:06:15 -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=S8kxvZliKlDN4DaXAMPAaq3nECttpspstjtP70pnZdI=; b=jJDUJLE9EibvaumkN5C66aJPkPgRQpR2h3fyE/7v7jqed+2IO3tU7rwKYiotgHLZ+e BRDwFievzKNPj50PuUbMbUAi382ZbnDCff8glvR08XodnThewE8lX6yNiYzdkk8zrRpR l9wkqidK4T0WIwYvcCUMv2djeOcYOtBnLkRSGW2UHgHMFUoyfF1vkQ5A59o6tYSHOeLu cE4XaNtUiMN1/uhmB/O4OtZ0ZGaVX0PFd0S4gFcOViDuvZdBYpZUFOxFcN/5Iyc4j7jl 5qWc8XPsgOt4FEkG0JMgWP+3lg8nmzKDO2Vlu/YPAMG3ExZ5jy4RZQz19RHIoKMn8eXn EulQ== X-Gm-Message-State: ALoCoQlctWudFdN/3QYlXTOA8eqskl5UZlhh11JpjFZCrBcitd1+7nwFN4+LWF1Hgjij9gdFTMDj X-Received: by 10.152.36.135 with SMTP id q7mr685562laj.8.1416413175505; Wed, 19 Nov 2014 08:06:15 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.33 with SMTP id v1ls840016laj.99.gmail; Wed, 19 Nov 2014 08:06:15 -0800 (PST) X-Received: by 10.112.63.133 with SMTP id g5mr6130586lbs.33.1416413175337; Wed, 19 Nov 2014 08:06:15 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id y9si2278565lbr.1.2014.11.19.08.06.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Nov 2014 08:06:15 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id z12so729533lbi.8 for ; Wed, 19 Nov 2014 08:06:15 -0800 (PST) X-Received: by 10.112.45.102 with SMTP id l6mr6112483lbm.46.1416413175207; Wed, 19 Nov 2014 08:06:15 -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.184.201 with SMTP id ew9csp109563lbc; Wed, 19 Nov 2014 08:06:14 -0800 (PST) X-Received: by 10.68.135.163 with SMTP id pt3mr47259230pbb.106.1416413173626; Wed, 19 Nov 2014 08:06:13 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ri7si3060851pdb.193.2014.11.19.08.06.12 for ; Wed, 19 Nov 2014 08:06:13 -0800 (PST) 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 S1756775AbaKSQGD (ORCPT + 26 others); Wed, 19 Nov 2014 11:06:03 -0500 Received: from mail-wg0-f44.google.com ([74.125.82.44]:57062 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932320AbaKSQFn (ORCPT ); Wed, 19 Nov 2014 11:05:43 -0500 Received: by mail-wg0-f44.google.com with SMTP id b13so1173609wgh.3 for ; Wed, 19 Nov 2014 08:05:42 -0800 (PST) X-Received: by 10.194.62.163 with SMTP id z3mr13643130wjr.74.1416413142047; Wed, 19 Nov 2014 08:05:42 -0800 (PST) Received: from tn-HP-4.semihalf.com (cardhu.semihalf.com. [213.17.239.108]) by mx.google.com with ESMTPSA id e7sm2842175wjx.31.2014.11.19.08.05.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Nov 2014 08:05:41 -0800 (PST) From: Tomasz Nowicki To: catalin.marinas@arm.com, will.deacon@arm.com, bhelgaas@google.com, lorenzo.pieralisi@arm.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 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 6/6] pci, acpi: Share ACPI PCI config space accessors. Date: Wed, 19 Nov 2014 17:04:51 +0100 Message-Id: <1416413091-13452-7-git-send-email-tomasz.nowicki@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1416413091-13452-1-git-send-email-tomasz.nowicki@linaro.org> References: <1416413091-13452-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.177 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: , MMCFG can be used perfectly for all architectures which support ACPI. ACPI mandates MMCFG to describe PCI config space ranges which means we should use MMCONFIG accessors by default. Signed-off-by: Tomasz Nowicki Tested-by: Hanjun Guo --- drivers/acpi/mmconfig.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/acpi/mmconfig.c b/drivers/acpi/mmconfig.c index c0ad05f..c9c6e05 100644 --- a/drivers/acpi/mmconfig.c +++ b/drivers/acpi/mmconfig.c @@ -23,6 +23,26 @@ static DEFINE_MUTEX(pci_mmcfg_lock); LIST_HEAD(pci_mmcfg_list); +/* + * raw_pci_read/write - ACPI PCI config space accessors. + * + * ACPI spec defines MMCFG as the way we can access PCI config space, + * so let MMCFG 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 char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) {