core: dt: cache embedded DTB node informationOptimize OP-TEE boot time regarding parsing of the embedded DTBcontent when using libfdt. The library functions fdt_parent_offset()and fdt_node_offset
core: dt: cache embedded DTB node informationOptimize OP-TEE boot time regarding parsing of the embedded DTBcontent when using libfdt. The library functions fdt_parent_offset()and fdt_node_offset_by_phandle() are not very efficient since theyparse the DTB from root node to target node to look up for,respectively, the node offset of a node parent and the node offsetrelated to a node phandle. Helper functions fdt_reg_base_address()and fdt_reg_size() are also affected since they are based onfdt_parent_offset() to find the #address-cells and #size-cellsproperties of a node parent.Optimize this by parsing the embedded DT once and caching nodeinformation (parent node, phandle value, parent node #address-cellsand #size-cells values) in a array. Parse the array instead of theDT for find these information.We made few tests to use bisection or hash tables for look up theinformation in the cache array. The gain was very small, likely dueto the number of DT node involved in the platform is relatively small(only several hundreds or nodes).This feature is enabled upon configuration switch CFG_DT_CACHED_NODE_INFO.Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
libfdt: move to version v1.5.1Imports upstream libfdt version v1.5.1 [1]. Things worthy of note: - SPDX license identifiers were added upstream in commit 94f87cd5b7c5 ("libfdt: Add dual GPL/BSD
libfdt: move to version v1.5.1Imports upstream libfdt version v1.5.1 [1]. Things worthy of note: - SPDX license identifiers were added upstream in commit 94f87cd5b7c5 ("libfdt: Add dual GPL/BSD SPDX tags to files missing license text"). They conflict with those we have added locally in commit 1bb929836182 ("Add SPDX license identifiers"). We added "BSD-2-Clause" while upstream added "GPL-2.0-or-later OR BSD-2-Clause". This commit keeps the upstream tags. - At this stage we carry no local modification except for two minor things enabling C99 compliance: 1. Zero sized arrays at the end of structs fdt_node_header and fdt_property are changed from "[0]" to "[]", 2. An extra semicolon is removed after the static function overlay_fixup_one_phandle(). These changes were in the initial import already, commit b908c67504cd ("Import libfdt v1.4.1").Link: [1] https://github.com/dgibson/dtc/tree/v1.5.1/libfdtSigned-off-by: Jerome Forissier <jerome@forissier.org>Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
libfdt: Move to version v1.4.6-9This import adds FDT overlay plus brings in the latest bugfixes upstream.As noted in the below url, there is a performance problem with 1.4.7 so wetarget version
libfdt: Move to version v1.4.6-9This import adds FDT overlay plus brings in the latest bugfixes upstream.As noted in the below url, there is a performance problem with 1.4.7 so wetarget version 1.4.6-9 instead.https://github.com/ARM-software/arm-trusted-firmware/pull/1657Upstream commit aadd0b65c987 ("checks: centralize printing of propertynames in failure messages")Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>Suggested-by: Jens Wiklander <jens.wiklander@linaro.org>Suggested-by: Etienne Carriere <etienne.carriere@linaro.org>Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Add SPDX license identifiersAdds one SPDX-License-Identifier line [1] to each source files thatcontains license text.Generated by [2]: spdxify.py --add-spdx optee_os/The scancode tool [3] wa
Add SPDX license identifiersAdds one SPDX-License-Identifier line [1] to each source files thatcontains license text.Generated by [2]: spdxify.py --add-spdx optee_os/The scancode tool [3] was used to double check the license matchingcode in the Python script. All the licenses detected by scancode areeither detected by spdxify.py, or have no SPDX identifier, or are falsematches.Link: [1] https://spdx.org/licenses/Link: [2] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.pyLink: [3] https://github.com/nexB/scancode-toolkitSigned-off-by: Jerome Forissier <jerome.forissier@linaro.org>Acked-by: Joakim Bech <joakim.bech@linaro.org>
libfdt: fix undefined behaviour in fdt_offset_ptr()Upstream commit d0b3ab0a0f46 ("libfdt: Fix undefined behaviour infdt_offset_ptr()").Using pointer arithmetic to generate a pointer outside a kn
libfdt: fix undefined behaviour in fdt_offset_ptr()Upstream commit d0b3ab0a0f46 ("libfdt: Fix undefined behaviour infdt_offset_ptr()").Using pointer arithmetic to generate a pointer outside a known object is,technically, undefined behaviour in C. Unfortunately, we were using thatin fdt_offset_ptr() to detect overflows.To fix this we need to do our bounds / overflow checking on the offsetsbefore constructing pointers from them.Acked-by: Jerome Forissier <jerome.forissier@linaro.org>Fixes: https://github.com/OP-TEE/optee_os/issues/1967Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
libfdt: undef sanitizer fix fdt_setprop()Fixes undefined sanitizer problem in fdt_setprop().The compiler (gcc 5.3) issues some runtime checks with-fsanitize=undefined which is triggered if for i
libfdt: undef sanitizer fix fdt_setprop()Fixes undefined sanitizer problem in fdt_setprop().The compiler (gcc 5.3) issues some runtime checks with-fsanitize=undefined which is triggered if for instance any of thepointers supplied to memcpy() is NULL as val can be in fdt_setprop() ifthere's no value.Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMUv7)Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Import libfdt v1.4.1Imports libfdt code from https://git.kernel.org/cgit/utils/dtc/dtc.gittag "v1.4.1" commit 302fca9f4c283e1994cf0a5a9ce1cf43ca15e6d2.API header files are moved to libfdt/includ
Import libfdt v1.4.1Imports libfdt code from https://git.kernel.org/cgit/utils/dtc/dtc.gittag "v1.4.1" commit 302fca9f4c283e1994cf0a5a9ce1cf43ca15e6d2.API header files are moved to libfdt/include.Small changes to make fdt.h and libfdt.h c99 compiant.Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>Suggested-by: Jerome Forissier <jerome.forissier@linaro.org>Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>