All of lore.kernel.org
 help / color / mirror / Atom feed
* Cmdline FDT query tool
@ 2010-05-18  2:03 John Williams
       [not found] ` <AANLkTilo68Va3EzuWq3SPzv-YpXt-7Ty7Us_Q0Fw_Nmv-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: John Williams @ 2010-05-18  2:03 UTC (permalink / raw)
  To: Grant Likely; +Cc: Michal Simek, devicetree-discuss

Hi Grant,

At ELC I mentioned a tool I'd written that basically hacked u-boot's
"fdt" command into a commandline util for querying DTBs.  You can do
stuff like this:

$ fdt-tool system.dtp print

<dump entire DTB in text format>

$ fdt-tool system.dtb list /cpus/cpu@0 xlnx,use-dcache
xlnx,use-dcache = <0x1>

and so on.

I wrote it four our PetaLinux distribution because we need our tools
to make decisions based on contents of device trees, but thought you
might like to look at it, see if it's more broadly useful (maybe could
be a candidate for scripts/ in the kernel for example).

It's pretty rough, I hacked it together in about 20 minutes and threw
in a readline interface so you can also use it interactively as well.

Possible enhancements would be
  * clean up!
  * support DTS input format (only DTB supported currently)
  * Allow modifying and re-writing (current DTB is read-only)

It can also do some interesting things with u-boot FIT images - you
can basically crack out kernel, DTB or rootfs payloads from a FIT.

If it does go into the kernel then MicroBlaze arch would be an
immediate user, we have a few KCONFIG params that drive GCC cpuflag
options - for simpleImage targets we could pull these straight from
the DTS instead to avoid kernel/CPU mismatches.  We could do it today
with sed/grep/awk etc, but it's ugly ugly ugly.  A DTS-aware tool like
this would make it a no-brainer.  I'm sure PPC could find some useful
things to do with it as well.

http://developer.petalogix.com/downloads/fdt-tool.tar.gz

Cheers,

John
-- 
John Williams, PhD, B.Eng, B.IT
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com  p: +61-7-30090663  f: +61-7-30090663

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-06-21  1:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-18  2:03 Cmdline FDT query tool John Williams
     [not found] ` <AANLkTilo68Va3EzuWq3SPzv-YpXt-7Ty7Us_Q0Fw_Nmv-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-18  8:53   ` David Gibson
2010-05-18 18:20   ` Grant Likely
     [not found]     ` <AANLkTinlyoA-FqbtWh939l9qoc6QDnKwPzNVnjgHFcVc-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-22  0:17       ` David Gibson
2010-05-27  1:40         ` John Williams
     [not found]           ` <AANLkTikLBDLhSlbLHRCoymDIvbkdU7OVhFnDTpqMXNHt-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-27  5:17             ` David Gibson
2010-05-27  5:35               ` John Williams
     [not found]                 ` <AANLkTinJGSz_1bNK8y3JTwqkseU5dg8oIdvT7ir7Mq6u-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-27  6:23                   ` David Gibson
2010-06-21  1:50                     ` John Williams

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.