From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-qg0-x235.google.com ([2607:f8b0:400d:c04::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aGMdE-0007ZJ-7j for barebox@lists.infradead.org; Tue, 05 Jan 2016 08:06:17 +0000 Received: by mail-qg0-x235.google.com with SMTP id e32so182655756qgf.3 for ; Tue, 05 Jan 2016 00:05:55 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20160105075831.GO13058@pengutronix.de> References: <1450484040.26955.228.camel@rtred1test09.kymeta.local> <20160104083257.GA13058@pengutronix.de> <1451934452.26955.281.camel@rtred1test09.kymeta.local> <20160105075831.GO13058@pengutronix.de> From: Yegor Yefremov Date: Tue, 5 Jan 2016 09:05:35 +0100 Message-ID: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 1/2] of: Add for_each_compatible_node_from iterator To: Sascha Hauer Cc: barebox , Trent Piepho On Tue, Jan 5, 2016 at 8:58 AM, Sascha Hauer wrote: > On Mon, Jan 04, 2016 at 07:07:27PM +0000, Trent Piepho wrote: >> On Mon, 2016-01-04 at 09:32 +0100, Sascha Hauer wrote: >> > On Sat, Dec 19, 2015 at 12:13:59AM +0000, Trent Piepho wrote: >> > > The existing iterator for_each_compatible_node() searches for each >> > > compatible node starting from the root of the loaded device tree. >> > > This means it only works on the barebox device tree and not the tree >> > > to be passed to the Linux kernel, which is what an of_fixup would >> > > probably want to use. >> > > >> > > This adds for_each_compatible_node_from(), which takes an additional >> > > parameter of a root to search from. This could be the device tree to >> > > be used for the kernel. It could also be used to search just a >> > > subtree. >> > > >> > > Signed-off-by: Trent Piepho >> > >> > Applied, thanks >> > >> > > --- >> > > >> > > It's possible the fixups in cm_cogent_fixup() and hb_fixup() should >> > > be using this. It's not clear to me if they want to modify the barebox >> > > device tree or the Linux device tree or both. >> > >> > It's always the Linux device tree that is fixed up in the OF fixups. >> >> Sent patch to fix them. >> >> Couldn't one also use the of fixup system to modify the barebox DT? In >> order to support multiple board variants, I added DT nodes that specify >> what nodes should be enabled and/or disabled for different board >> versions. An OF fixup applies this to the Linux DT. I haven't had to >> modify the barebox DT for different boards but anticipate that happening >> for the next board and I was planning to use the same system. > > I think you don't need the fixup system to accomplish that. Just hook up > to an initcall early enough and modify the barebox device tree. It > shouldn't be necessary to register a callback first and then wait for > its execution. What initcall can be used to change the device tree, that is already loaded into memory and before Linux is started? My goal is (as soon as FIT support is merged) to load corresponding blob and change MACs. Yegor > Are you aware of device tree overlays? We planned to merge support for > them into barebox once the official device tree compiler supports them. > Unfortunately this hasn't happened yet. > > Sascha > > -- > Pengutronix e.K. | | > Industrial Linux Solutions | http://www.pengutronix.de/ | > Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | > > _______________________________________________ > barebox mailing list > barebox@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/barebox _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox