From: Grant Likely Date: Wed, 29 Nov 2006 09:03:09 -0700 Subject: [U-Boot-Users] RFC: flattened device tree command In-Reply-To: <456DA823.4030702@smiths-aerospace.com> References: <456D92CD.9070203@smiths-aerospace.com> <1164811424.31193.57.camel@saruman.qstreams.net> <456DA823.4030702@smiths-aerospace.com> Message-ID: <528646bc0611290803l24772007xc9220648af599dfc@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: > Ben Warren wrote: > > Hi Jerry, > > > > On Wed, 2006-11-29 at 09:01 -0500, Jerry Van Baren wrote: > > > >> 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. > >> > >> 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 > >> > > > > A naive question, to be sure: Do you really forsee wanting to change > > the device tree from the U-boot prompt? I can see value in dumping the > > contents and having an API that board-level boot code can use to modify > > the tree. Maybe for initial board debugging it would be useful to try > > things out quickly, but modifying the quite-readable .dts files and > > recompiling doesn't take long either. > > > > Again, I don't mean to be critical - I'm just curious where you envision > > this being used. > > > > regards, > > Ben > > It goes with the classic unix/C philosophy of providing enough rope to > shoot yourself in the foot. ;-) this is supposed to be a mixed-metaphor free zone. :-P > > Seriously, I don't have any concrete examples, but the current "bootm" > command autogenerates values that are added to the tree, and also > (optionally) adds the u-boot "env" values. The env values can be > changed via the env commands, but the autogenerated values currently cannot. ie. change the enumeration of serial ports (via property values). I have client boards where this would be useful at run time. > > One autogenerated node is the "selected" node. I would contend that > this should _not_ be autogenerated. (The copy of dtc that I am using > complains because my .dtc file does not have a "selected" node.) If you > had multiple CPUs and wanted to boot from a different one, it would be > really nice to be able to do that interactively or script it via hush. s/selected/chosen/ -- Grant Likely, B.Sc. P.Eng. Secret Lab Technologies Ltd. grant.likely at secretlab.ca (403) 399-0195