Kernel device tree gets modified with bootm command when CONFIG_OFDEVICE is enabled

Sascha Hauer s.hauer at
Thu Oct 5 21:11:53 PDT 2017

Hi Marcel,

On Tue, Oct 03, 2017 at 11:36:49AM +0200, Marcel Hamer wrote:
> Hello,
> When passing a custom device tree to the kernel using the 'bootm' command I
> see the device tree gets 'fixed up' when the CONFIG_OFDEVICE option is
> enabled. Probably this should not be the case when the dtb is passed to the
> kernel?
> This happens on line common/bootm.c:395:
>     oftree = of_get_fixed_tree(data->of_root_node);
> Should this not be changed to:
>     oftree = of_flatten_db(data->of_root_node);

No. Getting the fixed up tree is exactly what we want here. There are
some cases in which it's absolutely mandatory to use the fixed tree
(memory banks, they are oftem empty in the Linux provided dts files)
and other in which is convenient (mtd, to make sure the kernel sees the
same partitions as the bootloader).
There might be some cases where we want to have more control over which
fixups run and which don't, but generally we want to have the fixed tree


Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 |  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

More information about the barebox mailing list