From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH 24/32] pci: PCIe driver for Marvell Armada 370/XP systems Date: Mon, 11 Mar 2013 12:23:39 -0600 Message-ID: <20130311182339.GB10992@obsidianresearch.com> References: <20130308191227.GA6551@avionic-0098.mockup.avionic-design.de> <513A3F4F.2090501@firmworks.com> <20130308200245.GC29435@obsidianresearch.com> <513A7845.6040304@firmworks.com> <20130309013152.GA3883@obsidianresearch.com> <513C117D.6080800@firmworks.com> <20130310065539.GA14704@obsidianresearch.com> <513D6F9C.9000100@firmworks.com> <20130311074615.GA6365@avionic-0098.mockup.avionic-design.de> <513E1CBA.4040007@firmworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <513E1CBA.4040007@firmworks.com> Sender: linux-pci-owner@vger.kernel.org To: Mitch Bradley Cc: Thierry Reding , Lior Amsalem , Russell King - ARM Linux , Jason Cooper , Andrew Lunn , linux-pci@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, Eran Ben-Avi , Nadav Haklai , Maen Suleiman , Bjorn Helgaas , Shadi Ammouri , Tawfik Bayouk , linux-arm-kernel@lists.infradead.org List-Id: devicetree@vger.kernel.org > (b) The discovery/enumeration code needs to access config space via > pci_ops. The root complex driver implements pci_ops based on a trivial > parsing of ranges (omitting irrelevant details): > > pci_op_read(devfn, pos) { > loop_over_ranges_entries { > if (to_devfn(ranges_entry.child) == devfn) { > return mmio_read(ranges_entry.parent + pos); ^^^^^^^^^^^^^^^^^^^ This has to be converted through all enclosing node's ranges prior to being used as a CPU address - the OF core has all the code to do this, but a new entry point would be needed for this specific application... Cheers, Jason