From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from moutng.kundenserver.de ([212.227.126.187]:57475 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965229Ab3DHVer (ORCPT ); Mon, 8 Apr 2013 17:34:47 -0400 From: Arnd Bergmann To: Thomas Petazzoni Subject: Re: [PATCHv7 08/17] pci: PCIe driver for Marvell Armada 370/XP systems Date: Mon, 8 Apr 2013 23:34:12 +0200 Cc: Bjorn Helgaas , Grant Likely , Russell King , "linux-pci@vger.kernel.org" , "linux-arm" , "devicetree-discuss@lists.ozlabs.org" , Lior Amsalem , Andrew Lunn , Jason Cooper , Maen Suleiman , Thierry Reding , Gregory Clement , Ezequiel Garcia , Olof Johansson , Tawfik Bayouk , Jason Gunthorpe , Mitch Bradley , Andrew Murray References: <1364395234-11195-1-git-send-email-thomas.petazzoni@free-electrons.com> <20130408225741.74fc383c@skate> In-Reply-To: <20130408225741.74fc383c@skate> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Message-Id: <201304082334.13186.arnd@arndb.de> Sender: linux-pci-owner@vger.kernel.org List-ID: On Monday 08 April 2013, Thomas Petazzoni wrote: > > > + pcie->io.name = "I/O"; > > > + pcie->realio.start = PCIBIOS_MIN_IO; > > > + pcie->realio.end = > > > min(resource_size(&pcie->io), > > > + IO_SPACE_LIMIT); > > > > Using "resource_size(&pcie->io)" here seems strange -- are you > > assuming that pcie->io starts at address zero? > > No, I'm assuming PCIBIOS_MIN_IO is always 0. So presumarly, this should > be something like: > > pcie->realio.end = min(PCIBIOS_MIN_IO + > resource_size(&pcie->io), > IO_SPACE_LIMIT); > Normally PCIBIOS_MIN_IO is 0x1000, since the first 4096 ports are reserved for ISA and PCMCIA compatible drivers and should not be assigned to PCI devices. So the first port should get ports 0x1000 to 0xffff, later ones can used the entire 65536 ports e.g. 0x10000 to 0x1ffff. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Mon, 8 Apr 2013 23:34:12 +0200 Subject: [PATCHv7 08/17] pci: PCIe driver for Marvell Armada 370/XP systems In-Reply-To: <20130408225741.74fc383c@skate> References: <1364395234-11195-1-git-send-email-thomas.petazzoni@free-electrons.com> <20130408225741.74fc383c@skate> Message-ID: <201304082334.13186.arnd@arndb.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Monday 08 April 2013, Thomas Petazzoni wrote: > > > + pcie->io.name = "I/O"; > > > + pcie->realio.start = PCIBIOS_MIN_IO; > > > + pcie->realio.end = > > > min(resource_size(&pcie->io), > > > + IO_SPACE_LIMIT); > > > > Using "resource_size(&pcie->io)" here seems strange -- are you > > assuming that pcie->io starts at address zero? > > No, I'm assuming PCIBIOS_MIN_IO is always 0. So presumarly, this should > be something like: > > pcie->realio.end = min(PCIBIOS_MIN_IO + > resource_size(&pcie->io), > IO_SPACE_LIMIT); > Normally PCIBIOS_MIN_IO is 0x1000, since the first 4096 ports are reserved for ISA and PCMCIA compatible drivers and should not be assigned to PCI devices. So the first port should get ports 0x1000 to 0xffff, later ones can used the entire 65536 ports e.g. 0x10000 to 0x1ffff. Arnd