All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerry Van Baren <gerald.vanbaren@smiths-aerospace.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] RFC: flattened device tree command
Date: Wed, 29 Nov 2006 10:32:51 -0500	[thread overview]
Message-ID: <456DA823.4030702@smiths-aerospace.com> (raw)
In-Reply-To: <1164811424.31193.57.camel@saruman.qstreams.net>

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 <node> - does what my "oftdump" command does
>> fdt write <node> <value> - 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. ;-)

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.

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.

Write capability would also follow the OpenFirmware example of allowing 
the user to change things interactively.  99.9998% of the time this is 
not used, but the once in a lifetime that it _is_ useful may save a 
service call are to Alaska or Siberia in the dead of winter (why is it 
never to Fiji???)

Another potential use that may not be realistic would be to implement 
the "env" storage as a fdt, which obviously would require write capability.

gvb

  reply	other threads:[~2006-11-29 15:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-29 14:01 [U-Boot-Users] RFC: flattened device tree command Jerry Van Baren
2006-11-29 14:40 ` Grant Likely
2006-11-29 14:43 ` Ben Warren
2006-11-29 15:32   ` Jerry Van Baren [this message]
2006-11-29 16:03     ` Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=456DA823.4030702@smiths-aerospace.com \
    --to=gerald.vanbaren@smiths-aerospace.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.