From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH v3 05/12] ARM: mvebu: Remove the harcoded BootROM window allocation Date: Wed, 19 Jun 2013 10:58:34 -0600 Message-ID: <20130619165834.GB32155@obsidianresearch.com> References: <1371554737-25319-1-git-send-email-ezequiel.garcia@free-electrons.com> <1371554737-25319-6-git-send-email-ezequiel.garcia@free-electrons.com> <20130618173906.GC2204@obsidianresearch.com> <20130619100159.GB16138@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20130619100159.GB16138@localhost> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Ezequiel Garcia Cc: Andrew Lunn , Jason Cooper , devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Maen Suleiman , Lior Amsalem , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Sebastian Hesselbarth List-Id: devicetree@vger.kernel.org On Wed, Jun 19, 2013 at 07:02:00AM -0300, Ezequiel Garcia wrote: > > Verifying the DT is setup this way and aborting if it is not seems > > like a good idea.. > > I agree it's a nice idea, but I'm not too sure how to accomplish this > in a simple and generic way. There's nothing in the DT that allows you > to know which of the ranges entries correspond to the BootROM, unless you go > through each of the entries comparing against the known target ID and > attribute. I think you need to have a defined compatible string for the bootrom, use one of the of_find.. functions to locate the node, then translate the regs to get a CPU address, ensure it is the right base and size.. > You could also do a 'of_find_node_by_name(NULL, "bootrom");' but the > binding no longer requires to even have any children for the window. You'll need to define a bootrom binding. There is not a lot of sense in including things in the DT if the kernel can't find them and use them. Jason