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: 6479871 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 7AEF4C0020 for ; Tue, 26 May 2015 12:55:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7ECB4205C1 for ; Tue, 26 May 2015 12:55:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 958B3204A7 for ; Tue, 26 May 2015 12:55:24 +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 1YxELY-0005LP-Uo; Tue, 26 May 2015 12:52:40 +0000 Received: from mail-pa0-f43.google.com ([209.85.220.43]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YxEJr-0004MU-AF for linux-arm-kernel@lists.infradead.org; Tue, 26 May 2015 12:50:56 +0000 Received: by paza2 with SMTP id a2so83022281paz.3 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=OLyDEtoKanfUSjQ4Svs46iC+I3SCdwZdBP15pXPg1BXzg1DjA0E4sSpvYeG0+KYAcl wU64p50Xv4Ir6PUIb1t9W4QjXTiwAwOtSsCvQBwgZA1ym+hzOuXNx5wqtn42y2VJ+7mj 64oJ8J8UXgbEJbnE75P1Etmz5mzp2oX9BJKquR6ccvxxMwdyVphAalW/GFQX8I0SI13m efJTGwmyU6WelswcdJxjsvHwx8PtX5j6dBnGBExqM6KoIIpiuQ3HUlj1AeaO+EUJr2wd bZsnOaIii1rxn04fJnQB2BY8rR2TYSO2Mk88Exh2Z3clIrDsa41nUznHk4LdNEeKV55A KepQ== X-Gm-Message-State: ALoCoQk8+ZfttG1yYt9KiB97g7bszTRO2pyBHhThxO8DyRJ6sPLSszar8sY6TeOu8ZKa3+H0Bion 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" 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150526_055055_410273_3138AE3B X-CRM114-Status: UNSURE ( 9.95 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.8 (-) Cc: Lorenzo Pieralisi , linaro-acpi@lists.linaro.org, linux-pci@vger.kernel.org, Liviu Dudau , linux-kernel@vger.kernel.org, Tomasz Nowicki , linux-acpi@vger.kernel.org, Hanjun Guo , Suravee Suthikulpanit , Mark Salter , Yijing Wang , Thomas Gleixner , Jiang Liu , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, 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 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); +}