xref: /OK3568_Linux_fs/u-boot/tools/fdt_host.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * (C) Copyright 2008 Semihalf
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * SPDX-License-Identifier:	GPL-2.0+
5*4882a593Smuzhiyun  */
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun #ifndef __FDT_HOST_H__
8*4882a593Smuzhiyun #define __FDT_HOST_H__
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun /* Make sure to include u-boot version of libfdt include files */
11*4882a593Smuzhiyun #include "../include/linux/libfdt.h"
12*4882a593Smuzhiyun #include "../include/fdt_support.h"
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun /**
15*4882a593Smuzhiyun  * fdt_remove_unused_strings() - Remove any unused strings from an FDT
16*4882a593Smuzhiyun  *
17*4882a593Smuzhiyun  * This creates a new device tree in @new with unused strings removed. The
18*4882a593Smuzhiyun  * called can then use fdt_pack() to minimise the space consumed.
19*4882a593Smuzhiyun  *
20*4882a593Smuzhiyun  * @old:	Old device tree blog
21*4882a593Smuzhiyun  * @new:	Place to put new device tree blob, which must be as large as
22*4882a593Smuzhiyun  *		@old
23*4882a593Smuzhiyun  * @return
24*4882a593Smuzhiyun  *	0, on success
25*4882a593Smuzhiyun  *	-FDT_ERR_BADOFFSET, corrupt device tree
26*4882a593Smuzhiyun  *	-FDT_ERR_NOSPACE, out of space, which should not happen unless there
27*4882a593Smuzhiyun  *		is something very wrong with the device tree input
28*4882a593Smuzhiyun  */
29*4882a593Smuzhiyun int fdt_remove_unused_strings(const void *old, void *new);
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun int fit_check_sign(const void *working_fdt, const void *key, int is_spl);
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun #endif /* __FDT_HOST_H__ */
34