* [U-Boot-Users] fdt chosen node handling
@ 2007-12-19 7:59 Stefan Roese
2007-12-19 12:24 ` Jerry Van Baren
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Roese @ 2007-12-19 7:59 UTC (permalink / raw)
To: u-boot
Hi,
I am wondering how the device tree "chosen" node should be handled, if it
already exists in the device tree blob given to U-Boot. When this node
doesn't exist it gets created and everything is fine. But if it already
exists, it doesn't get overwritten and the defaults from the device tree blob
most of the time are not what I really want.
So I would like U-Boot to overwrite the existing chosen node. I discovered
that the fdt_chosen() function already has this "force" parameter, but it is
not set in the current U-Boot implementation. I would like to set it for my
board ports and I am wondering how I should handle this. Should this be done
via a compile switch (#define), or via an env variable, or...?
Any ideas/comments on this?
Thanks.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot-Users] fdt chosen node handling
2007-12-19 7:59 [U-Boot-Users] fdt chosen node handling Stefan Roese
@ 2007-12-19 12:24 ` Jerry Van Baren
2007-12-19 13:02 ` Stefan Roese
0 siblings, 1 reply; 3+ messages in thread
From: Jerry Van Baren @ 2007-12-19 12:24 UTC (permalink / raw)
To: u-boot
Stefan Roese wrote:
> Hi,
>
> I am wondering how the device tree "chosen" node should be handled, if it
> already exists in the device tree blob given to U-Boot. When this node
> doesn't exist it gets created and everything is fine. But if it already
> exists, it doesn't get overwritten and the defaults from the device tree blob
> most of the time are not what I really want.
>
> So I would like U-Boot to overwrite the existing chosen node. I discovered
> that the fdt_chosen() function already has this "force" parameter, but it is
> not set in the current U-Boot implementation. I would like to set it for my
> board ports and I am wondering how I should handle this. Should this be done
> via a compile switch (#define), or via an env variable, or...?
>
> Any ideas/comments on this?
>
> Thanks.
>
> Best regards,
> Stefan
Hi Stefan,
Disclaimer: I am not a OF expert, I have not read the OF documentation
cover to cover and do not understand many implications of what I've
read, much less what I have _not_ read.
1) I believe the /chosen node should be auto-created.
2) As you point out, if the /chosen node already exists the current code
bails out and doesn't change anything. This was done as a very badly
misguided attempt to make libfdt things work like bd_t things. The
granularity should be on the individual properties, not on /chosen. I
consider this a bug and have it on my "todo" list to fix (actually, I
had created a patch, but I need to rebase and publish it).
<http://www.denx.de/wiki/view/UBoot/UBootFdtInfo#Outstanding_Patches>
"Unpublished patch of JerryVanBaren, implementing a suggestion by Scott
Wood to make the /chosen handling finer grained: if the /chosen node
exists, currently u-boot-fdt bails out. A better methodology is to not
overwrite pre-existing properties on a per-property basis, so if /chosen
exists but a necessary /chosen/property doesn't, it gets created. Good
idea, but not published and poorly tested at the moment."
Best regards,
gvb
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot-Users] fdt chosen node handling
2007-12-19 12:24 ` Jerry Van Baren
@ 2007-12-19 13:02 ` Stefan Roese
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2007-12-19 13:02 UTC (permalink / raw)
To: u-boot
Hi Jerry,
On Wednesday 19 December 2007, Jerry Van Baren wrote:
> Disclaimer: I am not a OF expert, I have not read the OF documentation
> cover to cover and do not understand many implications of what I've
> read, much less what I have _not_ read.
>
> 1) I believe the /chosen node should be auto-created.
Ufff. :)
> 2) As you point out, if the /chosen node already exists the current code
> bails out and doesn't change anything. This was done as a very badly
> misguided attempt to make libfdt things work like bd_t things. The
> granularity should be on the individual properties, not on /chosen. I
> consider this a bug and have it on my "todo" list to fix (actually, I
> had created a patch, but I need to rebase and publish it).
>
> <http://www.denx.de/wiki/view/UBoot/UBootFdtInfo#Outstanding_Patches>
>
> "Unpublished patch of JerryVanBaren, implementing a suggestion by Scott
> Wood to make the /chosen handling finer grained: if the /chosen node
> exists, currently u-boot-fdt bails out. A better methodology is to not
> overwrite pre-existing properties on a per-property basis, so if /chosen
> exists but a necessary /chosen/property doesn't, it gets created. Good
> idea, but not published and poorly tested at the moment."
OK, thanks for these infos.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-19 13:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-19 7:59 [U-Boot-Users] fdt chosen node handling Stefan Roese
2007-12-19 12:24 ` Jerry Van Baren
2007-12-19 13:02 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox