diff options
| author | Rob Herring <robh@kernel.org> | 2017-10-03 12:07:55 -0400 |
|---|---|---|
| committer | Rob Herring <robh@kernel.org> | 2017-10-16 14:43:29 -0400 |
| commit | 77ea8a68c54ede3fd60dadb6a49b597f6eb5aee7 (patch) | |
| tree | 38a0e128b10134641f114f87dac9ed6d88ec4d3d | |
| parent | ecc8a96e251dc43d13841bac44fbfa34ec20fc52 (diff) | |
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: Nicolas Pitre <nico@linaro.org>
Reviewed-by: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
| -rw-r--r-- | drivers/of/fdt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index f8c39705418b..2d515b85a198 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
| @@ -396,6 +396,10 @@ static int unflatten_dt_nodes(const void *blob, | |||
| 396 | if (WARN_ON_ONCE(depth >= FDT_MAX_DEPTH)) | 396 | if (WARN_ON_ONCE(depth >= FDT_MAX_DEPTH)) |
| 397 | continue; | 397 | continue; |
| 398 | 398 | ||
| 399 | if (!IS_ENABLED(CONFIG_OF_KOBJ) && | ||
| 400 | !of_fdt_device_is_available(blob, offset)) | ||
| 401 | continue; | ||
| 402 | |||
| 399 | if (!populate_node(blob, offset, &mem, nps[depth], | 403 | if (!populate_node(blob, offset, &mem, nps[depth], |
| 400 | &nps[depth+1], dryrun)) | 404 | &nps[depth+1], dryrun)) |
| 401 | return mem - base; | 405 | return mem - base; |
