summaryrefslogtreecommitdiff
path: root/src/commonlib/include
diff options
context:
space:
mode:
authorMaximilian Brune <maximilian.brune@9elements.com>2024-07-13 23:53:48 +0200
committerLean Sheng Tan <sheng.tan@9elements.com>2024-07-26 11:06:29 +0000
commit7dae497495a822fb1bb5d8c4a73eff78494d80b3 (patch)
treea5c9515a93cf575cc998273ea7172d8d705d279d /src/commonlib/include
parent2c9a12b588faba7504eac2cbcc4f533317e2dd2c (diff)
commonlib/device_tree.c: Add read reg property helper
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>
Diffstat (limited to 'src/commonlib/include')
-rw-r--r--src/commonlib/include/commonlib/device_tree.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/commonlib/include/commonlib/device_tree.h b/src/commonlib/include/commonlib/device_tree.h
index 81377fa9df..c15d7ae5b1 100644
--- a/src/commonlib/include/commonlib/device_tree.h
+++ b/src/commonlib/include/commonlib/device_tree.h
@@ -147,6 +147,8 @@ uint32_t dt_flat_size(const struct device_tree *tree);
/* Flatten a device tree into the buffer pointed to by dest. */
void dt_flatten(const struct device_tree *tree, void *dest);
void dt_print_node(const struct device_tree_node *node);
+size_t dt_read_reg_prop(struct device_tree_node *node, u32 addr_cells, u32 size_cells,
+ struct device_tree_region regions[], size_t regions_count);
/* Read #address-cells and #size-cells properties from a node. */
void dt_read_cell_props(const struct device_tree_node *node, u32 *addrcp,
u32 *sizecp);