From 3fca4ed45ea38081941a06531c114e463ef1a725 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Fri, 10 Aug 2018 10:12:35 +0200 Subject: lib/fit: support booting initrd placed above 4GiB Store initrd offset as 64bit integer. Tested on Cavium CN81XX EVB: The initrd could be loaded when placed above 4GiB. Previously it failed to find the initrd. Change-Id: I5d1ae860ae4a4465546bc0ef89937d611d1e56ab Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/28002 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Philipp Deppenwiese --- src/lib/device_tree.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/lib/device_tree.c') diff --git a/src/lib/device_tree.c b/src/lib/device_tree.c index a905dbf893..89387ffdbf 100644 --- a/src/lib/device_tree.c +++ b/src/lib/device_tree.c @@ -881,6 +881,22 @@ void dt_add_u32_prop(struct device_tree_node *node, const char *name, u32 val) dt_add_bin_prop(node, name, val_ptr, sizeof(*val_ptr)); } +/* + * Add a 64-bit integer property to a node, or update it if it already exists. + * + * @param node The device tree node to add to. + * @param name The name of the new property. + * @param val The integer to be stored in the property. + */ +void dt_add_u64_prop(struct device_tree_node *node, const char *name, u64 val) +{ + u64 *val_ptr = malloc(sizeof(val)); + if (!val_ptr) + return; + *val_ptr = htobe64(val); + dt_add_bin_prop(node, name, val_ptr, sizeof(*val_ptr)); +} + /* * Add a 'reg' address list property to a node, or update it if it exists. * -- cgit v1.2.3