From patchwork Fri Feb 27 15:00:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 5900981 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 708BBBF440 for ; Fri, 27 Feb 2015 15:02:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A26972022D for ; Fri, 27 Feb 2015 15:02:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C14282010B for ; Fri, 27 Feb 2015 15:02:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754835AbbB0PCf (ORCPT ); Fri, 27 Feb 2015 10:02:35 -0500 Received: from mail-la0-f44.google.com ([209.85.215.44]:46624 "EHLO mail-la0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754056AbbB0PAO (ORCPT ); Fri, 27 Feb 2015 10:00:14 -0500 Received: by lams18 with SMTP id s18so18063343lam.13 for ; Fri, 27 Feb 2015 07:00:13 -0800 (PST) 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=+/TXhL3K0KQZZYffvno1DF6QE6eXfSh4QLW6TStj4E8=; b=Ty6CZfG3eQuoA++MiTAEboHy34KCNDHSJc9dX+CSiC1LiYNnSonSy1jlJ0CZl+APBO qAbBJaLGbpHDOJ1Zd0qOQUaFki/Ndirwci0Chzrhz0yhVD2BWJjoYytmJClSYifJ02q5 8Ar5gYN6PIqa2+AeFC/mC0VOts9Ey4BpeZZTSfE5XNGdl1JxvpJOWI2KW8E+d7QazunE mg1TpKv/WeJggvGTUmZvwBe/OaBI1igBGUndS8eGUYedjgsWyOais/AOQLsY0VpuvguG PQHU7lnKJjk2m1BjIa7suqPu1t3SJQZHNQ9h2AH+JFKN7CfJjeC8tYFa/n+guYOvhylN kPbg== X-Gm-Message-State: ALoCoQkvRTVFn6GwZSBS9/gx0iWa17/ZpahK6EMEEQBSt1W+S4o/yWmmf+PUcNURGbeGlggEibne X-Received: by 10.112.150.200 with SMTP id uk8mr8403663lbb.14.1425049213420; Fri, 27 Feb 2015 07:00:13 -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.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Feb 2015 07:00:12 -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 5/9] pci, acpi, mcfg: Provide generic implementation of MCFG code initialization. Date: Fri, 27 Feb 2015 16:00:40 +0100 Message-Id: <1425049244-19331-6-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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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 Those two functions are required by ACPI subsystem to make PCI config space accessible. Generic code assume to do nothing for early init call but late init call does as follow: - parse MCFG table and add regions to ECAM resource list - map regions - add regions to iomem_resource 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 a2e2326..1e646fc 100644 --- a/drivers/acpi/mcfg.c +++ b/drivers/acpi/mcfg.c @@ -79,3 +79,23 @@ int __init acpi_parse_mcfg(struct acpi_table_header *header) return 0; } + +void __init __weak pci_mmcfg_early_init(void) +{ + +} + +void __init __weak pci_mmcfg_late_init(void) +{ + struct pci_mmcfg_region *cfg; + + acpi_table_parse(ACPI_SIG_MCFG, acpi_parse_mcfg); + + if (list_empty(&pci_mmcfg_list)) + return; + if (!pci_mmcfg_arch_init()) + free_all_mmcfg(); + + list_for_each_entry(cfg, &pci_mmcfg_list, list) + insert_resource(&iomem_resource, &cfg->res); +}