| 
     
      
      
      From: Jerone Y. <jy...@us...> - 2008-05-05 16:07:34
      
     
   | 
# HG changeset patch
# User Jerone Young <jy...@us...>
# Date 1210003408 18000
# Branch merge
# Node ID cf3ccc3add69052aade695c746151b1cb8812252
# Parent  97e439fdd4e91c3fb1ef9055f073add55084d69f
Add function dt_cell_multi to hw/device_tree.c
This patch adds function dt_cell_multi to allow for manipulation of device tree properties that contain mulitiple 32bit values.
Signed-off-by: Jerone Young <jy...@us...>
diff --git a/qemu/hw/device_tree.c b/qemu/hw/device_tree.c
--- a/qemu/hw/device_tree.c
+++ b/qemu/hw/device_tree.c
@@ -162,6 +162,21 @@ void dt_cell(void *fdt, char *node_path,
 	}
 }
 
+/* This function is to manipulate a cell with multiple values */
+void dt_cell_multi(void *fdt, char *node_path, char *property,
+			uint32_t *val_array, int size)
+{
+	int offset;
+	int ret;
+	offset = get_offset_of_node(fdt, node_path);
+	ret = fdt_setprop(fdt, offset, property, val_array, size);
+	if (ret < 0) {
+		printf("Unable to set device tree property '%s'\n",
+			property);
+		exit(1);
+	}
+}
+
 void dt_string(void *fdt, char *node_path, char *property,
 		char *string)
 {
diff --git a/qemu/hw/device_tree.h b/qemu/hw/device_tree.h
--- a/qemu/hw/device_tree.h
+++ b/qemu/hw/device_tree.h
@@ -19,6 +19,8 @@ void dump_device_tree_to_file(void *fdt,
 void dump_device_tree_to_file(void *fdt, char *filename);
 void dt_cell(void *fdt, char *node_path, char *property,
 		uint32_t val);
+void dt_cell_multi(void *fdt, char *node_path, char *property,
+		uint32_t *val_array, int size);
 void dt_string(void *fdt, char *node_path, char *property,
 		char *string);
 void dt_node(void *fdt, char *node_parent_path, char *name);
 |