From patchwork Wed Jan 13 13:20:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 8025251 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 0DE80BEEE5 for ; Wed, 13 Jan 2016 13:27:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 477B520498 for ; Wed, 13 Jan 2016 13:27:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D00F20499 for ; Wed, 13 Jan 2016 13:27:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760095AbcAMNVg (ORCPT ); Wed, 13 Jan 2016 08:21:36 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:34515 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757795AbcAMNVZ (ORCPT ); Wed, 13 Jan 2016 08:21:25 -0500 Received: by mail-wm0-f49.google.com with SMTP id u188so297582022wmu.1 for ; Wed, 13 Jan 2016 05:21:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cEtPs1Nob9/7JAS+0Xmj4sxcjiqiCEuY0mCGhW9Qsf4=; b=GvShU9ERFYu5OIqe3S2GNRwB/VLQpq+S7MBlXdBJPBWSb2T6rGOuTlaZZQEgi1Y20g D0NmaFCJiMSvtHLZ4UAQ6EtYyum65HnZnHK0w8zHXFTPIGyNtSO8qOIHIIe6itnUhYAb yoQMIk1sBbuVmk76eF/To5k3M5BRMcKzCR+LPu3h7/s/rBYtv/zX4pWZoiHfVjdiRvL1 PIyY0UIjvoO/x9vmOoohnOcnllkltUo3uUZJQu1+yQ9jkI8SkPr64KPmNOxwAinG7LkP SAKWdeDyiDk2frYltgf2leAdNBFmBE1ww0ZYdIqDiZtHamHovw85+vGP4HNV83ctP8gC WfLw== 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=cEtPs1Nob9/7JAS+0Xmj4sxcjiqiCEuY0mCGhW9Qsf4=; b=RzSdjUTto/wr89PUs2hsPOTVeiF7LdOzNe6LQuV5s5Fkrj90QAeEmWwtt9dMY2iFgq fpeKHfQLyoL8Af8TAoB64wfAORwpONCWzBOWw4i7D3N6cuJoPS70YMBnpp4TB6Ljo4Ef 302DSt2X130z6uqbdtHNiE3gMrfvGp9kPbKLPWD9jCV1IE2E/CvigR7wraSD73zeVcZ1 +hBkcIHhVTt7IWF9xLPJ7NAV9CwBjdVRU7e54dQxq7NQ7FI8Brf6Rg8NTaCmXoYb2c1c B064f2CgsFhjZ/gLcTYEr00pKm0sBcGRyk2tVYktL6+s49Ed48aG5ZzyWdH6Cc5kT/HM 7D+w== X-Gm-Message-State: ALoCoQkpcZ0dUpaq8rWNhqB7toR/Qdwjft61qKC4Zc0yjDFRs6V4YesAge3ZVzQ11HKVK9o8lda81JItn5/jSTyeK0Full8G2A== X-Received: by 10.28.132.74 with SMTP id g71mr27320243wmd.100.1452691283891; Wed, 13 Jan 2016 05:21:23 -0800 (PST) Received: from tn-HP-4.semihalf.local (cardhu.semihalf.com. [213.17.239.108]) by smtp.gmail.com with ESMTPSA id y124sm8858741wmg.3.2016.01.13.05.21.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jan 2016 05:21:23 -0800 (PST) From: Tomasz Nowicki To: bhelgaas@google.com, arnd@arndb.de, will.deacon@arm.com, catalin.marinas@arm.com, rjw@rjwysocki.net, hanjun.guo@linaro.org, Lorenzo.Pieralisi@arm.com, okaya@codeaurora.org, jiang.liu@linux.intel.com, Stefano.Stabellini@eu.citrix.com Cc: robert.richter@caviumnetworks.com, mw@semihalf.com, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, tglx@linutronix.de, wangyijing@huawei.com, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, jchandra@broadcom.com, jcm@redhat.com, Tomasz Nowicki Subject: [PATCH V3 03/21] pci, acpi, mcfg: Provide generic implementation of MCFG code initialization. Date: Wed, 13 Jan 2016 14:20:49 +0100 Message-Id: <1452691267-32240-4-git-send-email-tn@semihalf.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452691267-32240-1-git-send-email-tn@semihalf.com> References: <1452691267-32240-1-git-send-email-tn@semihalf.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_BRBL_LASTEXT, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 First function acpi_mcfg_check_entry() does not apply any quirks by default. Last 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 Tested-by: Suravee Suthikulpanit Tested-by: Jeremy Linton --- drivers/acpi/mcfg.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/acpi/mcfg.c b/drivers/acpi/mcfg.c index 5ecef20..fad9917 100644 --- a/drivers/acpi/mcfg.c +++ b/drivers/acpi/mcfg.c @@ -57,3 +57,29 @@ int __init acpi_parse_mcfg(struct acpi_table_header *header) return 0; } + +int __init __weak acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg, + struct acpi_mcfg_allocation *cfg) +{ + 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); +}