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: 45244 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 046B2204BC for ; Fri, 27 Feb 2015 15:02:44 +0000 (UTC) Received: by wivr20 with SMTP id r20sf602865wiv.3 for ; Fri, 27 Feb 2015 07:02:43 -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=Mfib4QJD9Sdl1OSwkzTR9gHu869yZ8wPjL9Z1GKtPrQ=; b=kPoWNo1o49JgQLOLt8BR5fVc/7SQ3eGpT8WHgXgSc4u2hxTy3GSuWZz+L7mEEOpX3i iKVAman1MKzD/KNyFbjfg7vGJmJJm4DVhHHER7XnuXkYQQTB8vgGh4mbc6RaCfiiYIqX 9K0Gq3an1sQ629u0wSbYqc7o66q3TWFZnxfmRQk9W014lrDG2jSn+JbOSyiIwmyvN2aG F8I6B4FLJ8ZjHwkYqz3w2x4yCGr/lCbu5/WM84bISRJZO2IqA+DD7A59e6CjpNigJNAw ku2eguQYbG5xXopgtOfnVD4+QuRUMXhVD7IBbbchlxSH4lui9KVfBD9P1S53g3HcEKLc ZDhA== X-Gm-Message-State: ALoCoQkiCKXQqGqNPJxYmx8t1YNuWyYfPM8oCrRkbyr1gQcKBq+GLYULEPEkHDUolCnlnikQ8+Yz X-Received: by 10.180.101.101 with SMTP id ff5mr540174wib.5.1425049363158; Fri, 27 Feb 2015 07:02:43 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.136 with SMTP id o8ls174651lal.74.gmail; Fri, 27 Feb 2015 07:02:42 -0800 (PST) X-Received: by 10.152.88.49 with SMTP id bd17mr12891965lab.43.1425049362961; Fri, 27 Feb 2015 07:02:42 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id uq7si3121042lbc.60.2015.02.27.07.02.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Feb 2015 07:02:42 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by labgd6 with SMTP id gd6so18109337lab.8 for ; Fri, 27 Feb 2015 07:02:42 -0800 (PST) X-Received: by 10.112.14.196 with SMTP id r4mr13040594lbc.86.1425049362541; Fri, 27 Feb 2015 07:02:42 -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.35.133 with SMTP id h5csp3995832lbj; Fri, 27 Feb 2015 07:02:41 -0800 (PST) X-Received: by 10.68.138.194 with SMTP id qs2mr3950693pbb.8.1425049360625; Fri, 27 Feb 2015 07:02:40 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rd1si4047782pbc.215.2015.02.27.07.02.39; Fri, 27 Feb 2015 07:02:40 -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 S1755185AbbB0PCg (ORCPT + 28 others); Fri, 27 Feb 2015 10:02:36 -0500 Received: from mail-la0-f54.google.com ([209.85.215.54]:43296 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754899AbbB0PAO (ORCPT ); Fri, 27 Feb 2015 10:00:14 -0500 Received: by labhv19 with SMTP id hv19so17989678lab.10 for ; Fri, 27 Feb 2015 07:00:13 -0800 (PST) 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-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.215.49 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: , 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); +}