From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757225AbbIVLmh (ORCPT ); Tue, 22 Sep 2015 07:42:37 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:63965 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751415AbbIVLmf (ORCPT ); Tue, 22 Sep 2015 07:42:35 -0400 From: Arnd Bergmann To: Ley Foon Tan Cc: Bjorn Helgaas , "linux-kernel@vger.kernel.org" , Linux-Arch , linux-pci@vger.kernel.org Subject: Re: [PATCH 1/2] nios2: Add architectural support for PCIe Date: Tue, 22 Sep 2015 13:42:28 +0200 Message-ID: <5408024.XroFc5QNep@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1442906367-10935-1-git-send-email-lftan@altera.com> <65590637.5YmBIDOvTf@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:ziT9CcM/DM1D3CKISlsPoLPoGwysBZpmkLuRgDnIBQT2svAh9mk pTz3IEialmE+nSKCvRXntlOomMCsyn6D0h0rVRmKDCPi2ZDz8OsqsYPh23ye8BSH2CNKrbM /rF073AktqWmuDubPr6hyR06R2fhv715DCugkeuWFOQaWOZoBU3d5UoYHHHmqX/Trmioiam qjGvK6ByOZ09F/Kgb8jvQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:P20iJx7Yvyg=:JoM9NIniaKCRnY6PkWbsPV 2fuGl9TMt6gaGGPSM9WWUrmxF/TEamEO+OAVQlYc+hq4nnGrCvczocwEp0hnar6fHxxBdD1ta +04rllBG2G9LT7lWhd2dMTYl846KrRsUs2+Tun7xW1O6EZ9mNie7l/JpC34+ilq3M49nmE9GX iolwqhReXkrr2m60vfp9qt2RPLjc+9TFU40XkHq35Z+D+oVVZ1LexVmiUeVACB8SFoLmQsSv8 /uYq/Zc96OLzHPklOvjMtZUZLCwFPdrD3WNV+LHi8eCZdKKRgaPayWFIeBLXA177XCWExBQ0Z OWRb+LJ4/a+uxPuLi7eFdyEVaPVXs0YSwTOvSTeXAJo9OBl989H8vA/zPjUEnTVTzcpIGNvIc akAk87HkSqaj0nN75xl8RB8BxGOivOF6KtnfDUpUKvQKvPrNIKyQ3F3hraj19E40DFWw4edaN qPP691bcDo7FId5wE79sDuEMmV8/aptBy6ttBhEh8Popm8cqJq986F5eZ70lc9JqMFT4/t+dN YhuYGayuosVyJOEI88J185qO4fUV9+wpHn9yyt27JqjkRFZy4N9b3YO0MPpw1y3TIFDlrejfv gGjQk57PB+2tbPw5Bi5meNfsnbJxscB95Z6oegz7Gpym7gcXCkoX6VXvyuwVPujcQJtwX3hgL qDLKlAK7yi5ZoMGIkHJu4q1JhMrW/lIrfUpJIxe18REhhQJKvqCL9YA7e8dX6IglL3IQkl7yJ +XPzVE8+b3/DDgtv Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 22 September 2015 18:53:50 Ley Foon Tan wrote: > On Tue, Sep 22, 2015 at 4:18 PM, Arnd Bergmann wrote: > > On Tuesday 22 September 2015 15:19:26 Ley Foon Tan wrote: > > I might be missing something though. Bjorn? > > > >> @@ -14,7 +14,7 @@ > >> #include > >> #include > >> > >> -/* PCI is not supported in nios2, set this to 0. */ > >> +/* PCI I/O space is not supported, set this to 0. */ > >> #define IO_SPACE_LIMIT 0 > >> > >> #define readb_relaxed(addr) readb(addr) > > > > It might be useful to enable this, just in case someone connects > > a PCI host bridge that does support I/O space. > > > > Which host bridge do you use? Are you sure there is no I/O space? > > Most of them use a set of translation windows to set up a mapping > > between bus address (memory, config and io space) and physical > > (mmio) space. > > I'm using Altera PCIe IP. But, you are right. We should enable this, > because it shouldn't limited to support Altera PCIe only. > BTW, any rule/requirement for the IO_SPACE_LIMIT? If you want to allow just one PCI host bridge, set it to 0xffff, otherwise use 0xfffff (for up to 16 bridges) > And PCIBIOS_MIN_IO should be non-zero if we enable IO_SPACE_LIMIT? If you define pcibios_align_resource() as an empty function, that can remain zero as well, it's only meant to stay out of the way of ISA devices. > >> diff --git a/arch/nios2/include/asm/pci.h b/arch/nios2/include/asm/pci.h > >> new file mode 100644 > >> index 0000000..f2cba05 > >> --- /dev/null > >> +++ b/arch/nios2/include/asm/pci.h > > > > What happens if you use the asm-generic header? If there is something > > missing in it, we can try to get it to do the right things. > All the defines in arch/nios2/include/asm/pci.h are required by PCI framework. > It will trigger undefined symbols/define error if without them. Seem > all architectures must provide all these defines. > So, we can consider to add default defines for these in asm-generic. I think that would be good, yes. We probably picked defaults for the asm-generic version that are enough to build with CONFIG_PCI disabled, but there are useful defaults for the other case as well. Most architectures that use the file don't support PCI, so you can just add stuff inside of #ifdef CONFIG_PCI. For the remaining 13 architectures (git grep -l generic/pci.h | wc), see whether there are conflicts first. The normal way would be to have the arch specific definition come before the #include, and then do something like #ifndef pci_proc_domain #define pci_proc_domain pci_proc_domain static inline int pci_proc_domain(struct pci_bus *bus) { #ifdef CONFIG_PCI_DOMAINS_GENERIC return pci_domain_nr(bus); #else return 1; } #endif Arnd