From patchwork Tue May 26 12:49:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 6479801 Return-Path: X-Original-To: patchwork-linux-acpi@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 BC9F4C0433 for ; Tue, 26 May 2015 12:53:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D5CEB204A7 for ; Tue, 26 May 2015 12:53:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EAEC120626 for ; Tue, 26 May 2015 12:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753172AbbEZMxf (ORCPT ); Tue, 26 May 2015 08:53:35 -0400 Received: from [209.85.192.181] ([209.85.192.181]:33828 "EHLO mail-pd0-f181.google.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753173AbbEZMxa (ORCPT ); Tue, 26 May 2015 08:53:30 -0400 Received: by pdbki1 with SMTP id ki1so48618287pdb.1 for ; Tue, 26 May 2015 05:50:34 -0700 (PDT) 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=vNNkNAFiwv7ugjcuRPSmxvhIrYtrlfbKdE//QnSpvfw=; b=gciR/dqeq8qtimx2D26nFCfIBBK8NoQImqDRB5pq0gCV4fRpRw6QVcKOVOjuwhIYRL 6gkgimWfxmOGk081IamYYclNIoA88zMi1LlZk1bRzJ8ebPV1Otby7d2JlGiiaqESLq5p Sl0sgrEy3Hod0BH/IMyjdrbMI+Cw//YcrCyzsT3PajJWaerxDPEFyvRjFTKDG7ID4wfE /Haf7YN6vklYm6Gcn2h54VRPPF4TCOeADVHG/lGrWxtcA736cbCorQ26Buc7/1Hu07+j m5mX+mKvUfH95yEz6A2nIpnBA+qsws7DQcIaSL0Pp7Wrbl1nZ8h/dlo5FBQokpsylgnH OtGg== X-Gm-Message-State: ALoCoQmzp1j0h4Lr0DRyoYShqW23G2l50fbWGx2oIoMtESUvHdr0avadi+U8mwOK24w9ZFgkIxQ+ X-Received: by 10.68.191.167 with SMTP id gz7mr49115754pbc.43.1432644634062; Tue, 26 May 2015 05:50:34 -0700 (PDT) Received: from localhost ([180.150.153.56]) by mx.google.com with ESMTPSA id pd10sm13049639pdb.66.2015.05.26.05.50.32 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 26 May 2015 05:50:33 -0700 (PDT) From: Hanjun Guo To: Bjorn Helgaas , Arnd Bergmann , Catalin Marinas , Will Deacon , "Rafael J. Wysocki" Cc: Jiang Liu , Liviu Dudau , Thomas Gleixner , Yijing Wang , Lorenzo Pieralisi , Tomasz Nowicki , Suravee Suthikulpanit , Mark Salter , 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, Hanjun Guo Subject: [PATCH 06/11] pci, acpi, mcfg: Provide generic implementation of MCFG code initialization. Date: Tue, 26 May 2015 20:49:19 +0800 Message-Id: <1432644564-24746-7-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432644564-24746-1-git-send-email-hanjun.guo@linaro.org> References: <1432644564-24746-1-git-send-email-hanjun.guo@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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 From: Tomasz Nowicki 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 Signed-off-by: Hanjun Guo Tested-by: Suravee Suthikulpanit --- drivers/acpi/mcfg.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/acpi/mcfg.c b/drivers/acpi/mcfg.c index 63775af..745b83e 100644 --- a/drivers/acpi/mcfg.c +++ b/drivers/acpi/mcfg.c @@ -55,3 +55,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); +}