public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
* Parsing DTS file
@ 2010-10-18 12:13 Guillaume Dargaud
  2010-10-18 14:14 ` David Gibson
  2010-10-18 15:22 ` Ivo Schenk
  0 siblings, 2 replies; 3+ messages in thread
From: Guillaume Dargaud @ 2010-10-18 12:13 UTC (permalink / raw)
  To: linuxppc-dev

Hello all,
I'm sure there's a standard way of doing this: I'd like to access some info 
from the DTS file from a usermode program (things like address of device, 
etc...)
What is the best way to do this ? Write a parser ? Or query the running kernel 
somehow ?
-- 
Guillaume Dargaud
http://www.gdargaud.net/

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

* Re: Parsing DTS file
  2010-10-18 12:13 Parsing DTS file Guillaume Dargaud
@ 2010-10-18 14:14 ` David Gibson
  2010-10-18 15:22 ` Ivo Schenk
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2010-10-18 14:14 UTC (permalink / raw)
  To: Guillaume Dargaud; +Cc: linuxppc-dev

On Mon, Oct 18, 2010 at 02:13:58PM +0200, Guillaume Dargaud wrote:
> Hello all,
> I'm sure there's a standard way of doing this: I'd like to access some info 
> from the DTS file from a usermode program (things like address of device, 
> etc...)
> What is the best way to do this ? Write a parser ? Or query the running kernel 
> somehow ?

Um.. this question doesn't seem to make a lot of sense.  What's the
context in which you're trying to do this.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

* RE: Parsing DTS file
  2010-10-18 12:13 Parsing DTS file Guillaume Dargaud
  2010-10-18 14:14 ` David Gibson
@ 2010-10-18 15:22 ` Ivo Schenk
  1 sibling, 0 replies; 3+ messages in thread
From: Ivo Schenk @ 2010-10-18 15:22 UTC (permalink / raw)
  To: linuxppc-dev

>Hello all,
>I'm sure there's a standard way of doing this: I'd like to access some =
info=20
>from the DTS file from a usermode program (things like address of =
device,=20
>etc...)
>What is the best way to do this ? Write a parser ? Or query the running =
kernel=20
>somehow ?

Compile your kernel with CONFIG_PROC_DEVICETREE, then you can access all =
entries via filesystem:

[root@t:~] # ll /proc/device-tree/

-r--r--r--  1 root root  4 Oct 18 17:17 #address-cells
-r--r--r--  1 root root  4 Oct 18 17:17 #size-cells
dr-xr-xr-x  2 root root  0 Oct 18 17:17 chosen
-r--r--r--  1 root root 13 Oct 18 17:17 compatible
dr-xr-xr-x  3 root root  0 Oct 18 17:17 cpus
-r--r--r--  1 root root 13 Oct 18 17:17 dtb-revision
-r--r--r--  1 root root  4 Oct 18 17:17 interrupt-parent
dr-xr-xr-x  8 root root  0 Oct 18 17:17 localbus
dr-xr-xr-x  2 root root  0 Oct 18 17:17 memory
-r--r--r--  1 root root  5 Oct 18 17:17 model
-r--r--r--  1 root root  1 Oct 18 17:17 name
dr-xr-xr-x  2 root root  0 Oct 18 17:17 pci@f0000d00
-r--r--r--  1 root root  9 Oct 18 17:17 serialno
dr-xr-xr-x 32 root root  0 Oct 18 17:17 soc5200@f0000000

--=20
Ivo Schenk
http://www.delphin.de/

Delphin Technology AG
Sitz der Gesellschaft: Bergisch Gladbach
Registergericht: Amtsgericht Koeln, HRB 47544
Vorstand: Ursula Renner (Vorsitzende), Frank Ringsdorf
Vorsitzender des Aufsichtsrats: Peter Renner

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

end of thread, other threads:[~2010-10-18 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-18 12:13 Parsing DTS file Guillaume Dargaud
2010-10-18 14:14 ` David Gibson
2010-10-18 15:22 ` Ivo Schenk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox