提交 77ea8a68 编写于 作者: R Rob Herring

of/fdt: skip unflattening of disabled nodes

For static DT usecases, we don't need the disabled nodes and can skip
unflattening. This saves a significant amount of RAM in memory constrained
cases. In one example on STM32F469, the RAM usage goes from 118K to 26K.

There are a few cases in the kernel that modify the status property
dynamically. These all are changes from enabled to disabled, depend on
OF_DYNAMIC or are not FDT based (PDT based).
Tested-by: NNicolas Pitre <nico@linaro.org>
Reviewed-by: NFrank Rowand <frowand.list@gmail.com>
Signed-off-by: NRob Herring <robh@kernel.org>
上级 ecc8a96e
...@@ -396,6 +396,10 @@ static int unflatten_dt_nodes(const void *blob, ...@@ -396,6 +396,10 @@ static int unflatten_dt_nodes(const void *blob,
if (WARN_ON_ONCE(depth >= FDT_MAX_DEPTH)) if (WARN_ON_ONCE(depth >= FDT_MAX_DEPTH))
continue; continue;
if (!IS_ENABLED(CONFIG_OF_KOBJ) &&
!of_fdt_device_is_available(blob, offset))
continue;
if (!populate_node(blob, offset, &mem, nps[depth], if (!populate_node(blob, offset, &mem, nps[depth],
&nps[depth+1], dryrun)) &nps[depth+1], dryrun))
return mem - base; return mem - base;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册