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: 6479791 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 E2135C0020 for ; Tue, 26 May 2015 12:53:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E8EBC20624 for ; Tue, 26 May 2015 12:53:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 02B1220621 for ; Tue, 26 May 2015 12:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753174AbbEZMxc (ORCPT ); Tue, 26 May 2015 08:53:32 -0400 Received: from [209.85.220.53] ([209.85.220.53]:35120 "EHLO mail-pa0-f53.google.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753171AbbEZMxa (ORCPT ); Tue, 26 May 2015 08:53:30 -0400 Received: by pacwv17 with SMTP id wv17so92163752pac.2 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=VUJfc8CINFNa30R7Jl9bbayN+83dVyHI7h2gmOSmnYoBp/fJZhC2eMEhzxCADlBPvh 9ZCgwOXUz/1jnFbu1QZku+0Emg9wvQ0uN6+tub75DIi8j2507UiyKEP+wMHG8Gm9pyZQ JYjrfxy5896d/kZU1S1VRqt0QZkZZn36VNzuixl/T7WX/pZw+h45qDFtMsOtvJi1lROk KJQ2UbFrJekBK59odsctFGD+OmJR0FCaaY2oCNlYsCqWpVKsxPLY2JeKapo1w+MHtNNF k0AwvUltlVAh9z0xJwlgZYr2pj9HsR7jqwwIiXCKmTixoHw+1e8OydBw6ATkfqlF6B/D TNtg== X-Gm-Message-State: ALoCoQnBItena9Ae3akrhxHyCYWUNpRkjwHl8nvAym52FEO/6SYYFV8ey/cXbaxU+Bl6qChLUoOm 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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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); +}