From patchwork Fri Apr 17 07:14:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 47252 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3D44620553 for ; Fri, 17 Apr 2015 07:17:17 +0000 (UTC) Received: by wiun10 with SMTP id n10sf2102570wiu.1 for ; Fri, 17 Apr 2015 00:17:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=ooFflFwXEA6F6D4sL/1S+iNcl41ESPeVTtAR3FjWYQ8=; b=aXzts7QAd2APuzJg0BpL7BtchhmGiitgMDxZwWpmoxcbW/zetkffbFppjtiMgHqkaF U9mltEGSiV/gIi6aOl+CJ9XDpUf/Q0T95rc3tfb5ige77I/WWagR9SM4ZkW0sTFB79vl X9YxIPsr5qLDgZHzV+p53P8COLxL10zMSojxUOk9TQowZs1bsJjMBfZ8TTr5uTKGJdeV NpdGy00SRSpRMPOmEo/tn8lG2S06+5mpwr+vPNED38D7PnAx4qb4aCsu6yllXhaMzFJB ZaeNhXJP5HZAzjUnxp+qcE4eCUcfuwnl3OYnNgKF1g1TPLbiwPh9CliFKGCKnDcS+aS2 CmQw== X-Gm-Message-State: ALoCoQkmeXOCVyISH249kk5Atx1ToGVO/zuqbldCm8iKd4T6EK99oBC6+RMi6dJua0vMZWdOMWLx X-Received: by 10.152.26.134 with SMTP id l6mr735102lag.10.1429255036516; Fri, 17 Apr 2015 00:17:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.38 with SMTP id cb6ls368441lad.97.gmail; Fri, 17 Apr 2015 00:17:16 -0700 (PDT) X-Received: by 10.152.234.139 with SMTP id ue11mr1372248lac.28.1429255036348; Fri, 17 Apr 2015 00:17:16 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id ao1si8111148lbd.172.2015.04.17.00.17.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 00:17:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lbcga7 with SMTP id ga7so76131438lbc.1 for ; Fri, 17 Apr 2015 00:17:16 -0700 (PDT) X-Received: by 10.152.5.72 with SMTP id q8mr1317398laq.73.1429255036209; Fri, 17 Apr 2015 00:17:16 -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.67.65 with SMTP id l1csp3561770lbt; Fri, 17 Apr 2015 00:17:15 -0700 (PDT) X-Received: by 10.68.69.47 with SMTP id b15mr2926449pbu.117.1429255033732; Fri, 17 Apr 2015 00:17:13 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si15545221pdi.58.2015.04.17.00.17.12; Fri, 17 Apr 2015 00:17:13 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752949AbbDQHPx (ORCPT + 27 others); Fri, 17 Apr 2015 03:15:53 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]:34197 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752992AbbDQHPs (ORCPT ); Fri, 17 Apr 2015 03:15:48 -0400 Received: by lbcga7 with SMTP id ga7so76107754lbc.1 for ; Fri, 17 Apr 2015 00:15:47 -0700 (PDT) X-Received: by 10.152.22.229 with SMTP id h5mr1343258laf.21.1429254947435; Fri, 17 Apr 2015 00:15:47 -0700 (PDT) Received: from tn-HP-4.semihalf.local ([80.82.22.190]) by mx.google.com with ESMTPSA id yq18sm2215742lbb.47.2015.04.17.00.15.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Apr 2015 00:15:46 -0700 (PDT) From: Tomasz Nowicki To: bhelgaas@google.com, wangyijing@huawei.com, arnd@arndb.de, hanjun.guo@linaro.org, Liviu.Dudau@arm.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, rjw@rjwysocki.net, al.stone@linaro.org, lorenzo.pieralisi@arm.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linaro-acpi@lists.linaro.org, Tomasz Nowicki Subject: [PATCH v5 5/9] pci, acpi, mcfg: Provide generic implementation of MCFG code initialization. Date: Fri, 17 Apr 2015 09:14:54 +0200 Message-Id: <1429254898-32743-6-git-send-email-tomasz.nowicki@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429254898-32743-1-git-send-email-tomasz.nowicki@linaro.org> References: <1429254898-32743-1-git-send-email-tomasz.nowicki@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: tomasz.nowicki@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.178 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 a9338df9..787defe 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); +}