
[snip a bunch more setter functions]
Hi Kumar,
The direction Grant Likely went with 5xxx and where Sergej was heading with 82xx (if only I got around to applying his patch) and where I want to go is to replace the table-driven methodology with direct calls to more generic functions, eliminating the hordes of specialized "setter" functions (all nearly identical).
Discussions and patches: <http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/32573/ focus=32573> http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/32577
If we get the mpc5xxx style setter functions combined with your fdt_node_offset_by_prop_and_compat() finding changes, I think we would be in fat city.
So we can easily extend what I have to include generic call backs and remove the specific set props. The problem I have with the 5xxx mechanism is its requires too much knowledge of how the device tree is laid out since it uses explicit paths to the nodes.
The other option is to extend what Grant has.
Today its:
do_fixup_path(fdt, path, prop, val, len, create) do_fixup_path_u32(fdt, path, prop, val, create)
Add:
do_fixup_prop(fdt, find_prop, find_propval, findlen, prop, val, len, create) do_fixup_prop_u32(fdt, find_prop, find_propval, findlen, prop, val, create) do_fixup_compat(fdt, compat, prop, val, len, create) do_fixup_compat_u32(fdt, compat, prop, val, create) do_fixup_prop_and_compat(fdt, find_prop, find_proval, findlen, compat, prop, val, len, create) do_fixup_prop_and_compat_u32(fdt, find_prop, find_proval, findlen, compat, prop, val, create)
We get something like "do_fixup_device_type" by do_fixup_prop(fdt, "device_type", ...)
P.S. Is David done changing libfdt yet??? ;-) I saw you are still keeping up with him...
Not sure, as jdl commits things I reimport and update.
- k