History log of /system/libufdt/ufdt_overlay.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4c7735ac0173b71aceb489470fca15b56e64c4d4 25-Jan-2018 Hridya Valsaraju <hridya@google.com> Add capability to verify application of multiple overlays

Bug: 67779848
Test: sh apply_verify_multiple_overlay.sh

Change-Id: I022a9b222161c279cfb7ba8546d465b478786d9c
/system/libufdt/ufdt_overlay.c
c0957f2fa7c1b47b61044b3af3d7d82ca44e0680 30-Jan-2018 Hridya Valsaraju <hridya@google.com> Refactor code to find overlay target

Test: mm
Bug: 67779848

Change-Id: Iec654609d12e1925076ff65aafb94bf6bdf4775d
/system/libufdt/ufdt_overlay.c
5168cab4cb068dc964e6354167bc857a0e948ff7 06-Dec-2017 Hridya Valsaraju <hridya@google.com> Create libufdt_verify

Exposes an API to verify if a device tree overlay has been correctly
applied on an FDT.

Bug: 67779848
Test: vts-tradefed run vts -m VtsVerifyDTBOTest
Change-Id: I0606fd79784b8beed1d912129dfbc9b7634e7708
/system/libufdt/ufdt_overlay.c
d62a849ab43430326c33d3e004a42e9b34080731 24-Apr-2017 SzuWei Lin <szuweilin@google.com> libufdt: reduce the number of malloc/free calling

The performance of some bootloader malloc/free implementation isn't
optimized, but libufdt calls huge number of malloc/free to build a
real tree data structure.

The patch adds an ufdt_node_pool to reduce the number of malloc/free.
ufdt_node_pool asks a larger memory block in each time, and
distributes the memory into several ufdt_node (ufdt_node_fdt_prop
or ufdt_node_fdt_node). libufdt doesn't need to call malloc()
to allocate memory until out of larger memory block.

The setting of this patch is 1024 nodes in each memory block,
so it can reduce ~1023/1024 malloc/free calling times after the patch
is applied.

Bug: 32969430
Test: ./tests/run_tests.sh
Test: ./tests/run_performance_test.sh
Change-Id: Id95e74da1235b9e2fc306500686515ee6b93017d
/system/libufdt/ufdt_overlay.c
a3326ade5d90a747b549a209519331816243d800 20-Apr-2017 Chris Fries <cfries@google.com> libufdt: avoid to strdup() if possible

Memory allocation is slow in some platform. Uses stack to avoid
malloc/free if possible.

Also removed dto_strdup(). Doesn't need to implement it anymore.

Bug: 32969430
Test: ./tests/run_tests.sh
Change-Id: I68eae8fcf05e722089879ba3e95c55b136bb31ed
/system/libufdt/ufdt_overlay.c
e78aa56232a888c30b5de559797578eac6bc1663 17-Apr-2017 SzuWei Lin <szuweilin@google.com> Correct code placement for different license

Previous code revising moved some code into a file with different license.
Fix it in this patch.

Test: ./tests/run_tests.sh
Change-Id: Ie50000bba7a6bf8d9d65dcc1a1cf21135ac3b97a
/system/libufdt/ufdt_overlay.c
8a7039c218527bfc25a2831f480a9558e64f84e5 14-Apr-2017 SzuWei Lin <szuweilin@google.com> Code revise

- Remove unused code
- Remove internel functions from header file
- Fix typos
- Revise all function names with prefix ufdt_*

Test: ./tests/run_tests.sh
Change-Id: I4f89e90eb983540e78aadb092c07de62d219e454
/system/libufdt/ufdt_overlay.c
1be68ae53e645de1b2ec26140b302fbfcbbb919f 30-Mar-2017 SzuWei Lin <szuweilin@google.com> Avoid to re-generate string table from ufdt to fdt

String table contains the strings of all property name in a fdt.

