From: Grant Likely Date: Wed, 29 Nov 2006 07:40:46 -0700 Subject: [U-Boot-Users] RFC: flattened device tree command In-Reply-To: <456D92CD.9070203@smiths-aerospace.com> References: <456D92CD.9070203@smiths-aerospace.com> Message-ID: <528646bc0611290640j1f409e50ybe1845262f85de7f@mail.gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11/29/06, Jerry Van Baren wrote: > The linux kernel has its own library functions for > handling flat device trees. In addition, David Gibson has proposed > another library (advertised as easier to use): > > > My RFC has two parts: > 1) Peoples' opinion of the relative merits of the current u-boot support > library vs. the kernel's library vs. David Gibson's library. My limited > experience with ft_build.c is that it is suboptimal. I don't have any > experience with the linux or David's libraries to form an opinion of them. There has already been talk about replacing ft_build w/ Greer's library, there just hasn't been anyone to do the work. I agree that using a common code base between the various fdt tools is a good idea. Personally, I haven't looked deep into either Greer's or Gibson's implementations yet, so I can't weigh in on which one I like best. > > 2) I see more commands than just dumping the tree, allowing the user to > manipulate the tree as well. My current thoughts are to make a new > command "fdt" (flattened device tree - the Open Firmware genesis appears > to be depricated) with subcommands like the existing "mii" command. This is a good idea, and would be quite useful > fdt read - does what my "oftdump" command does > fdt write - allow patching the fdt > * Writing could get pretty complex with creating nodes > * Initial implementation would be simply to change existing values If the library API is good, adding new nodes/parameters shouldn't be any more complex than modifying existing nodes. The command format would also need to be well defined. > > Related to the above discussion, the current ft_build.c/"bootm" code > takes the blob and augments it with board configuration and env stuff as > part of the "bootm" command. The implementation is suboptimal > (ft_build.c again) in that it is only done as a last thing before > "bootm" transfers to linux, making it (almost) impossible to dump and > definitely impossible to interactively poke around in the resulting fdt. > I would like to see this integrated done better in u-boot rather than > simply pasted onto the fdt at the last moment before jumping into linux. I agree > > So, in conclusion, > 1) I'm not sure if this is truly a RFC or just a brain dump of my > current thoughts. Either way, advice is welcome. Good thoughts, I agree g. -- Grant Likely, B.Sc. P.Eng. Secret Lab Technologies Ltd. grant.likely at secretlab.ca (403) 399-0195