From patchwork Tue May 26 12:49:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 48984 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 C0A8E2121F for ; Tue, 26 May 2015 12:56:54 +0000 (UTC) Received: by lagv1 with SMTP id v1sf28019080lag.1 for ; Tue, 26 May 2015 05:56: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:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=8dPc8UqywqF/MK/nAv5RZ2l1qM8K8no9+Ik63h190AM=; b=i7Xu+uhFtDruxdNDxEmSzMPMVcfrU41uIHagwfcTfl/9Y0hg90pGJonlJkzyvxmUpK 2QFdcj0M58g3AWmPs2Im7ehv82q4TdyM5Vd4cYN1TTzDs6aTLLwHiF3jBVpOOT/Vqy1X 9NDvMhxAuKRz1GZkIya2A8Q3pdXPlg4l/kH/3XrAKUqU0NCcJl8aXg6AmrIGa0KVlmCj AcsNMV6kXjItOjQwmUbjvOjJ06o2DoRGnATs7CppHZJUitXxD8+tsayjPd66TejvlCt/ xbi//5lgtfVmmYzD9zGI7Iunhsduu/N09loYEaeDjg68ivkauc6eUPHkGNY9de689yV2 z+9Q== X-Gm-Message-State: ALoCoQnRfWDfaMpXHXTT2dEwn2lBp0/9yTRF7wi/AfesgmsBYElsHTsBNmQIwn93Pqr/ULSmFb+P X-Received: by 10.180.84.67 with SMTP id w3mr16274603wiy.7.1432645013694; Tue, 26 May 2015 05:56:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.163.65 with SMTP id yg1ls791136lab.26.gmail; Tue, 26 May 2015 05:56:53 -0700 (PDT) X-Received: by 10.112.235.133 with SMTP id um5mr23262108lbc.7.1432645013537; Tue, 26 May 2015 05:56:53 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id a1si10913927lbc.45.2015.05.26.05.56.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2015 05:56:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbcmx3 with SMTP id mx3so69677504lbc.1 for ; Tue, 26 May 2015 05:56:53 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr23178585lbc.32.1432645013391; Tue, 26 May 2015 05:56:53 -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.108.230 with SMTP id hn6csp2528712lbb; Tue, 26 May 2015 05:56:52 -0700 (PDT) X-Received: by 10.68.241.9 with SMTP id we9mr47983188pbc.59.1432645011655; Tue, 26 May 2015 05:56:51 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id vc10si20787521pbc.179.2015.05.26.05.56.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2015 05:56:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YxEN4-0006IO-1V; Tue, 26 May 2015 12:54:14 +0000 Received: from mail-pd0-f176.google.com ([209.85.192.176]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YxEK6-0004Ri-OF for linux-arm-kernel@lists.infradead.org; Tue, 26 May 2015 12:51:11 +0000 Received: by pdea3 with SMTP id a3so90230857pde.2 for ; Tue, 26 May 2015 05:50:48 -0700 (PDT) X-Received: by 10.70.43.225 with SMTP id z1mr48253591pdl.45.1432644648854; Tue, 26 May 2015 05:50:48 -0700 (PDT) Received: from localhost ([180.150.153.56]) by mx.google.com with ESMTPSA id u8sm13054058pdj.46.2015.05.26.05.50.47 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 26 May 2015 05:50:47 -0700 (PDT) From: Hanjun Guo To: Bjorn Helgaas , Arnd Bergmann , Catalin Marinas , Will Deacon , "Rafael J. Wysocki" Subject: [PATCH 09/11] pci, acpi, mcfg: Share ACPI PCI config space accessors. Date: Tue, 26 May 2015 20:49:22 +0800 Message-Id: <1432644564-24746-10-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432644564-24746-1-git-send-email-hanjun.guo@linaro.org> References: <1432644564-24746-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150526_055110_869384_07B8FE7C X-CRM114-Status: UNSURE ( 9.84 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.192.176 listed in list.dnswl.org] -1.1 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.176 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record Cc: Lorenzo Pieralisi , linaro-acpi@lists.linaro.org, linux-pci@vger.kernel.org, Liviu Dudau , linux-kernel@vger.kernel.org, Tomasz Nowicki , linux-acpi@vger.kernel.org, Hanjun Guo , Suravee Suthikulpanit , Mark Salter , Yijing Wang , Thomas Gleixner , Jiang Liu , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@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.172 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 From: Tomasz Nowicki 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 Signed-off-by: Hanjun Guo Tested-by: Suravee Suthikulpanit --- drivers/acpi/mcfg.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/acpi/mcfg.c b/drivers/acpi/mcfg.c index 745b83e..90c81fa 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;