summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/device_tree.c16
-rw-r--r--src/lib/fit.c9
2 files changed, 20 insertions, 5 deletions
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
@@ -882,6 +882,22 @@ void dt_add_u32_prop(struct device_tree_node *node, const char *name, u32 val)
}
/*
+ * 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.
*
* @param node The device tree node to add to.
diff --git a/src/lib/fit.c b/src/lib/fit.c
index fe8a82ef97..68f5bed2b8 100644
--- a/src/lib/fit.c
+++ b/src/lib/fit.c
@@ -212,12 +212,11 @@ void fit_add_ramdisk(struct device_tree *tree, void *ramdisk_addr,
struct device_tree_node *node;
node = dt_find_node(tree->root, path, NULL, NULL, 1);
- /* Warning: this assumes the ramdisk is currently located below 4GiB. */
- u32 start = (uintptr_t)ramdisk_addr;
- u32 end = start + ramdisk_size;
+ u64 start = (uintptr_t)ramdisk_addr;
+ u64 end = start + ramdisk_size;
- dt_add_u32_prop(node, "linux,initrd-start", start);
- dt_add_u32_prop(node, "linux,initrd-end", end);
+ dt_add_u64_prop(node, "linux,initrd-start", start);
+ dt_add_u64_prop(node, "linux,initrd-end", end);
}
static void update_reserve_map(uint64_t start, uint64_t end,