From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ie0-f173.google.com ([209.85.223.173]:35184 "EHLO mail-ie0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751248AbbGKUQk (ORCPT ); Sat, 11 Jul 2015 16:16:40 -0400 Received: by iecuq6 with SMTP id uq6so214662625iec.2 for ; Sat, 11 Jul 2015 13:16:39 -0700 (PDT) Date: Sat, 11 Jul 2015 15:16:34 -0500 From: Bjorn Helgaas To: ravikiran gummaluri Cc: linux-pci@vger.kernel.org, Pratyush Anand , Bharat Kumar Gogada Subject: Re: PCIe support for ARM64 Message-ID: <20150711201634.GA24416@google.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Sender: linux-pci-owner@vger.kernel.org List-ID: [+cc Pratyush, Bharat] On Fri, Jul 10, 2015 at 11:18:10AM +0000, ravikiran gummaluri wrote: > Bjorn Helgaas google.com> writes: > > > > > On Fri, Jun 19, 2015 at 12:43 AM, ravikiran gummaluri > > xilinx.com> wrote: > > > HI > > > > > > I am developing PCIe root port driver for Xilinx device. We have used > > > following patch for ARM64 bit support > > > "https://lkml.org/lkml/2014/7/3/764". The link explains it as temporary > > > patch and main line will be updated soon with those changes. We have not > > > seen the changes till now. Can you let us know when we can expect the > > > changes in mainline? We are planning to push our drivers to mainline. > > > > There is PCI support for ARM64 in mainline: > > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/? > id=d1e6dc91b532 > > > > There is also a Xilinx driver already: > > > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/ > pci/host/pcie-xilinx.c > > > > I don't know if your device is similar to the AXI device, but it would > > be good if you can share or modify that driver instead of adding a new > > one. > > > > As with several other drivers, the current pcie-xilinx.c uses > > pci_common_init_dev(), so it only works on ARM (not ARM64). This is a > > known issue, and people are working on making these drivers less > > arch-specific. > > > > Bjorn > > > > Thanks Bjorn. pcie-xilinx.c is AXI device. Now we are developing for > different device using pcie-xilinx.c as reference. When we trying to > compile our new driver with latest kernel we are getting compilation > problems for struct hw_pci and struct pci_sys_data for ARM64. These > structures are not defined in ARM64. The following patch has the structure > definitions "https://lkml.org/lkml/2014/7/3/764". We have used this patch > and able complete our development. Now for up streaming it we need this > patch in main line. From your discursion we understood that some work is > going on ARCH independent API and structure. When can we expect them in > mainline? Pratyush already answered this: Please have a look to the latest kernel and try to see what is available for ARM64 PCIe. You may see drivers/pci/host/pci-xgene.c as reference. I see that there is already a driver for xilinx PCIe controller with ARM platform. drivers/pci/host/pcie-xilinx.c If it is the same device on ARM64, then you need to take similar approach what is being discussed for designware on ARM64. http://marc.info/?l=devicetree&m=143394380815743&w=2 My advice is to adapt your driver so it works using the interfaces and structures in v4.2-rc1 and post that. As Pratyush mentioned, the X-Gene driver should be a good place to start. There will likely be changes to the way we handle arch- and platform- specific data, but you don't need to wait for those to be completed. When people make changes like that, it is always their responsibility to update all the code in the tree to match. So once your code is in the tree, you don't have to worry about updating your driver to follow those changes. On the other hand, if you do wait for those changes to be completed, you never know when or if they ever will be done, and you'll have to do your own updates before posting your driver. Bjorn