From: Ian Campbell Subject: Re: [PATCH 4/4] xen: arm: create dom0 DTB /hypervisor/ node dynamically. Date: Tue, 5 Feb 2013 11:30:48 +0000 Message-ID: <1360063848.17017.55.camel@zakaz.uk.xensource.com> References: <1359555969.12252.231.camel@zakaz.uk.xensource.com> <1359555990-12186-4-git-send-email-ian.campbell@citrix.com> <5110EC7B.1060804@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5110EC7B.1060804@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Anthony PERARD Cc: Stefano Stabellini , "Tim (Xen.org)" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Tue, 2013-02-05 at 11:26 +0000, Anthony PERARD wrote: > > +static void make_hypervisor_node(void *fdt, int addrcells, int sizecells) > > +{ > > + const char compat[] = "xen,xen-4.2\0xen,xen"; > > + u32 reg[4]; > > + u32 intr[3]; > > + u32 *cell; > > + > > + /* > > + * Sanity-check address sizes, since addresses and sizes which do not take > > + * up exactly 4 or 8 bytes are not supported. > > + */ > > + if ((addrcells != 1 && addrcells != 2) || > > + (sizecells != 1 && sizecells != 2)) > > + panic("Cannot cope with this size"); > > You could add those two properties in the hypervisor node if they don't > match what we expect them to be. This would avoid panicking with a > device tree that have different default values. Yes, I suppose that ought to work. Ian.