From patchwork Tue Nov 22 13:58:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 9441151 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4B10360237 for ; Tue, 22 Nov 2016 13:58:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E61E2853B for ; Tue, 22 Nov 2016 13:58:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 332C22853E; Tue, 22 Nov 2016 13:58:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID, URIBL_BLACK autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FE9E2853B for ; Tue, 22 Nov 2016 13:58:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932868AbcKVN6S (ORCPT ); Tue, 22 Nov 2016 08:58:18 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:36927 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932910AbcKVN6R (ORCPT ); Tue, 22 Nov 2016 08:58:17 -0500 Received: by mail-wm0-f43.google.com with SMTP id t79so26604450wmt.0 for ; Tue, 22 Nov 2016 05:58:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=JZprelSGDXXAu2+odBsM+n4njo48+xdh03keM4i8SK0=; b=WS2VauPqAsuxzYsBQexwwRBasuKLyz1MCKswlcQLHtvKnomXR1m+4j7qnYq7ABRsEg u9FsGlIgywiHG6wSnOKXiVApyxSka3ePDYIvhja35yxShBilE4dOoULpiXqL6evjG/jT hghtksC9oQdq7Bz1GtdzMDs0P9ttbE+gSlCNI20k+0zA56Bl+QMwmNo22/rHIR5kZWtd hEL0ijKWJBBgdYd7Mh87kcsfo+tqU9fH1cOUxitHmtYJBAGdikvI1nFEkbufXa8+aQBD CUOdhEedbZ3C7r8rO0E5fFAiGkI8T7+tcxXg8AwiZEENO7wJocOcrsjn7F9FDAbaelmv KNlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=JZprelSGDXXAu2+odBsM+n4njo48+xdh03keM4i8SK0=; b=StCYw9ScaT5IIR1AJ4TBoB+JbQe0rB4CUk5FZq164eldSoCOIo1+YtnzbV9FyrKRXG yjVm7heS48lOXH6Vhk5UHf3ZBp8+PSwuSXmbaKTFlPzFa6l8eo7MrC5FdaMjooNvTPcY AXQWUdMEebPTaDeS2tlwrOi6LoDEpYrnNUtIqph26IG5Q4+5yo2EzrLjEsfVVnwStnFh IDsammWOglPulngTpBy6wuk2aNBXMOOff4NJgw8cgSQ2EGVg1Ib46zBitsZrt9QMWA1f UytsIFKEyrA2ccovFH1lV4vnoCUqcCez7EYNZPaPJckRkQbLukKtxafvoOm+LOwTC/LP cvZw== X-Gm-Message-State: AKaTC01oZ5PF81X9rke6Dsx1izznd3fR+TCchXycvzHxLvshU2TaTOQjjkhNiGe8LU5Big== X-Received: by 10.25.129.148 with SMTP id c142mr4381266lfd.136.1479823095415; Tue, 22 Nov 2016 05:58:15 -0800 (PST) Received: from [10.0.0.85] (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id i129sm6275150lfd.8.2016.11.22.05.58.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Nov 2016 05:58:14 -0800 (PST) Subject: Re: [PATCH V6 2/2] PCI/ACPI: hisi: Add ACPI support for HiSilicon SoCs Host Controllers To: Dongdong Liu , helgaas@kernel.org, arnd@arndb.de, rafael@kernel.org, Lorenzo.Pieralisi@arm.com, wangzhou1@hisilicon.com, pratyush.anand@gmail.com References: <1479816529-97410-1-git-send-email-liudongdong3@huawei.com> <1479816529-97410-3-git-send-email-liudongdong3@huawei.com> Cc: linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, jcm@redhat.com, gabriele.paoloni@huawei.com, charles.chenxin@huawei.com, hanjun.guo@linaro.org, linuxarm@huawei.com From: Tomasz Nowicki Message-ID: <026faf89-93de-4238-f69a-ea02c57e5ee0@semihalf.com> Date: Tue, 22 Nov 2016 14:58:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1479816529-97410-3-git-send-email-liudongdong3@huawei.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 22.11.2016 13:08, Dongdong Liu wrote: > PCIe controller in Hip05/HIP06/HIP07 SoCs is not ECAM compliant. > It is non ECAM only for the RC bus config space;for any other bus > underneath the root bus we support ECAM access. > Add specific quirks for PCI config space accessors.This involves: > 1. New initialization call hisi_pcie_init() to obtain rc base > addresses from PNP0C02 at the root of the ACPI namespace (under \_SB). > 2. New entry in common quirk array. > > Signed-off-by: Dongdong Liu > Signed-off-by: Gabriele Paoloni > --- > MAINTAINERS | 1 + > drivers/acpi/pci_mcfg.c | 13 +++++ > drivers/pci/host/Kconfig | 7 +++ > drivers/pci/host/Makefile | 1 + > drivers/pci/host/pcie-hisi-acpi.c | 119 ++++++++++++++++++++++++++++++++++++++ > include/linux/pci-ecam.h | 5 ++ > 6 files changed, 146 insertions(+) > create mode 100644 drivers/pci/host/pcie-hisi-acpi.c > > diff --git a/MAINTAINERS b/MAINTAINERS > index 1cd38a7..b224caa 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -9358,6 +9358,7 @@ L: linux-pci@vger.kernel.org > S: Maintained > F: Documentation/devicetree/bindings/pci/hisilicon-pcie.txt > F: drivers/pci/host/pcie-hisi.c > +F: drivers/pci/host/pcie-hisi-acpi.c > > PCIE DRIVER FOR ROCKCHIP > M: Shawn Lin > diff --git a/drivers/acpi/pci_mcfg.c b/drivers/acpi/pci_mcfg.c > index ac21db3..3297c5a 100644 > --- a/drivers/acpi/pci_mcfg.c > +++ b/drivers/acpi/pci_mcfg.c > @@ -57,6 +57,19 @@ struct mcfg_fixup { > { "QCOM ", "QDF2432 ", 1, 5, MCFG_BUS_ANY, &pci_32b_ops }, > { "QCOM ", "QDF2432 ", 1, 6, MCFG_BUS_ANY, &pci_32b_ops }, > { "QCOM ", "QDF2432 ", 1, 7, MCFG_BUS_ANY, &pci_32b_ops }, > +#ifdef CONFIG_PCI_ECAM_QUIRKS > + #define PCI_ACPI_QUIRK_QUAD_DOM(table_id, seg, ops) \ > + { "HISI ", table_id, 0, seg + 0, MCFG_BUS_ANY, ops }, \ > + { "HISI ", table_id, 0, seg + 1, MCFG_BUS_ANY, ops }, \ > + { "HISI ", table_id, 0, seg + 2, MCFG_BUS_ANY, ops }, \ > + { "HISI ", table_id, 0, seg + 3, MCFG_BUS_ANY, ops } > + PCI_ACPI_QUIRK_QUAD_DOM("HIP05 ", 0, &hisi_pcie_ops), > + PCI_ACPI_QUIRK_QUAD_DOM("HIP06 ", 0, &hisi_pcie_ops), > + PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 0, &hisi_pcie_ops), > + PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 4, &hisi_pcie_ops), > + PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 8, &hisi_pcie_ops), > + PCI_ACPI_QUIRK_QUAD_DOM("HIP07 ", 12, &hisi_pcie_ops), > +#endif > }; > > static char mcfg_oem_id[ACPI_OEM_ID_SIZE]; > diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig > index ae98644..1fbade5 100644 > --- a/drivers/pci/host/Kconfig > +++ b/drivers/pci/host/Kconfig > @@ -301,4 +301,11 @@ config VMD > To compile this driver as a module, choose M here: the > module will be called vmd. > > +config PCI_ECAM_QUIRKS > + bool "PCI ECAM quirks for ARM64 platform" > + depends on PCI_ECAM && ARM64 && ACPI > + help > + Say y here to enable your platform-specific config access that > + is not ECAM compliant. > + ARM64 selects PCI_ECAM for ACPI anyway so we can skip it here. How about selecting PCI_ECAM_QUIRKS from ARM64 Kconfig: I agree with Bjorn, we should not have to turn on platform-specific config options for ARM64 & ACPI. Thanks, Tomasz --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 30398db..9743186 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -105,6 +105,7 @@ config ARM64 select OF_EARLY_FLATTREE select OF_RESERVED_MEM select PCI_ECAM if ACPI + select PCI_ECAM_QUIRKS if ACPI select POWER_RESET select POWER_SUPPLY select SPARSE_IRQ