From: Ian Campbell Subject: Re: [PATCH] xen: arm: remove /xen-core-devices node from dom0 dtb Date: Fri, 22 Nov 2013 14:58:26 +0000 Message-ID: <1385132306.25845.91.camel@kazak.uk.xensource.com> References: <1385128065-24458-1-git-send-email-ian.campbell@citrix.com> <528F67C5.7060909@linaro.org> <1385131258.25845.85.camel@kazak.uk.xensource.com> <528F6F2F.2040300@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <528F6F2F.2040300@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, 2013-11-22 at 14:50 +0000, Julien Grall wrote: > > On 11/22/2013 02:40 PM, Ian Campbell wrote: > > On Fri, 2013-11-22 at 14:18 +0000, Julien Grall wrote: > >> > >> On 11/22/2013 01:47 PM, Ian Campbell wrote: > >>> The intention of adding this node to contain the GIC, timer and memory nodes > >>> (in 1c08d6004ea7) was to allow us to control the #address-cells and > >>> > >>> However in the case of the memory node the #*-cells are always taken from the > >>> root node (see ePAPR 3.1, "the following nodes shall be present at the root... > >>> memory node"). This caused breakage on the arndale platform. > >>> > >>> In addition it is not valid to just create sub-nodes like this. Unless they > >>> declare themselves as a bus then they will not necessarily be enumerated > >>> (although Linux currently does so in practice). > >>> > >>> Therefore: > >>> - Move the memory node back to the top level. > >>> - Insert the timer and gic nodes in the same location as in the host DTB, > >>> replacing the originals. Note that the nodes here may be marked as in use > >>> by Xen and therefore the check must be before we discard nodes used by Xen. > >> > >> If you insert the GIC and timer nodes at the same location you need to > >> make sure the use the right value. For instance it may happen to have > >> multiple GIC in the device tree. > >> Actually, Xen skips all the GIC nodes and create just one. Here, you > >> replace all the possible GIC nodes by the same value (I'm not sure how > >> Linux will deal with that). > > > > Damn, I forgot about this case. I'm not sure how relevant it is to us > > today though -- do we support any such systems and/or would they be > > likely to just work, I would expect not? > > We don't support this kind of systems. Xen only handle one GIC at time > in arch/arm/gic.c. OK, so my point was that this is a bit of a non-issue, at least right now. And running on such a system is going to take actual work beyond some platform quirks etc. > During dom0 DT building we will just remove all GIC nodes and just > create one (the main controller). > > > > >> For now, I think the best the solution is to check if we are the main > >> interrupt controller. If not, the function just need to return 0. > > > > Means checking dt_interrupt_controller->phandle against the node in > > hand, right? > > You give in argument the current node pointer (ie the GIC). So you can > compare this pointer to dt_interrupt_controller. Right. I'll do this. > BTW, the name of the argument "parent" is wrong. It's not the parent but > the current node. I would rename to "np". OK. >