This patch modifies function ofw_fdt_setprop (called by OF_setprop),
so that it can add property, when replacing is not possible.
Adding property is needed to fixup FDT's that have missing
properties.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Is this expected to actually work with FDT? I had thought the limitation was just that there is no free space in our FDTs, and we don't reallocate them, so that -- in general -- you can't add properties. You certainly can't on my hardware.
Could you elaborate a little on what you want to do here? In general, I think we should treat FDTs as immutable things given by God rather than applying "fix ups" to them, but there are exceptions of course.
When aligning device trees between Linux (sys/gnu/dts/arm) and FreeBSD
(for now in sys/boot/fdt/dts/arm) we came up on a problem that a
certain boolean property is fixed-up in Linux code, so we were forced
to remove it from DT. It came out that fdt_setprop handles all
resizing and adding new property into the device tree (see
_fdt_add_property in fdt_setprop()).
Could you elaborate a little on what you want to do here? In general, I think we should treat FDTs as immutable things given by God rather than applying "fix ups" to them, but there are exceptions of course.
For now we found other way to avoid DT differences, so eventually
fix-ups were not necessary. However for the first version of the
patchset all worked fine (i.e. adding new properties and further
processing them by drivers). I think that this improvement can be
useful, but now I don't insist at all. Please let know your opinion.
Thanks,
Marcin
Hi @nwhitehorn - do you think we can merge the patch, given my last information provided?
Yes, I think that's fine. Sorry for the delay. Insofar as we keep this API existing, it should work properly and this patch helps achieve that. Please be careful using it, and, if you have some spare cycles, it would be worth thinking about how to make it more reliable still.
Thanks. I agree, it's not perfect but makes ofw_fdt_setprop usable, given current functions we have in hand in the OS.