]>
git.proxmox.com Git - qemu.git/blob - device_tree.h
1e671e25066f3d4df91617c0b7ac8607230467db
2 * Header with function prototypes to help device tree manipulation using
3 * libfdt. It also provides functions to read entries from device tree proc
6 * Copyright 2008 IBM Corporation.
7 * Authors: Jerone Young <jyoung5@us.ibm.com>
8 * Hollis Blanchard <hollisb@us.ibm.com>
10 * This work is licensed under the GNU GPL license version 2 or later.
14 #ifndef __DEVICE_TREE_H__
15 #define __DEVICE_TREE_H__
17 void *load_device_tree(const char *filename_path
, int *sizep
);
19 int qemu_devtree_setprop(void *fdt
, const char *node_path
,
20 const char *property
, void *val_array
, int size
);
21 int qemu_devtree_setprop_cell(void *fdt
, const char *node_path
,
22 const char *property
, uint32_t val
);
23 int qemu_devtree_setprop_string(void *fdt
, const char *node_path
,
24 const char *property
, const char *string
);
25 int qemu_devtree_nop_node(void *fdt
, const char *node_path
);
26 int qemu_devtree_add_subnode(void *fdt
, const char *name
);
28 #define qemu_devtree_setprop_cells(fdt, node_path, property, ...) \
30 uint32_t qdt_tmp[] = { __VA_ARGS__ }; \
33 for (i = 0; i < ARRAY_SIZE(qdt_tmp); i++) { \
34 qdt_tmp[i] = cpu_to_be32(qdt_tmp[i]); \
36 qemu_devtree_setprop(fdt, node_path, property, qdt_tmp, \
40 #endif /* __DEVICE_TREE_H__ */