From patchwork Tue Oct 27 16:38:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 7498291 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B22429F327 for ; Tue, 27 Oct 2015 16:45:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C01D7207C8 for ; Tue, 27 Oct 2015 16:45:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3683208CB for ; Tue, 27 Oct 2015 16:45:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965146AbbJ0Qj2 (ORCPT ); Tue, 27 Oct 2015 12:39:28 -0400 Received: from mail-lf0-f48.google.com ([209.85.215.48]:32951 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932551AbbJ0QjX (ORCPT ); Tue, 27 Oct 2015 12:39:23 -0400 Received: by lffv3 with SMTP id v3so175257442lff.0 for ; Tue, 27 Oct 2015 09:39:22 -0700 (PDT) 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=4lPR4u+K8Sl4pDhsXSm0TKaYwtbeAc8jEWaGuiMSI1s=; b=vUbMax5NemEEfFDLzWnVEKUQ9lt8aSWx/X68a9RcGaZm449WU1IjqwqxEPHxe8NXp4 bVqWYYq/3iLucOCg7ccCBPiUNhHw+GBnGF3V/cT+BRir04meh7AQLwr/D5ipH7fB52FP XVpvK6rTxBv3jTP/D0U7xisFkz6/0xHC0Cr2RIx+C1AXzer96LbzfRzphg/KByNEbHju r20LE3veumMyfUSTg+mJ4vSG836C4nqmtuxO1S10ZbB/uv4pYYoe18fMdLHgVKhkqtVo 2VL8vwdiAZ+D4zS94cXe9N2vNNJVKNDt6y8wG28b5mqCCxjVI+MB7aYih4IWYhTXyNCB IaDg== 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=4lPR4u+K8Sl4pDhsXSm0TKaYwtbeAc8jEWaGuiMSI1s=; b=iOgwaURS7yTX0XNhHXmVz4T5lFP1BzfKc3TyBtTMtSjLt6kNoW2cg2nrNMtRjvUOcQ PElC0LuFsOPWRqDkQFxJmQ8QYwJHTB9THbZjPqYgc9bd4P7I9jb8KxD7S5n5jKDw0Qbe rxJOTUbmkTbgCUDxZhjd8TVcSThIXE1UI1ko6/Qoy6H1e8aVTRz9syjj7U7saDy4XLiB xdkx04LqK+ocz8gCzWfNpYaAOccCRvlT++XJwcBgp3ZhdUCCERho6q/AqTinBlU0g1Il vi+998odL8xJe6hDk6HvfRveEJq+tKTFgmol2ekqDgcpbNUEMNlGbtA1d/939mYPkHDV R/5w== X-Gm-Message-State: ALoCoQkdq9OaCcaI+Wg+eK3VuebeQ19ate2dgMWo9SuMKQK9GyQctvHMTov1bygh7KsWvJtGXAg9 X-Received: by 10.25.21.83 with SMTP id l80mr14210131lfi.79.1445963962467; Tue, 27 Oct 2015 09:39:22 -0700 (PDT) Received: from tn-HP-4.semihalf.local ([80.82.22.190]) by smtp.gmail.com with ESMTPSA id kk6sm6988609lbc.48.2015.10.27.09.39.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Oct 2015 09:39:21 -0700 (PDT) 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 Cc: jiang.liu@linux.intel.com, robert.richter@caviumnetworks.com, Narinder.Dhillon@caviumnetworks.com, ddaney@caviumnetworks.com, Liviu.Dudau@arm.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, Tomasz Nowicki Subject: [PATCH V1 03/11] pci, acpi, mcfg: Provide generic implementation of MCFG code initialization. Date: Tue, 27 Oct 2015 17:38:34 +0100 Message-Id: <1445963922-22711-4-git-send-email-tn@semihalf.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445963922-22711-1-git-send-email-tn@semihalf.com> References: <1445963922-22711-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=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 --- 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); +}