TianoCore EDK2 master
Loading...
Searching...
No Matches
libfdt.h
1#ifndef _LIBFDT_H
2#define _LIBFDT_H
3
4/*
5 * libfdt - Flat Device Tree manipulation
6 * Copyright (C) 2006 David Gibson, IBM Corporation.
7 *
8 * libfdt is dual licensed: you can use it either under the terms of
9 * the GPL, or the BSD license, at your option.
10 *
11 * a) This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public
22 * License along with this library; if not, write to the Free
23 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
24 * MA 02110-1301 USA
25 *
26 * Alternatively,
27 *
28 * b) Redistribution and use in source and binary forms, with or
29 * without modification, are permitted provided that the following
30 * conditions are met:
31 *
32 * 1. Redistributions of source code must retain the above
33 * copyright notice, this list of conditions and the following
34 * disclaimer.
35 * 2. Redistributions in binary form must reproduce the above
36 * copyright notice, this list of conditions and the following
37 * disclaimer in the documentation and/or other materials
38 * provided with the distribution.
39 *
40 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
41 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
42 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
43 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
44 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
45 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
46 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
47 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
48 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
50 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
51 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
52 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53 */
54
55#include <libfdt_env.h>
56#include <fdt.h>
57
58#define FDT_FIRST_SUPPORTED_VERSION 0x10
59#define FDT_LAST_SUPPORTED_VERSION 0x11
60
61/* Error codes: informative error codes */
62#define FDT_ERR_NOTFOUND 1
63/* FDT_ERR_NOTFOUND: The requested node or property does not exist */
64#define FDT_ERR_EXISTS 2
65
66/* FDT_ERR_EXISTS: Attempted to create a node or property which
67 * already exists */
68#define FDT_ERR_NOSPACE 3
69
70/* FDT_ERR_NOSPACE: Operation needed to expand the device
71 * tree, but its buffer did not have sufficient space to
72 * contain the expanded tree. Use fdt_open_into() to move the
73 * device tree to a buffer with more space. */
74
75/* Error codes: codes for bad parameters */
76#define FDT_ERR_BADOFFSET 4
77
78/* FDT_ERR_BADOFFSET: Function was passed a structure block
79 * offset which is out-of-bounds, or which points to an
80 * unsuitable part of the structure for the operation. */
81#define FDT_ERR_BADPATH 5
82
83/* FDT_ERR_BADPATH: Function was passed a badly formatted path
84 * (e.g. missing a leading / for a function which requires an
85 * absolute path) */
86#define FDT_ERR_BADPHANDLE 6
87
88/* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle.
89 * This can be caused either by an invalid phandle property
90 * length, or the phandle value was either 0 or -1, which are
91 * not permitted. */
92#define FDT_ERR_BADSTATE 7
93
94/* FDT_ERR_BADSTATE: Function was passed an incomplete device
95 * tree created by the sequential-write functions, which is
96 * not sufficiently complete for the requested operation. */
97
98/* Error codes: codes for bad device tree blobs */
99#define FDT_ERR_TRUNCATED 8
100
101/* FDT_ERR_TRUNCATED: Structure block of the given device tree
102 * ends without an FDT_END tag. */
103#define FDT_ERR_BADMAGIC 9
104
105/* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
106 * device tree at all - it is missing the flattened device
107 * tree magic number. */
108#define FDT_ERR_BADVERSION 10
109
110/* FDT_ERR_BADVERSION: Given device tree has a version which
111 * can't be handled by the requested operation. For
112 * read-write functions, this may mean that fdt_open_into() is
113 * required to convert the tree to the expected version. */
114#define FDT_ERR_BADSTRUCTURE 11
115
116/* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
117 * structure block or other serious error (e.g. misnested
118 * nodes, or subnodes preceding properties). */
119#define FDT_ERR_BADLAYOUT 12
120
121/* FDT_ERR_BADLAYOUT: For read-write functions, the given
122 * device tree has it's sub-blocks in an order that the
123 * function can't handle (memory reserve map, then structure,
124 * then strings). Use fdt_open_into() to reorganize the tree
125 * into a form suitable for the read-write operations. */
126
127/* "Can't happen" error indicating a bug in libfdt */
128#define FDT_ERR_INTERNAL 13
129
130/* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
131 * Should never be returned, if it is, it indicates a bug in
132 * libfdt itself. */
133
134/* Errors in device tree content */
135#define FDT_ERR_BADNCELLS 14
136
137/* FDT_ERR_BADNCELLS: Device tree has a #address-cells, #size-cells
138 * or similar property with a bad format or value */
139
140#define FDT_ERR_BADVALUE 15
141
142/* FDT_ERR_BADVALUE: Device tree has a property with an unexpected
143 * value. For example: a property expected to contain a string list
144 * is not NUL-terminated within the length of its value. */
145
146#define FDT_ERR_BADOVERLAY 16
147
148/* FDT_ERR_BADOVERLAY: The device tree overlay, while
149 * correctly structured, cannot be applied due to some
150 * unexpected or missing value, property or node. */
151
152#define FDT_ERR_NOPHANDLES 17
153
154/* FDT_ERR_NOPHANDLES: The device tree doesn't have any
155 * phandle available anymore without causing an overflow */
156
157#define FDT_ERR_MAX 17
158
159/**********************************************************************/
160/* Low-level functions (you probably don't need these) */
161/**********************************************************************/
162
163#ifndef SWIG /* This function is not useful in Python */
164const void *
165fdt_offset_ptr (
166 const void *fdt,
167 int offset,
168 unsigned int checklen
169 );
170
171#endif
172static inline void *
173fdt_offset_ptr_w (
174 void *fdt,
175 int offset,
176 int checklen
177 )
178{
179 return (void *)(uintptr_t)fdt_offset_ptr (fdt, offset, checklen);
180}
181
182uint32_t
183fdt_next_tag (
184 const void *fdt,
185 int offset,
186 int *nextoffset
187 );
188
189/**********************************************************************/
190/* Traversal functions */
191/**********************************************************************/
192
193int
194fdt_next_node (
195 const void *fdt,
196 int offset,
197 int *depth
198 );
199
207int
208fdt_first_subnode (
209 const void *fdt,
210 int offset
211 );
212
224int
225fdt_next_subnode (
226 const void *fdt,
227 int offset
228 );
229
253#define fdt_for_each_subnode(node, fdt, parent) \
254 for (node = fdt_first_subnode(fdt, parent); \
255 node >= 0; \
256 node = fdt_next_subnode(fdt, node))
257
258/**********************************************************************/
259/* General functions */
260/**********************************************************************/
261#define fdt_get_header(fdt, field) \
262 (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
263#define fdt_magic(fdt) (fdt_get_header(fdt, magic))
264#define fdt_totalsize(fdt) (fdt_get_header(fdt, totalsize))
265#define fdt_off_dt_struct(fdt) (fdt_get_header(fdt, off_dt_struct))
266#define fdt_off_dt_strings(fdt) (fdt_get_header(fdt, off_dt_strings))
267#define fdt_off_mem_rsvmap(fdt) (fdt_get_header(fdt, off_mem_rsvmap))
268#define fdt_version(fdt) (fdt_get_header(fdt, version))
269#define fdt_last_comp_version(fdt) (fdt_get_header(fdt, last_comp_version))
270#define fdt_boot_cpuid_phys(fdt) (fdt_get_header(fdt, boot_cpuid_phys))
271#define fdt_size_dt_strings(fdt) (fdt_get_header(fdt, size_dt_strings))
272#define fdt_size_dt_struct(fdt) (fdt_get_header(fdt, size_dt_struct))
273
274#define __fdt_set_hdr(name) \
275 static inline void fdt_set_##name(void *fdt, uint32_t val) \
276 { \
277 struct fdt_header *fdth = (struct fdt_header *)fdt; \
278 fdth->name = cpu_to_fdt32(val); \
279 }
280__fdt_set_hdr (magic);
281__fdt_set_hdr (totalsize);
282__fdt_set_hdr (off_dt_struct);
283__fdt_set_hdr (off_dt_strings);
284__fdt_set_hdr (off_mem_rsvmap);
285__fdt_set_hdr (version);
286__fdt_set_hdr (last_comp_version);
287__fdt_set_hdr (boot_cpuid_phys);
288__fdt_set_hdr (size_dt_strings);
289__fdt_set_hdr (size_dt_struct);
290#undef __fdt_set_hdr
291
306int
307fdt_check_header (
308 const void *fdt
309 );
310
330int
331fdt_move (
332 const void *fdt,
333 void *buf,
334 int bufsize
335 );
336
337/**********************************************************************/
338/* Read-only functions */
339/**********************************************************************/
340
353const char *
354fdt_string (
355 const void *fdt,
356 int stroffset
357 );
358
372uint32_t
373fdt_get_max_phandle (
374 const void *fdt
375 );
376
388int
389fdt_num_mem_rsv (
390 const void *fdt
391 );
392
408int
409fdt_get_mem_rsv (
410 const void *fdt,
411 int n,
412 uint64_t *address,
413 uint64_t *size
414 );
415
428#ifndef SWIG /* Not available in Python */
429int
430fdt_subnode_offset_namelen (
431 const void *fdt,
432 int parentoffset,
433 const char *name,
434 int namelen
435 );
436
437#endif
438
463int
464fdt_subnode_offset (
465 const void *fdt,
466 int parentoffset,
467 const char *name
468 );
469
479#ifndef SWIG /* Not available in Python */
480int
481fdt_path_offset_namelen (
482 const void *fdt,
483 const char *path,
484 int namelen
485 );
486
487#endif
488
512int
513fdt_path_offset (
514 const void *fdt,
515 const char *path
516 );
517
541const char *
542fdt_get_name (
543 const void *fdt,
544 int nodeoffset,
545 int *lenp
546 );
547
566int
567fdt_first_property_offset (
568 const void *fdt,
569 int nodeoffset
570 );
571
591int
592fdt_next_property_offset (
593 const void *fdt,
594 int offset
595 );
596
619#define fdt_for_each_property_offset(property, fdt, node) \
620 for (property = fdt_first_property_offset(fdt, node); \
621 property >= 0; \
622 property = fdt_next_property_offset(fdt, property))
623
648const struct fdt_property *
649fdt_get_property_by_offset (
650 const void *fdt,
651 int offset,
652 int *lenp
653 );
654
666#ifndef SWIG /* Not available in Python */
667const struct fdt_property *
668fdt_get_property_namelen (
669 const void *fdt,
670 int nodeoffset,
671 const char *name,
672 int namelen,
673 int *lenp
674 );
675
676#endif
677
706const struct fdt_property *
707fdt_get_property (
708 const void *fdt,
709 int nodeoffset,
710 const char *name,
711 int *lenp
712 );
713
714static inline struct fdt_property *
715fdt_get_property_w (
716 void *fdt,
717 int nodeoffset,
718 const char *name,
719 int *lenp
720 )
721{
722 return (struct fdt_property *)(uintptr_t)
723 fdt_get_property (fdt, nodeoffset, name, lenp);
724}
725
757#ifndef SWIG /* This function is not useful in Python */
758const void *
759fdt_getprop_by_offset (
760 const void *fdt,
761 int offset,
762 const char **namep,
763 int *lenp
764 );
765
766#endif
767
779#ifndef SWIG /* Not available in Python */
780const void *
781fdt_getprop_namelen (
782 const void *fdt,
783 int nodeoffset,
784 const char *name,
785 int namelen,
786 int *lenp
787 );
788
789static inline void *
790fdt_getprop_namelen_w (
791 void *fdt,
792 int nodeoffset,
793 const char *name,
794 int namelen,
795 int *lenp
796 )
797{
798 return (void *)(uintptr_t)fdt_getprop_namelen (
799 fdt,
800 nodeoffset,
801 name,
802 namelen,
803 lenp
804 );
805}
806
807#endif
808
837const void *
838fdt_getprop (
839 const void *fdt,
840 int nodeoffset,
841 const char *name,
842 int *lenp
843 );
844
845static inline void *
846fdt_getprop_w (
847 void *fdt,
848 int nodeoffset,
849 const char *name,
850 int *lenp
851 )
852{
853 return (void *)(uintptr_t)fdt_getprop (fdt, nodeoffset, name, lenp);
854}
855
868uint32_t
869fdt_get_phandle (
870 const void *fdt,
871 int nodeoffset
872 );
873
883#ifndef SWIG /* Not available in Python */
884const char *
885fdt_get_alias_namelen (
886 const void *fdt,
887 const char *name,
888 int namelen
889 );
890
891#endif
892
905const char *
906fdt_get_alias (
907 const void *fdt,
908 const char *name
909 );
910
936int
937fdt_get_path (
938 const void *fdt,
939 int nodeoffset,
940 char *buf,
941 int buflen
942 );
943
974int
975fdt_supernode_atdepth_offset (
976 const void *fdt,
977 int nodeoffset,
978 int supernodedepth,
979 int *nodedepth
980 );
981
1001int
1002fdt_node_depth (
1003 const void *fdt,
1004 int nodeoffset
1005 );
1006
1028int
1029fdt_parent_offset (
1030 const void *fdt,
1031 int nodeoffset
1032 );
1033
1072int
1073fdt_node_offset_by_prop_value (
1074 const void *fdt,
1075 int startoffset,
1076 const char *propname,
1077 const void *propval,
1078 int proplen
1079 );
1080
1100int
1101fdt_node_offset_by_phandle (
1102 const void *fdt,
1103 uint32_t phandle
1104 );
1105
1128int
1129fdt_node_check_compatible (
1130 const void *fdt,
1131 int nodeoffset,
1132 const char *compatible
1133 );
1134
1169int
1170fdt_node_offset_by_compatible (
1171 const void *fdt,
1172 int startoffset,
1173 const char *compatible
1174 );
1175
1188int
1189fdt_stringlist_contains (
1190 const char *strlist,
1191 int listlen,
1192 const char *str
1193 );
1194
1205int
1206fdt_stringlist_count (
1207 const void *fdt,
1208 int nodeoffset,
1209 const char *property
1210 );
1211
1231int
1232fdt_stringlist_search (
1233 const void *fdt,
1234 int nodeoffset,
1235 const char *property,
1236 const char *string
1237 );
1238
1263const char *
1264fdt_stringlist_get (
1265 const void *fdt,
1266 int nodeoffset,
1267 const char *property,
1268 int index,
1269 int *lenp
1270 );
1271
1272/**********************************************************************/
1273/* Read-only functions (addressing related) */
1274/**********************************************************************/
1275
1285#define FDT_MAX_NCELLS 4
1286
1305int
1306fdt_address_cells (
1307 const void *fdt,
1308 int nodeoffset
1309 );
1310
1330int
1331fdt_size_cells (
1332 const void *fdt,
1333 int nodeoffset
1334 );
1335
1336/**********************************************************************/
1337/* Write-in-place functions */
1338/**********************************************************************/
1339
1356#ifndef SWIG /* Not available in Python */
1357int
1358fdt_setprop_inplace_namelen_partial (
1359 void *fdt,
1360 int nodeoffset,
1361 const char *name,
1362 int namelen,
1363 uint32_t idx,
1364 const void *val,
1365 int len
1366 );
1367
1368#endif
1369
1398#ifndef SWIG /* Not available in Python */
1399int
1400fdt_setprop_inplace (
1401 void *fdt,
1402 int nodeoffset,
1403 const char *name,
1404 const void *val,
1405 int len
1406 );
1407
1408#endif
1409
1438static inline int
1439fdt_setprop_inplace_u32 (
1440 void *fdt,
1441 int nodeoffset,
1442 const char *name,
1443 uint32_t val
1444 )
1445{
1446 fdt32_t tmp = cpu_to_fdt32 (val);
1447
1448 return fdt_setprop_inplace (fdt, nodeoffset, name, &tmp, sizeof (tmp));
1449}
1450
1479static inline int
1480fdt_setprop_inplace_u64 (
1481 void *fdt,
1482 int nodeoffset,
1483 const char *name,
1484 uint64_t val
1485 )
1486{
1487 fdt64_t tmp = cpu_to_fdt64 (val);
1488
1489 return fdt_setprop_inplace (fdt, nodeoffset, name, &tmp, sizeof (tmp));
1490}
1491
1497static inline int
1498fdt_setprop_inplace_cell (
1499 void *fdt,
1500 int nodeoffset,
1501 const char *name,
1502 uint32_t val
1503 )
1504{
1505 return fdt_setprop_inplace_u32 (fdt, nodeoffset, name, val);
1506}
1507
1532int
1533fdt_nop_property (
1534 void *fdt,
1535 int nodeoffset,
1536 const char *name
1537 );
1538
1561int
1562fdt_nop_node (
1563 void *fdt,
1564 int nodeoffset
1565 );
1566
1567/**********************************************************************/
1568/* Sequential write functions */
1569/**********************************************************************/
1570
1571int
1572fdt_create (
1573 void *buf,
1574 int bufsize
1575 );
1576
1577int
1578fdt_resize (
1579 void *fdt,
1580 void *buf,
1581 int bufsize
1582 );
1583
1584int
1585fdt_add_reservemap_entry (
1586 void *fdt,
1587 uint64_t addr,
1588 uint64_t size
1589 );
1590
1591int
1592fdt_finish_reservemap (
1593 void *fdt
1594 );
1595
1596int
1597fdt_begin_node (
1598 void *fdt,
1599 const char *name
1600 );
1601
1602int
1604 void *fdt,
1605 const char *name,
1606 const void *val,
1607 int len
1608 );
1609
1610static inline int
1611fdt_property_u32 (
1612 void *fdt,
1613 const char *name,
1614 uint32_t val
1615 )
1616{
1617 fdt32_t tmp = cpu_to_fdt32 (val);
1618
1619 return fdt_property (fdt, name, &tmp, sizeof (tmp));
1620}
1621
1622static inline int
1623fdt_property_u64 (
1624 void *fdt,
1625 const char *name,
1626 uint64_t val
1627 )
1628{
1629 fdt64_t tmp = cpu_to_fdt64 (val);
1630
1631 return fdt_property (fdt, name, &tmp, sizeof (tmp));
1632}
1633
1634static inline int
1635fdt_property_cell (
1636 void *fdt,
1637 const char *name,
1638 uint32_t val
1639 )
1640{
1641 return fdt_property_u32 (fdt, name, val);
1642}
1643
1657int
1658fdt_property_placeholder (
1659 void *fdt,
1660 const char *name,
1661 int len,
1662 void **valp
1663 );
1664
1665#define fdt_property_string(fdt, name, str) \
1666 fdt_property(fdt, name, str, strlen(str)+1)
1667int
1668fdt_end_node (
1669 void *fdt
1670 );
1671
1672int
1673fdt_finish (
1674 void *fdt
1675 );
1676
1677/**********************************************************************/
1678/* Read-write functions */
1679/**********************************************************************/
1680
1681int
1682fdt_create_empty_tree (
1683 void *buf,
1684 int bufsize
1685 );
1686
1687int
1688fdt_open_into (
1689 const void *fdt,
1690 void *buf,
1691 int bufsize
1692 );
1693
1694int
1695fdt_pack (
1696 void *fdt
1697 );
1698
1721int
1722fdt_add_mem_rsv (
1723 void *fdt,
1724 uint64_t address,
1725 uint64_t size
1726 );
1727
1750int
1751fdt_del_mem_rsv (
1752 void *fdt,
1753 int n
1754 );
1755
1780int
1781fdt_set_name (
1782 void *fdt,
1783 int nodeoffset,
1784 const char *name
1785 );
1786
1815int
1816fdt_setprop (
1817 void *fdt,
1818 int nodeoffset,
1819 const char *name,
1820 const void *val,
1821 int len
1822 );
1823
1852int
1853fdt_setprop_placeholder (
1854 void *fdt,
1855 int nodeoffset,
1856 const char *name,
1857 int len,
1858 void **prop_data
1859 );
1860
1889static inline int
1890fdt_setprop_u32 (
1891 void *fdt,
1892 int nodeoffset,
1893 const char *name,
1894 uint32_t val
1895 )
1896{
1897 fdt32_t tmp = cpu_to_fdt32 (val);
1898
1899 return fdt_setprop (fdt, nodeoffset, name, &tmp, sizeof (tmp));
1900}
1901
1930static inline int
1931fdt_setprop_u64 (
1932 void *fdt,
1933 int nodeoffset,
1934 const char *name,
1935 uint64_t val
1936 )
1937{
1938 fdt64_t tmp = cpu_to_fdt64 (val);
1939
1940 return fdt_setprop (fdt, nodeoffset, name, &tmp, sizeof (tmp));
1941}
1942
1948static inline int
1949fdt_setprop_cell (
1950 void *fdt,
1951 int nodeoffset,
1952 const char *name,
1953 uint32_t val
1954 )
1955{
1956 return fdt_setprop_u32 (fdt, nodeoffset, name, val);
1957}
1958
1987#define fdt_setprop_string(fdt, nodeoffset, name, str) \
1988 fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
1989
2016#define fdt_setprop_empty(fdt, nodeoffset, name) \
2017 fdt_setprop((fdt), (nodeoffset), (name), NULL, 0)
2018
2046int
2047fdt_appendprop (
2048 void *fdt,
2049 int nodeoffset,
2050 const char *name,
2051 const void *val,
2052 int len
2053 );
2054
2083static inline int
2084fdt_appendprop_u32 (
2085 void *fdt,
2086 int nodeoffset,
2087 const char *name,
2088 uint32_t val
2089 )
2090{
2091 fdt32_t tmp = cpu_to_fdt32 (val);
2092
2093 return fdt_appendprop (fdt, nodeoffset, name, &tmp, sizeof (tmp));
2094}
2095
2124static inline int
2125fdt_appendprop_u64 (
2126 void *fdt,
2127 int nodeoffset,
2128 const char *name,
2129 uint64_t val
2130 )
2131{
2132 fdt64_t tmp = cpu_to_fdt64 (val);
2133
2134 return fdt_appendprop (fdt, nodeoffset, name, &tmp, sizeof (tmp));
2135}
2136
2142static inline int
2143fdt_appendprop_cell (
2144 void *fdt,
2145 int nodeoffset,
2146 const char *name,
2147 uint32_t val
2148 )
2149{
2150 return fdt_appendprop_u32 (fdt, nodeoffset, name, val);
2151}
2152
2180#define fdt_appendprop_string(fdt, nodeoffset, name, str) \
2181 fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
2182
2205int
2206fdt_delprop (
2207 void *fdt,
2208 int nodeoffset,
2209 const char *name
2210 );
2211
2224#ifndef SWIG /* Not available in Python */
2225int
2226fdt_add_subnode_namelen (
2227 void *fdt,
2228 int parentoffset,
2229 const char *name,
2230 int namelen
2231 );
2232
2233#endif
2234
2266int
2267fdt_add_subnode (
2268 void *fdt,
2269 int parentoffset,
2270 const char *name
2271 );
2272
2294int
2295fdt_del_node (
2296 void *fdt,
2297 int nodeoffset
2298 );
2299
2329int
2330fdt_overlay_apply (
2331 void *fdt,
2332 void *fdto
2333 );
2334
2335/**********************************************************************/
2336/* Debugging / informational functions */
2337/**********************************************************************/
2338
2339const char *
2340fdt_strerror (
2341 int errval
2342 );
2343
2344#endif /* _LIBFDT_H */