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: 7498161 Return-Path: X-Original-To: patchwork-linux-arm@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 36F8ABF90C for ; Tue, 27 Oct 2015 16:43:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F624208DA for ; Tue, 27 Oct 2015 16:43:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2085207C8 for ; Tue, 27 Oct 2015 16:43:50 +0000 (UTC) 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 1Zr7KA-0000w8-CR; Tue, 27 Oct 2015 16:42:14 +0000 Received: from mail-lf0-x232.google.com ([2a00:1450:4010:c07::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zr7Hk-0006OH-Je for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2015 16:39:46 +0000 Received: by lfbn126 with SMTP id n126so140177723lfb.2 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=KSb4ioRkA4iqfi0jgDL2Lr+TwDmHNUCfwbB3nGA1sMZ4FNq/BJz+g1uCcfIfposs6c wUm7aAjPcbn9wH0w+mFwuP0ot0LOXCoSHE3D8GDDFTiA75iQnDj7e4wrO6SLU9CkB51m wdRc7Qt3EeJoj7etWHU7MTlua0hf1Fl7jLIOLMdez6zebKHyLwgIbaalvDK7L5Q24lkR s0Zm9VAh1LBCtyJu7hi26YBR9y6R4OTjFx8+q+3Lu4gik/GwFHgkyRANpxqq7o+y/lHt tT7txeqDCZ86zEtkQZTyvo2a4ywiYfUmG3waN1OyPT/021t7HuFrTmdH7nG1nqgi6hn0 QfAQ== X-Gm-Message-State: ALoCoQkzFpyCZaVfvudLyX7yCWUjNK8G7+lQ2rVIQWaA0JkTlWLFl7b3wEg3eq3SQZiA1TUjGjoj 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151027_093944_899471_E17CABDA X-CRM114-Status: GOOD ( 12.02 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, linux-pci@vger.kernel.org, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, Narinder.Dhillon@caviumnetworks.com, linux-acpi@vger.kernel.org, robert.richter@caviumnetworks.com, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, wangyijing@huawei.com, Tomasz Nowicki , tglx@linutronix.de, jiang.liu@linux.intel.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 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); +}