The ufdt_apply_overlay() converts two dtbs from fdt to ufdt,
overlays, and converts merged ufdt to fdt. These operations
shouldn't create new peroperty names, so we can just re-use the
string tables in original dtbs, and just copy them into merged
fdt. This solution can enhance a lot of performance for device
tree overlaying.

To avoid the error that some users could use string offset in
string table, the solution also give a same string offset for
the name properties by ufdt_prop_dict;

Futher, the patch also removed unused header files after
changing algorithm.

Bug: 35255584
Test: ./tests/run_tests.sh
Change-Id: Id422730115531bd20d21117285291bdd860915ff
/system/libufdt/ufdt_overlay.c
70107c8f5c65bc9798d8f6b7f5b580997d0aca19 07-Apr-2017 SzuWei Lin <szuweilin@google.com> Fix memory and file leak

Bug: 35652061
Test: valgrind --leak-check=yes --show-reachable=yes ufdt_apply_overlay ...
and result no leak

Change-Id: Iec0fe77468d2fdf6c692209cd9571c02f96e2e44
/system/libufdt/ufdt_overlay.c
fba5805ed826ca556434911f67cd7a0aed987990 20-Mar-2017 SzuWei Lin <szuweilin@google.com> Handle overlaying without node __symbols__

In new version of dtc, it does not always generate __symbols__ node:

https://github.com/dgibson/dtc/commit/e3c769aa9c16e7b94051c5eaae6635e79ac19385

Revises libufdt to handle main DT without node __symbols__.

Bug: 35230516
Test: tests/run_tests.sh
Change-Id: Ie086abc93ed4d45e4fe28c1d8c48fd37873256c1
/system/libufdt/ufdt_overlay.c
f6c209b3f409f879305ac9837524b9d34c850de6 27-Nov-2016 Li Chen <akaineko@google.com> libufdt: device tree overlay via unflattening FDT

The original version of libdtoverlay is slow in searching for
particular nodes and adding subnodes/properties due to the operations
on flattened device tree (FDT).

`libufdt` builds a real tree structure (named ufdt -- unflattned
device tree) from FDT. In the real tree, we can perform certain
operations (e.g., merge 2 subtrees, search for a node by path) in
almost optimal time complexity with acceptable additional memory usage.

With libufdt, we improve the merging of two dtb files from O(N^2) to
O(N), where N is the number of nodes in the tree.

Bug: 30800619
Test: run test scripts (see libufdt/tests/README)
Test: manually ported libufdt into a bootloader,
checked it can merge a base dtb and a dtbo to generate a final dtb
to boot the device

Change-Id: I1ff886bb8a62bad1451edcd7c4fe5cb48b7a034a
/system/libufdt/ufdt_overlay.c
eeaff8f66f44518a0e776957c6e0921f7799ace2 14-Dec-2016 Jeff Hao <jeffhao@google.com> Revert "libufdt: device tree overlay via unflattening FDT"

This reverts commit 3084ce7cbdff84093286459758f99c15082e6556.

Change-Id: I36f8252ea77c75301711009180c1908bb18e231c
/system/libufdt/ufdt_overlay.c
3084ce7cbdff84093286459758f99c15082e6556 27-Nov-2016 LiChen <akaineko@google.com> libufdt: device tree overlay via unflattening FDT

The original version of libdtoverlay is slow in searching for
particular nodes and adding subnodes/properties due to the operations
on flattened device tree (FDT).

`libufdt` builds a real tree structure (named ufdt -- unflattned
device tree) from FDT. In the real tree, we can perform certain
operations (e.g., merge 2 subtrees, search for a node by path) in
almost optimal time complexity with acceptable additional memory usage.

With libufdt, we improve the merging of two dtb files from O(N^2) to
O(N), where N is the number of nodes in the tree.

Bug: 30800619
Test: run test scripts (see libufdt/tests/README)
Test: manually ported libufdt into a bootloader,
checked it can merge a base dtb and a dtbo to generate a final dtb
to boot the device
Change-Id: I6a282cc99129d5280ecbf40852723f83735fa523
/system/libufdt/ufdt_overlay.c