devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Russell King <linux@arm.linux.org.uk>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	linux-arm <linux-arm-kernel@lists.infradead.org>,
	"devicetree-discuss@lists.ozlabs.org"
	<devicetree-discuss@lists.ozlabs.org>,
	Lior Amsalem <alior@marvell.com>, Andrew Lunn <andrew@lunn.ch>,
	Jason Cooper <jason@lakedaemon.net>,
	Maen Suleiman <maen@marvell.com>,
	Thierry Reding <thierry.reding@avionic-design.de>,
	Gregory Clement <gregory.clement@free-electrons.com>,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
	Olof Johansson <olof@lixom.net>,
	Tawfik Bayouk <tawfik@marvell.com>,
	Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
	Mitch Bradley <wmb@firmworks.com>,
	Andrew Murray <andrew.murray@arm.com>
Subject: Re: [PATCHv7 08/17] pci: PCIe driver for Marvell Armada 370/XP systems
Date: Tue, 9 Apr 2013 00:14:06 +0200	[thread overview]
Message-ID: <201304090014.06959.arnd@arndb.de> (raw)
In-Reply-To: <20130408235341.7012b791@skate>

On Monday 08 April 2013, Thomas Petazzoni wrote:
> Dear Arnd Bergmann,
> 
> On Mon, 8 Apr 2013 23:34:12 +0200, Arnd Bergmann wrote:
> 
> > > 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.
> 
> Then I guess it should work with the code I'm proposing here, no?
> 
> Note: this pcie->realio region is global: it will be shared by all PCIe
> interfaces.

I think it's still wrong, unless you guarantee that
resource_start(&pcie->io) is the same as PCIBIOS_MIN_IO.

Why don't you just read the start and end values from the ranges
property? I assume you want to run with io_offset=0, so you really
need

	pcie->realio.type = IORESOURCE_IO;
	pcie->realio.start = max(PCIBIOS_MIN_IO, range->pci_addr);
	pcie->realio.end = max(IO_SPACE_LIMIT, range->pci_addr + range->size);

	Arnd

  reply	other threads:[~2013-04-08 22:14 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-27 14:40 [PATCHv7 00/17] PCIe support for the Armada 370 and Armada XP SoCs Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 01/17] of/pci: Provide support for parsing PCI DT ranges property Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 02/17] of/pci: Add of_pci_get_devfn() function Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 03/17] of/pci: Add of_pci_parse_bus_range() function Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 04/17] pci: infrastructure to add drivers in drivers/pci/host Thomas Petazzoni
     [not found]   ` <CAAfodu2t4j4ZASzdaKV0QarffXRwMgkMESGy=dDq1oMfTANEeg@mail.gmail.com>
     [not found]     ` <CAAfodu2t4j4ZASzdaKV0QarffXRwMgkMESGy=dDq1oMfTANEeg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-28  7:24       ` Thomas Petazzoni
2013-04-08 20:32         ` Bjorn Helgaas
2013-03-27 14:40 ` [PATCHv7 05/17] arm: pci: add a align_resource hook Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 06/17] clk: mvebu: create parent-child relation for PCIe clocks on Armada 370 Thomas Petazzoni
2013-04-05 13:58   ` Thomas Petazzoni
2013-04-10  8:09   ` Mike Turquette
2013-03-27 14:40 ` [PATCHv7 07/17] clk: mvebu: add more PCIe clocks for Armada XP Thomas Petazzoni
2013-04-05 14:59   ` Thomas Petazzoni
2013-04-10  8:08   ` Mike Turquette
2013-03-27 14:40 ` [PATCHv7 08/17] pci: PCIe driver for Marvell Armada 370/XP systems Thomas Petazzoni
2013-04-08 20:29   ` Bjorn Helgaas
2013-04-08 20:57     ` Thomas Petazzoni
2013-04-08 21:34       ` Arnd Bergmann
2013-04-08 21:53         ` Thomas Petazzoni
2013-04-08 22:14           ` Arnd Bergmann [this message]
2013-04-09 19:06             ` Thomas Petazzoni
2013-04-09 19:09               ` Arnd Bergmann
2013-04-08 21:31     ` Arnd Bergmann
2013-04-08 21:34       ` Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 09/17] arm: mvebu: PCIe support is now available on mvebu Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 10/17] arm: mvebu: add PCIe Device Tree informations for Armada 370 Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 11/17] arm: mvebu: add PCIe Device Tree informations for Armada XP Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 12/17] arm: mvebu: PCIe Device Tree informations for OpenBlocks AX3-4 Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 13/17] arm: mvebu: PCIe Device Tree informations for Armada XP DB Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 14/17] arm: mvebu: PCIe Device Tree informations for Armada 370 Mirabox Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 15/17] arm: mvebu: PCIe Device Tree informations for Armada 370 DB Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 16/17] arm: mvebu: PCIe Device Tree informations for Armada XP GP Thomas Petazzoni
2013-03-27 14:40 ` [PATCHv7 17/17] arm: mvebu: update defconfig with PCI and USB support Thomas Petazzoni
2013-03-31  1:05 ` [PATCHv7 00/17] PCIe support for the Armada 370 and Armada XP SoCs Jason Cooper
2013-04-02 11:36 ` Linus Walleij
2013-04-03 12:27 ` Thomas Petazzoni
2013-04-03 16:31   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201304090014.06959.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=alior@marvell.com \
    --cc=andrew.murray@arm.com \
    --cc=andrew@lunn.ch \
    --cc=bhelgaas@google.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=grant.likely@secretlab.ca \
    --cc=gregory.clement@free-electrons.com \
    --cc=jason@lakedaemon.net \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=maen@marvell.com \
    --cc=olof@lixom.net \
    --cc=tawfik@marvell.com \
    --cc=thierry.reding@avionic-design.de \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=wmb@firmworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).