From: Scott Wood Date: Fri, 7 Feb 2014 12:46:30 -0600 Subject: [U-Boot] [Qemu-ppc] [PATCH v2 5/6] PPC 85xx: Find PCI host controllers on ppce500 from device tree In-Reply-To: References: <1391166969-25845-1-git-send-email-agraf@suse.de> <1391166969-25845-6-git-send-email-agraf@suse.de> <1391482036.6733.153.camel@snotra.buserror.net> <7897863D-7B39-4B32-9E47-2FBA13EDC77B@suse.de> <1391727177.6733.247.camel@snotra.buserror.net> <27B258DC-EFAA-42C9-AE66-236DC8F41CFB@suse.de> Message-ID: <1391798790.6733.312.camel@snotra.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, 2014-02-07 at 16:00 +0100, Alexander Graf wrote: > On 07.02.2014, at 15:54, Alexander Graf wrote: > > > > > On 06.02.2014, at 23:52, Scott Wood wrote: > > > >> On Thu, 2014-02-06 at 14:26 +0100, Alexander Graf wrote: > >>>> > >>>> How about using fdt_translate_address() or other existing functionality? > >>> > >>> Mind to show exactly how? > >> > >> I guess you can't use that when you don't know the bus address, but > >> still this is the wrong place to implement it. If getting PCI range > >> info from the device tree is something we want to do, then it should be > >> a new common code helper. > > > > The more I think about this the less of an idea I have how to do any generic API for this at all. And I'm not convinced anything generic is going to help anyone. Do a git grep on fdt_translate_address over the code base and you will find a _single_ caller. > > > > So even if we come up with something now, nobody's going to use it. > > Hrm. Maybe fdt_get_base_address() is the answer? Yes, that looks close to what you want. It'd have to be extended to look for the various types of PCI ranges and return a (cpu address, bus address, size) tuple rather than just a base address. It's moot though if we can reprogram the PCI windows. -Scott