* Modifying device-tree: /chosen
@ 2018-05-23 10:59 Baeuerle, Florian
2018-05-23 12:55 ` Pascal Vizeli
2018-05-23 13:30 ` Sascha Hauer
0 siblings, 2 replies; 4+ messages in thread
From: Baeuerle, Florian @ 2018-05-23 10:59 UTC (permalink / raw)
To: barebox
Hi,
I haven't found a (good) way to modify the kernel device tree before booting
when using the bootchooser in combination with blspec. What seems to be done
quite often is registering fixup functions (of_register_fixup) in board-specific
code.
I'd prefer not patch board-specific code, because my use case is rather specific
(passing the device serial number, the bootloader version, and a few other
things to the kernel). So the question is, if this use case is common enough to
provide a more generic way.
My proposal is providing a command like this:
of_fixup_chosen [PROPERTY] [VALUE]
I guess it would suffice to only store strings in /chosen.
Example:
of_fixup_chosen bootloader-version $global.version
of_fixup_chosen reset-reason $global.system.reset
of_fixup_chosen serial $serial_number
I'm open for other suggestions, as this could also be implementend in a more
generic (and also more complex) way by allowing to fix up random nodes and
properties throughout the device tree.
Best Regards
Florian
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Modifying device-tree: /chosen
2018-05-23 10:59 Modifying device-tree: /chosen Baeuerle, Florian
@ 2018-05-23 12:55 ` Pascal Vizeli
2018-05-23 13:30 ` Sascha Hauer
1 sibling, 0 replies; 4+ messages in thread
From: Pascal Vizeli @ 2018-05-23 12:55 UTC (permalink / raw)
To: Baeuerle, Florian; +Cc: barebox
Maybe we can also include the:
http://lists.infradead.org/pipermail/barebox/2015-March/022708.html
It would be nice to use feature like this to modify the device tree
before we boot the kernel.
Pascal
2018-05-23 12:59 GMT+02:00 Baeuerle, Florian <Florian.Baeuerle@allegion.com>:
> Hi,
>
> I haven't found a (good) way to modify the kernel device tree before booting
> when using the bootchooser in combination with blspec. What seems to be done
> quite often is registering fixup functions (of_register_fixup) in board-specific
> code.
>
> I'd prefer not patch board-specific code, because my use case is rather specific
> (passing the device serial number, the bootloader version, and a few other
> things to the kernel). So the question is, if this use case is common enough to
> provide a more generic way.
>
> My proposal is providing a command like this:
>
> of_fixup_chosen [PROPERTY] [VALUE]
>
> I guess it would suffice to only store strings in /chosen.
>
> Example:
> of_fixup_chosen bootloader-version $global.version
> of_fixup_chosen reset-reason $global.system.reset
> of_fixup_chosen serial $serial_number
>
>
> I'm open for other suggestions, as this could also be implementend in a more
> generic (and also more complex) way by allowing to fix up random nodes and
> properties throughout the device tree.
>
>
> Best Regards
> Florian
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Modifying device-tree: /chosen
2018-05-23 10:59 Modifying device-tree: /chosen Baeuerle, Florian
2018-05-23 12:55 ` Pascal Vizeli
@ 2018-05-23 13:30 ` Sascha Hauer
[not found] ` <e77f7ef6c9ab77ca5fb2cdee4125efa6c9ae8fd2.camel@allegion.com>
1 sibling, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2018-05-23 13:30 UTC (permalink / raw)
To: Baeuerle, Florian; +Cc: barebox
Hi Florian,
On Wed, May 23, 2018 at 10:59:21AM +0000, Baeuerle, Florian wrote:
> Hi,
>
> I haven't found a (good) way to modify the kernel device tree before booting
> when using the bootchooser in combination with blspec. What seems to be done
> quite often is registering fixup functions (of_register_fixup) in board-specific
> code.
>
> I'd prefer not patch board-specific code, because my use case is rather specific
> (passing the device serial number, the bootloader version, and a few other
> things to the kernel). So the question is, if this use case is common enough to
> provide a more generic way.
>
> My proposal is providing a command like this:
>
> of_fixup_chosen [PROPERTY] [VALUE]
This seems to be very similar to what I suggested here:
https://www.spinics.net/lists/u-boot-v2/msg32661.html
I see no reason to limit this command to the /chosen node, we could
equally well accept a full path to the node rather than just a property
name.
>
> I guess it would suffice to only store strings in /chosen.
>
> Example:
> of_fixup_chosen bootloader-version $global.version
This is already done, See commit e96dc23280c43dd6b026ea71bcbaf3353abb4c83
> of_fixup_chosen reset-reason $global.system.reset
See 58243d98b3f8e000c674a78a9466bd2fce213cc6
> of_fixup_chosen serial $serial_number
No generic support for this one though.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Modifying device-tree: /chosen
[not found] ` <20180524082047.44njsmnrvpxyar27@pengutronix.de>
@ 2018-05-24 14:12 ` Baeuerle, Florian
0 siblings, 0 replies; 4+ messages in thread
From: Baeuerle, Florian @ 2018-05-24 14:12 UTC (permalink / raw)
To: s.hauer; +Cc: barebox
Hi Sascha,
Am Donnerstag, den 24.05.2018, 10:20 +0200 schrieb s.hauer@pengutronix.de:
> On Thu, May 24, 2018 at 08:13:44AM +0000, Baeuerle, Florian wrote:
> > Hi Sascha,
> >
> > so I think we need a command, similar to of_property:
> >
> > of_fixup_property [-sd] NODE PROPERTY VALUE
> >
> > or should it rather be a new option for of_property, like this:
> >
> > of_property [-sdf] NODE [PROPERTY] [VALUES]
>
> I would first try it as a new option to of_property.
> If for some reason this turns out to be ugly, let me know.
of_property and of_node are pretty similar with regard to their options.
Do you want them to stay the same, so I'd also have to implement this
fixup functionality to of_node?
>
> Sascha
>
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-05-24 14:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23 10:59 Modifying device-tree: /chosen Baeuerle, Florian
2018-05-23 12:55 ` Pascal Vizeli
2018-05-23 13:30 ` Sascha Hauer
[not found] ` <e77f7ef6c9ab77ca5fb2cdee4125efa6c9ae8fd2.camel@allegion.com>
[not found] ` <20180524082047.44njsmnrvpxyar27@pengutronix.de>
2018-05-24 14:12 ` Baeuerle, Florian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox