From patchwork Thu Apr 9 01:36:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 6183231 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 972F1BF4A6 for ; Thu, 9 Apr 2015 01:36:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 991432037F for ; Thu, 9 Apr 2015 01:36:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E20B420395 for ; Thu, 9 Apr 2015 01:36:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932164AbbDIBgN (ORCPT ); Wed, 8 Apr 2015 21:36:13 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:64094 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932226AbbDIBgM (ORCPT ); Wed, 8 Apr 2015 21:36:12 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NMI00J0LN4ATH70@mailout2.samsung.com> for linux-pci@vger.kernel.org; Thu, 09 Apr 2015 10:36:10 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.112]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id AC.C3.28411.987D5255; Thu, 9 Apr 2015 10:36:10 +0900 (KST) X-AuditID: cbfee68e-f79c56d000006efb-68-5525d789f23d Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 14.10.03871.987D5255; Thu, 9 Apr 2015 10:36:09 +0900 (KST) Received: from [10.252.81.186] by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NMI00BOON49WM90@mmp2.samsung.com>; Thu, 09 Apr 2015 10:36:09 +0900 (KST) Message-id: <5525D789.2060200@samsung.com> Date: Thu, 09 Apr 2015 10:36:09 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-version: 1.0 To: Lorenzo Pieralisi , Jisheng Zhang Cc: "robh@kernel.org" , "arnd@arndb.de" , "linux-pci@vger.kernel.org" , Liviu Dudau , "bhelgaas@google.com" , "linux-arm-kernel@lists.infradead.org" , CPGS Subject: Re: [Query] Direction of adding arm64 support to PCIe designware driver References: <20150403174621.02681f0d@xhacker> <20150408103222.GB22376@red-moon> In-reply-to: <20150408103222.GB22376@red-moon> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRmVeSWpSXmKPExsWyRsSkQLfrumqowZ1/jBZ/Jx1jt1jSlGHx 8pCmxbvju1ksNj2+xmpxdt5xNosDS9tZLN78fsFu8X/PDnYHTo8189Ywevz+NYnRY8GmUo9N qzrZPDYvqfeYvPAis0ffllWMHp83yQVwRHHZpKTmZJalFunbJXBlLL/UxlbQIlNx7uZqlgbG s2JdjJwcEgImEm07drNC2GISF+6tZ+ti5OIQEljKKLHp7EdWmKKpv1uYIBLTGSW2XzsJ5Txg lJgzayojSBWvgJbEtbkvwDpYBFQlbvxvZQGx2QR0JLZ/O84EYosKhElMvPmYFaJeUOLH5Htg NSICERJrf58CW80scJhJ4u+C6cxdjOwcwgIBEicrQEqEBPwlPp2fxwxicwroSRzduZG9i5ED qFxP4v5FLZAws4C8xOY1b5lBpkgIfGWXeNO8hQXiHAGJb5MPsYDUSwjISmw6wAzxl6TEw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vT+RGYp0eR8YFrKK4k3NDYxM7I0Mje0MDI2VxLnnaMrFyok kJ5YkpqdmlqQWgTTx8TBKdXAqGhZs7+p4dWdQC7Be9LuJ1U5fPI4pHaybV5huePneZ3Qi0GP tN+WBTc7zJCNWFkkoOYleTH+hcGtw7fWMO1uk+O4vjVqobjrzSnFVov9PGZv+LlU9H7ajUc5 C5N2O71yW3NkwsVH8WFKHbGSW9v/pW6Qkzl9ctmVD08rtqq6fP7lpubp/+j0NCWW4oxEQy3m ouJEAEk0uyITAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected 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=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 Hi. On 04/08/2015 07:32 PM, Lorenzo Pieralisi wrote: > Hi Jisheng, > > On Fri, Apr 03, 2015 at 10:46:21AM +0100, Jisheng Zhang wrote: >> Hi all, >> >> Currently, the pci designware driver still lacks of arm64 support and I noticed >> that many works are done to achieve this goal. >> >> Some patches are merged and some are under discussion. And Per my understanding, >> even w/ these patches merged, the driver still doesn't support arm64. Could you >> please kindly point out the direction to add arm64 support to the PCIe >> designware driver? > > We should remove pci_sys_data dependency since ARM depends on that. > I removed it from a couple of places already (eg pci_mmap_page_range). > > Now, pcibios_align_resource and pcibios_msi_controller need patching. > > I have a patch for pcibios_align_resource() (I am waiting for Yijing > Wang series to get merged so that we can move the align_resource > function pointer in the host bridge): > > https://lkml.org/lkml/2015/4/3/171 > > For MSI, code converted to use CONFIG_PCI_MSI_IRQ_DOMAIN should > not need pcibios_msi_controller ARM function, but if we still compile > that function in we do need pci_sys_data on ARM, so we have to have > it even if it can be dead code in some platforms, I have to vet all > ARM PCI host controllers to check, but removing it would break MSI > support. > > Does it help ? MSIs are the most important change required, > align_resource() pointer can be sorted out easily once Yijing's > code gets in. I'm not sure whether my working is right..I used the pcie_port instead of pci_sys_data. static inline struct *sys_to_pcie(struct pci_sys_data *sys) -> static inline struct *sys_to_pcie(struct pcie_port *pp) And add "struct list_head resources" as member of pcie_port. So i got the below message. [ 2.396822] exynos-pcie 156b0000.pcie: Link up! [ 2.397011] exynos-pcie 156b0000.pcie: PCI host bridge to bus 0000:00 [ 2.397021] pci_bus 0000:00: root bus resource [io 0x1000-0xffff] [ 2.397026] pci_bus 0000:00: root bus resource [mem 0x0c011000-0x0ffffffe] [ 2.397033] pci_bus 0000:00: root bus resource [bus 00-ff] [ 2.409000] pci 0000:00:00.0: BAR 8: assigned [mem 0x0c200000-0x0c7fffff] [ 2.409009] pci 0000:01:00.0: BAR 2: assigned [mem 0x0c400000-0x0c7fffff 64bit] [ 2.409509] pci 0000:01:00.0: BAR 0: assigned [mem 0x0c200000-0x0c207fff 64bit] [ 2.410008] pci 0000:00:00.0: PCI bridge to [bus 01] [ 2.410027] pci 0000:00:00.0: bridge window [mem 0x0c200000-0x0c7fffff] Well, i needs to work more and get the knowledge for pcie. (It's not working completely.) If somebody is working this, it's great..otherwise I will send the RFC patch to get comment for my code. If i'm missing something, let me know, plz. Best Regards, Jaehoon Chung > > Lorenzo > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > --- 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/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h index 91484a9..1cde583 100644 --- a/drivers/pci/host/pcie-designware.h +++ b/drivers/pci/host/pcie-designware.h @@ -53,6 +53,7 @@ struct pcie_port { struct irq_domain *irq_domain; unsigned long msi_data; DECLARE_BITMAP(msi_irq_in_use, MAX_MSI_IRQS); + struct list_head resources; }; and just used pci_scan_root_bus(). (before call this, it's added the offset of resources..)