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: 48981 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 15B502121F for ; Tue, 26 May 2015 12:54:34 +0000 (UTC) Received: by wifx6 with SMTP id x6sf10671706wif.1 for ; Tue, 26 May 2015 05:54:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=YHBquiB0YX/vsXFDC+vLDUTfv2RbYBxlROCDHZbNcZc=; b=BxVEBgbIuOl0NnMkr1yjPcLB545RolgmnNylNYDfDoX1Rg1SJBVo6PYLhOE1AbW1hf LTPjDeeWzBhoQVwMip3gqtUlJcPwpVGltIqRiYAJkVDhzEGVKF/CT/w0NNYJ0zGOHGSP u445eqsFr4V6Wn6QP1i/KSapJJoVkGyi9jdj4d7UxMZUTKw5AmqsmUQusEUpO5n6KAF/ 2wtAqQ/wePbvwuZh8aJ8n3s2N+e9P+Y+Huv4upvCnV96/mo+o0Fu7pf1pAoEkzoUnkDL VQUBvwjqgWHLQhjW7DP/CCIQ0iHQvhsyT7a3lpjaIp8CfJoeCfWytMR37i68jbFAbGIE tHTA== X-Gm-Message-State: ALoCoQkCHyx7u4nZXJVOsmkq0XTeo++Hbpx9iqKSq0rRwyk9X7s7+7KaCOocgQqUEIdbCO7sRga5 X-Received: by 10.112.28.111 with SMTP id a15mr27210045lbh.21.1432644873356; Tue, 26 May 2015 05:54:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.71 with SMTP id la7ls822760lab.25.gmail; Tue, 26 May 2015 05:54:33 -0700 (PDT) X-Received: by 10.112.56.42 with SMTP id x10mr20134635lbp.123.1432644873197; Tue, 26 May 2015 05:54:33 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id h4si409460lbm.158.2015.05.26.05.54.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2015 05:54:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbcmx3 with SMTP id mx3so69630148lbc.1 for ; Tue, 26 May 2015 05:54:33 -0700 (PDT) X-Received: by 10.152.6.69 with SMTP id y5mr22232656lay.72.1432644873084; Tue, 26 May 2015 05:54:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp2527351lbb; Tue, 26 May 2015 05:54:32 -0700 (PDT) X-Received: by 10.70.129.202 with SMTP id ny10mr48187198pdb.107.1432644871314; Tue, 26 May 2015 05:54:31 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id iu4si20798096pbb.143.2015.05.26.05.54.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2015 05:54:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; 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-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 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.43 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.1 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.220.43 listed in wl.mailspike.net] 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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); +}