From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH v10 07/10] OF: Introduce helper function for getting PCI domain_nr Date: Mon, 8 Sep 2014 10:39:05 -0600 Message-ID: <20140908163905.GC29679@obsidianresearch.com> References: <1410184472-17630-1-git-send-email-Liviu.Dudau@arm.com> <1410184472-17630-8-git-send-email-Liviu.Dudau@arm.com> <20140908145459.GO27864@e106497-lin.cambridge.arm.com> <20140908155931.GP27864@e106497-lin.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20140908155931.GP27864@e106497-lin.cambridge.arm.com> Sender: linux-arch-owner@vger.kernel.org To: Liviu Dudau Cc: Rob Herring , Bjorn Helgaas , Arnd Bergmann , Rob Herring , Benjamin Herrenschmidt , Catalin Marinas , Will Deacon , Russell King , linux-pci , Linus Walleij , Tanmay Inamdar , Grant Likely , Sinan Kaya , Jingoo Han , Kukjin Kim , Suravee Suthikulanit , linux-arch , LKML , Device Tree ML , LAKML , "grant.likely@linaro.org" List-Id: devicetree@vger.kernel.org On Mon, Sep 08, 2014 at 04:59:31PM +0100, Liviu Dudau wrote: > > I don't really understand how domains are used so it's hard to provide > > a recommendation here. Do domains even belong in the DT? > > ACPI calls them segments and the way Bjorn explained it to me at some moment was > that it was an attempt to split up a bus in different groups (or alternatively, > merge a few busses together). To be honest I haven't seen systems where the domain > is anything other than zero, but JasonG (or maybe Benjamin) were floating an > idea of using the domain number to identify physical slots. A PCI domain qualifies the bus:device.function addressing so that we can have duplicate BDFs in the system. So, yes, they belong in DT - each 'top level' PCI node naturally represents a unique set of BDF addressing below it, and could alias other top level nodes. The first step to resolve a BDF to a DT node is to find the correct 'top level' by mapping the domain number. In an ideal world no small scale system should ever have domains. They were primarily introduced for large scale NUMA system that actually have more than 256 PCI busses. However, from a DT prespective, we've been saying that if the SOC presents a PCI-E root port that shares nothing with other root ports (ie aperture, driver instance, config space) then those ports must be represented by unique 'top level' DT nodes, and each DT node must be assigned to a Linux PCI domain. IMHO, designing such a SOC ignores the API guidelines provides by the PCI-E spec itself, and I hope such a thing won't be considered SBSA compatible.. Jason