summaryrefslogtreecommitdiff
path: root/src/commonlib/device_tree.c
AgeCommit message (Collapse)Author
2024-08-08commonlib/device_tree.c: Remove incorrect warningMaximilian Brune
Currently a warning is printed even if the maximum amount of nodes is not exceeded. Remove the warning, since in most cases the maximum amount of nodes for a given prefix is usually well known. For example the /cpu nodes always have a maximum of CONFIG_MAX_CPUS. One may also just want to read the first X amount of nodes matching a given prefix. Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Change-Id: Ic1111e8acb72ea1e9159da0d8386f40cbbdbc63f Reviewed-on: https://review.coreboot.org/c/coreboot/+/83085 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
2024-07-26commonlib/device_tree.c: Add read reg property helperMaximilian Brune
Add a helper function to read the reg property from an unflattened device tree. It also factors out the common code into a new function called `read_reg_prop`. Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Change-Id: I7846eb8af390d709b0757262025cb819e9988699 Reviewed-on: https://review.coreboot.org/c/coreboot/+/83457 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
2024-06-27commonlib/device_tree: Improve node and property allocation speedJulius Werner
Now that the device tree code has been made available in libpayload, we should reintroduce the node and property allocation optimization for libpayload's memory allocator that was originally dropped when porting this code from depthcharge to coreboot. On a Qualcomm SC7180 unflattening a normal ChromeOS kernel device tree, this saves roughly ~145ms. The total scratch space used is about ~1350 nodes and ~5200 properties, so we leave a little room to grow with the constants hardcoded here. Change-Id: I0f4d80a8b750febfb069b32ef47304ccecdc35af Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/83208 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com> Reviewed-by: Raul Rangel <rrangel@chromium.org>
2024-06-22treewide: Move device_tree to commonlibMaximilian Brune
Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Change-Id: I990d74d9fff06b17ec8a6ee962955e4b0df8b907 Reviewed-on: https://review.coreboot.org/c/coreboot/+/77970 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>